pub struct MenuColors {
pub container: Color,
pub content: Color,
pub icon_content: Color,
pub supporting_content: Color,
pub selected_container: Color,
pub selected_content: Color,
pub state_layer: Color,
pub divider: Color,
}Expand description
One MenuColorStyle’s resolved roles (M3EMenuColors).
Fields§
§container: ColorThe elevated surface’s fill.
content: ColorAn idle row’s label ink.
icon_content: ColorAn idle row’s leading/trailing icon ink.
supporting_content: ColorSupporting text, shortcuts and section labels.
selected_container: ColorA selected row’s fill.
selected_content: ColorA selected row’s label and icon ink.
state_layer: ColorThe hover/focus/pressed overlay ink.
divider: ColorA divider’s rule.
Implementations§
Source§impl MenuColors
impl MenuColors
Sourcepub fn resolve(theme: Option<&Theme>, style: MenuColorStyle) -> Self
pub fn resolve(theme: Option<&Theme>, style: MenuColorStyle) -> Self
Resolve style’s eight roles from theme, or from the M3 baseline
light values when no theme is threaded into the pass.
Sourcepub fn entry_foreground(
&self,
enabled: bool,
destructive: bool,
selected: bool,
) -> Color
pub fn entry_foreground( &self, enabled: bool, destructive: bool, selected: bool, ) -> Color
A row label’s ink (entryForegroundColor): disabled dims
Self::content to 38%, destructive takes error, selected takes
Self::selected_content.
Sourcepub fn icon_foreground(
&self,
enabled: bool,
destructive: bool,
selected: bool,
) -> Color
pub fn icon_foreground( &self, enabled: bool, destructive: bool, selected: bool, ) -> Color
A row icon’s ink (entryIconForegroundColor) — the same ladder over
Self::icon_content.
Sourcepub fn supporting_foreground(&self, enabled: bool, selected: bool) -> Color
pub fn supporting_foreground(&self, enabled: bool, selected: bool) -> Color
Supporting/shortcut text ink (supportingTextStyle): a disabled row
dims content, not supporting_content — the reference’s own
asymmetry (m3e_menu_theme.dart:361), kept.
Trait Implementations§
Source§impl Clone for MenuColors
impl Clone for MenuColors
impl Copy for MenuColors
Source§impl Debug for MenuColors
impl Debug for MenuColors
Source§impl PartialEq for MenuColors
impl PartialEq for MenuColors
impl StructuralPartialEq for MenuColors
Auto Trait Implementations§
impl Freeze for MenuColors
impl RefUnwindSafe for MenuColors
impl Send for MenuColors
impl Sync for MenuColors
impl Unpin for MenuColors
impl UnsafeUnpin for MenuColors
impl UnwindSafe for MenuColors
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.