Skip to main content

ToolbarTheme

Struct ToolbarTheme 

Source
pub struct ToolbarTheme {
    pub background_color: Option<Rgba>,
    pub bar_height: Option<f32>,
    pub item_gap: Option<f32>,
    pub icon_size: Option<f32>,
    pub button_hover_background: Option<Rgba>,
    pub button_hover_border_color: Option<Rgba>,
    pub button_active_background: Option<Rgba>,
    pub button_checked_background: Option<Rgba>,
    pub button_checked_border_color: Option<Rgba>,
    pub font: Option<FontSpec>,
    pub border: Option<WidgetBorderSpec>,
}
Expand description

Toolbar sizing, spacing, font, and its buttons’ states.

The five button_* fields are the platform’s toolbar-button look. A platform may give that look to some of a toolbar’s buttons only (GNOME to image, image-text and arrow buttons; a button with a text label alone keeps the ordinary button’s look, libadwaita 1.10.0 _toolbars.scss:2-8); an application applies the connector’s toolbar-button style to those buttons, and the ordinary button’s style to the others.

Fields§

§background_color: Option<Rgba>

Toolbar background color, also a menu bar’s fill: Breeze fills the menu bar and the toolbars as one tools area (docs/platform-facts.md §2.13).

§bar_height: Option<f32>

Toolbar height in logical pixels. None where the platform states no toolbar height: KDE’s toolbar sizes to its content, and GNOME’s .toolbar sets no minimum height (docs/platform-facts.md §2.13).

§item_gap: Option<f32>

Horizontal space between toolbar items. None where the theme cites no source for one (docs/platform-facts.md §2.13 states it for every platform, but a colour scheme has none).

§icon_size: Option<f32>

Toolbar icon size in logical pixels.

§button_hover_background: Option<Rgba>

Fill of a toolbar button under the pointer, painted over the toolbar: a translucent colour is a layer, a transparent one paints nothing. None where the theme states none: a connector draws the hover as it draws a flat button’s (docs/platform-facts.md §2.13).

§button_hover_border_color: Option<Rgba>

Outline of a toolbar button under the pointer, and while it is pressed. None where the theme states none: a connector draws the outline as it draws a flat button’s (docs/platform-facts.md §2.13).

§button_active_background: Option<Rgba>

Fill of a toolbar button while it is pressed, painted over the toolbar. None where the theme states none: a connector draws it as it draws a pressed flat button (docs/platform-facts.md §2.13).

§button_checked_background: Option<Rgba>

Fill of a toolbar button that is checked (a toggle that is on), painted over the toolbar. None where the theme states none: a connector draws it as it draws a selected flat button (docs/platform-facts.md §2.13).

§button_checked_border_color: Option<Rgba>

Outline of a checked toolbar button, drawn at button.border.line_width: Breeze’s ordinary button pen, Button mixed frameContrast towards ButtonText; under the pointer and pressed button_hover_border_color applies. None where the theme states none: a connector draws it as it draws a selected flat button’s (docs/platform-facts.md §2.13).

§font: Option<FontSpec>

Toolbar label font specification.

§border: Option<WidgetBorderSpec>

Toolbar border specification.

Implementations§

Source§

impl ToolbarTheme

Source

pub const FIELD_NAMES: &[&str]

All serialized field names for this widget theme, for TOML linting.

Source§

impl ToolbarTheme

Source

pub fn merge(&mut self, overlay: &Self)

Merge an overlay into this value. Some fields in the overlay replace the corresponding fields in self; None fields are left unchanged. Nested structs are merged recursively.

Source

pub fn is_empty(&self) -> bool

Returns true if all fields are at their default (None/empty) state.

Trait Implementations§

Source§

impl Clone for ToolbarTheme

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 Debug for ToolbarTheme

Source§

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

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

impl Default for ToolbarTheme

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ToolbarTheme

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for ToolbarTheme

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 Serialize for ToolbarTheme

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ToolbarTheme

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more