Skip to main content

MenuTheme

Struct MenuTheme 

Source
pub struct MenuTheme {
Show 21 fields pub background_color: Option<Rgba>, pub separator_color: Option<Rgba>, pub row_height: Option<f32>, pub min_row_height: Option<f32>, pub icon_text_gap: Option<f32>, pub icon_size: Option<f32>, pub hover_background: Option<Rgba>, pub hover_text_color: Option<Rgba>, pub disabled_text_color: Option<Rgba>, pub hover_border_color: Option<Rgba>, pub bar_hover_background: Option<Rgba>, pub bar_open_background: Option<Rgba>, pub bar_hover_text_color: Option<Rgba>, pub bar_padding_horizontal: Option<f32>, pub bar_padding_vertical: Option<f32>, pub active_background: Option<Rgba>, pub active_text_color: Option<Rgba>, pub panel_padding_horizontal: Option<f32>, pub panel_padding_vertical: Option<f32>, pub font: Option<FontSpec>, pub border: Option<WidgetBorderSpec>,
}
Expand description

Popup and context menu appearance, and the menu bar’s titles.

A menu bar is filled with toolbar.background_color, the fill of the one tools area Breeze paints (docs/platform-facts.md §2.6, §2.13).

Fields§

§background_color: Option<Rgba>

Menu panel background fill.

§separator_color: Option<Rgba>

Separator line color between menu items.

§row_height: Option<f32>

Height of an item row, drawn exactly at a text scale of 1. None where the platform states no fixed row height: KDE’s rows size to their content with a floor, min_row_height. Where both are stated, this one is drawn and min_row_height is not applied (docs/platform-facts.md §2.6).

§min_row_height: Option<f32>

Least height of a one-line item row in logical pixels; content taller than it grows the row. Breeze’s row is 29 wherever the text line and the icon are 20 px or less, and the text + 9 above that, where the model’s row grows as the text + border’s vertical padding: one pixel short there. Not applied where row_height is stated. None: the row is its content’s height (docs/platform-facts.md §2.6).

§icon_text_gap: Option<f32>

Space between a menu item’s icon and its label.

§icon_size: Option<f32>

Menu item icon size in logical pixels.

§hover_background: Option<Rgba>

Menu item background on hover. It may be translucent, a layer over the menu’s background_color (kde-breeze states #3daee94d, windows-11 #00000009 light and #ffffff0f dark): lay it over that fill, with composite_over where the toolkit replaces the fill rather than painting the highlight over it.

§hover_text_color: Option<Rgba>

Menu item text color on hover.

§disabled_text_color: Option<Rgba>

Disabled menu item text color.

§hover_border_color: Option<Rgba>

Outline of a hovered item’s highlight, drawn at defaults.border.line_width inside the highlight, over the item’s padding, so nothing moves, and rounded by border.corner_radius: Breeze’s focus colour mixed 15 % towards WindowText. A pressed item draws none where active_background is stated. None: no outline (docs/platform-facts.md §2.6).

§bar_hover_background: Option<Rgba>

Fill of a menu-bar title under the pointer, rounded by border.corner_radius: Breeze’s opaque hover colour. None: the title keeps the connector’s own look (docs/platform-facts.md §2.6).

§bar_open_background: Option<Rgba>

Fill of a menu-bar title whose menu is open: Breeze’s focus colour. None: bar_hover_background; with both None, the connector’s own look (docs/platform-facts.md §2.6).

§bar_hover_text_color: Option<Rgba>

Text colour of a menu-bar title under the pointer or open: Breeze’s HighlightedText. None: the title keeps its text colour (docs/platform-facts.md §2.6).

§bar_padding_horizontal: Option<f32>

Inset of a menu-bar title’s text from its left and right edge, in logical pixels: Breeze’s MenuBarItem_MarginWidth 10; titles so padded touch. None: the connector’s own title padding (docs/platform-facts.md §2.6).

§bar_padding_vertical: Option<f32>

Inset of a menu-bar title’s text from its top and bottom edge, in logical pixels: Breeze’s MenuBarItem_MarginHeight 6. None: the connector’s own title padding (docs/platform-facts.md §2.6).

§active_background: Option<Rgba>

Fill of an item while the mouse button is held on it: Breeze’s opaque focus colour. Where it is stated, a pressed item draws no hover_border_color outline (Breeze’s outline is the fill’s own colour). None: a pressed item keeps the hover look, outline included (docs/platform-facts.md §2.6).

§active_text_color: Option<Rgba>

Text colour of a pressed item: Breeze’s HighlightedText. None: hover_text_color (docs/platform-facts.md §2.6).

§panel_padding_horizontal: Option<f32>

Inset of the items from the left and right of the menu panel’s frame line, in logical pixels; the frame is popover.border’s. Breeze’s PM_MenuHMargin 4 counts from the panel’s outer edge, its 1 px line included, so kde-breeze states 3. Rows so inset touch. None: the items are inset by popover.border’s padding (docs/platform-facts.md §2.6).

§panel_padding_vertical: Option<f32>

Inset of the items from the top and bottom of the menu panel’s frame line, in logical pixels; the frame is popover.border’s. Breeze’s PM_MenuVMargin 4 counts from the panel’s outer edge, its 1 px line included, so kde-breeze states 3. Rows so inset touch. None: the items are inset by popover.border’s padding (docs/platform-facts.md §2.6).

§font: Option<FontSpec>

Menu item font specification.

§border: Option<WidgetBorderSpec>

Menu border specification: its padding insets an item’s contents from the edges of the item’s highlight. Its corner radius is the platform’s menu radius, which KDE gives a hovered item’s highlight and Material the menu’s container (the iced connector rounds a drop-down’s panel with it, the egui connector a menu’s items). It has no colour of its own: the menu’s popup frame is the popover’s, popover.border (docs/platform-facts.md §2.6, §2.16). No bundled preset states this border’s colour or width; unstated, they resolve to transparent and 0.

Implementations§

Source§

impl MenuTheme

Source

pub const FIELD_NAMES: &[&str]

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

Source§

impl MenuTheme

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 MenuTheme

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 MenuTheme

Source§

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

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

impl Default for MenuTheme

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for MenuTheme

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 MenuTheme

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 MenuTheme

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 MenuTheme

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