#[repr(C)]pub struct TitlebarMetrics {Show 15 fields
pub button_side: TitlebarButtonSide,
pub buttons: TitlebarButtons,
pub height: OptionPixelValue,
pub button_area_width: OptionPixelValue,
pub padding_horizontal: OptionPixelValue,
pub safe_area: SafeAreaInsets,
pub title_font: OptionString,
pub title_font_size: OptionF32,
pub title_font_weight: OptionU16,
pub background_active: OptionColorU,
pub background_inactive: OptionColorU,
pub text_active: OptionColorU,
pub text_inactive: OptionColorU,
pub button_hover_background: OptionColorU,
pub close_button_hover_background: OptionColorU,
}Expand description
Metrics for titlebar layout and window chrome.
This provides information needed to correctly position custom titlebar
content when using WindowDecorations::NoTitle (expanded title mode).
Fields§
Which side the window control buttons are on
Which buttons are available
height: OptionPixelValueHeight of the titlebar in pixels
Width reserved for window control buttons (close/min/max) This is the space to avoid when drawing custom title text
padding_horizontal: OptionPixelValueHorizontal padding inside the titlebar
safe_area: SafeAreaInsetsSafe area insets for notched/rounded displays
title_font: OptionStringTitle text font (from SystemFonts::title_font)
title_font_size: OptionF32Title text font size
title_font_weight: OptionU16Title text font weight (400 = normal, 600 = semibold, 700 = bold)
background_active: OptionColorUThe titlebar’s own background while the window HAS focus.
A titlebar is not painted in the window background: every desktop gives
it its own pair of colours and dims them when focus leaves (KDE keeps
them in Colors:Header and [Colors:Header][Inactive]). Without these
a client-side decoration can match the platform’s geometry and still
read as foreign, because the one surface the user compares against the
neighbouring native windows is the wrong colour.
background_inactive: OptionColorUThe titlebar’s background while the window does NOT have focus.
text_active: OptionColorUTitle text colour while focused.
text_inactive: OptionColorUTitle text colour while unfocused.
Background a window-control button takes on hover.
Background the CLOSE button takes on hover — its own colour on every
platform (Breeze and Windows both go red), which is why it is not
folded into button_hover_background.
Implementations§
Source§impl TitlebarMetrics
impl TitlebarMetrics
Sourcepub fn linux_gnome() -> Self
pub fn linux_gnome() -> Self
Linux GNOME-style titlebar (buttons on right by default)
Trait Implementations§
Source§impl Clone for TitlebarMetrics
impl Clone for TitlebarMetrics
Source§fn clone(&self) -> TitlebarMetrics
fn clone(&self) -> TitlebarMetrics
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more