Skip to main content

TitleBar

Struct TitleBar 

Source
pub struct TitleBar {
    pub height: f32,
    pub leading: f32,
    pub buttons: Option<Rect>,
    pub icon: Option<&'static [u8]>,
    pub hovered: Option<CaptionButton>,
    pub pressed: Option<CaptionButton>,
    pub maximized: bool,
    pub active: bool,
    pub background: Option<Color>,
    pub foreground: Option<Color>,
    pub system_paints: bool,
}
Expand description

The title bar’s line, when the application’s content shares it, as the shell reports it: how tall the line is, and what the system keeps on it.

Fields§

§height: f32

The line’s height, in logical pixels: the system’s.

§leading: f32

Room the system keeps at the line’s start, in logical pixels — buttons it draws itself there.

§buttons: Option<Rect>

Where the system’s three buttons are, in logical pixels from the window’s top left, when the application paints them; None when the system draws them itself.

§icon: Option<&'static [u8]>

The window’s icon, to paint at the line’s start; None when the system shows none there.

§hovered: Option<CaptionButton>

The button the pointer is over.

§pressed: Option<CaptionButton>

The button being pressed.

§maximized: bool

Whether the window is maximized: the middle button then restores.

§active: bool

Whether the window is the active one: an inactive window’s glyphs are quieter.

§background: Option<Color>

The system’s surface for the line, as it would draw its own caption for the window now — active or not; None where the shell cannot tell (milestone 642).

§foreground: Option<Color>

The system’s words on that caption, likewise.

§system_paints: bool

The system paints the line (milestone 643): its backdrop — on Windows 11 the wallpaper-tinted one — and its three buttons, with their own hover and press, show through wherever the application leaves the line transparent. The application then paints neither, unless it was told a background; it paints the window’s icon and its menu bar.

Trait Implementations§

Source§

impl Clone for TitleBar

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TitleBar

Source§

impl Debug for TitleBar

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for TitleBar

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for TitleBar

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.