Skip to main content

MenuButtonThemeData

Struct MenuButtonThemeData 

Source
pub struct MenuButtonThemeData {
    pub foreground_color: Option<Color32>,
    pub icon_color: Option<Color32>,
    pub disabled_foreground_color: Option<Color32>,
    pub disabled_icon_color: Option<Color32>,
    pub hover_overlay_opacity: Option<f32>,
    pub pressed_overlay_opacity: Option<f32>,
    pub text_font: Option<FontId>,
    pub min_height: Option<f32>,
    pub icon_size: Option<f32>,
    pub padding_horizontal: Option<f32>,
}
Expand description

Theme data for menu buttons (menu items).

Based on Flutter’s MenuButtonThemeData and _MenuButtonDefaultsM3. Controls the appearance of individual menu items.

§M3 Defaults

  • foreground_color: onSurface
  • icon_color: onSurfaceVariant
  • disabled_foreground_color: onSurface at 38% opacity
  • disabled_icon_color: onSurface at 38% opacity
  • hover_overlay_opacity: 0.08
  • pressed_overlay_opacity: 0.10
  • min_height: 48.0
  • icon_size: 24.0
  • padding_horizontal: 12.0

Fields§

§foreground_color: Option<Color32>

Text/foreground color for enabled menu items.

§icon_color: Option<Color32>

Icon color for enabled menu items.

§disabled_foreground_color: Option<Color32>

Text/foreground color for disabled menu items.

§disabled_icon_color: Option<Color32>

Icon color for disabled menu items.

§hover_overlay_opacity: Option<f32>

Opacity of hover overlay (0.0 to 1.0).

§pressed_overlay_opacity: Option<f32>

Opacity of pressed overlay (0.0 to 1.0).

§text_font: Option<FontId>

Font for menu item text.

§min_height: Option<f32>

Minimum height of a menu item.

§icon_size: Option<f32>

Size of leading/trailing icons.

§padding_horizontal: Option<f32>

Horizontal padding inside each menu item.

Trait Implementations§

Source§

impl Clone for MenuButtonThemeData

Source§

fn clone(&self) -> MenuButtonThemeData

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for MenuButtonThemeData

Source§

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

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

impl Default for MenuButtonThemeData

Source§

fn default() -> Self

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

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> 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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
Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

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

Source§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,