pub struct MenuItemRecipe {
pub item_height: f32,
pub padding_horizontal: f32,
pub padding_leading: f32,
pub icon_column_width: f32,
pub icon_label_gap: f32,
pub shortcut_left_gap: f32,
pub separator_height: f32,
pub item_corner_radius: f32,
}Expand description
Recipe dimensions for RecipeMenuItemStyle.
All fields default to the corresponding module-level pub const.
Override individual fields to tune the menu row without writing a full
custom MenuItemStyle impl.
Four of them describe parts of the row this style does not build itself
— the leading icon column and the trailing chevron column are slots
MenuItem fills before any style runs, and the separator belongs to
MenuSeparator. They reach those call sites through
[MenuItemStyle::metrics], so a style that delegates its row here
should delegate metrics here too.
Fields§
§item_height: f32§padding_horizontal: f32§padding_leading: f32§icon_column_width: f32§icon_label_gap: f32§shortcut_left_gap: f32§separator_height: f32§item_corner_radius: f32Implementations§
Source§impl MenuItemRecipe
impl MenuItemRecipe
Sourcepub fn for_tokens(tokens: &InputTokens) -> Self
pub fn for_tokens(tokens: &InputTokens) -> Self
This recipe’s dimensions resolved against a density’s [InputTokens].
Default is for_tokens(&InputTokens::default()) — the Compact
ladder — so the shipped values below are the Compact column by
construction and cannot drift from it.
Trait Implementations§
Source§impl Clone for MenuItemRecipe
impl Clone for MenuItemRecipe
Source§fn clone(&self) -> MenuItemRecipe
fn clone(&self) -> MenuItemRecipe
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MenuItemRecipe
Source§impl Debug for MenuItemRecipe
impl Debug for MenuItemRecipe
Source§impl Default for MenuItemRecipe
impl Default for MenuItemRecipe
Source§impl PartialEq for MenuItemRecipe
impl PartialEq for MenuItemRecipe
impl StructuralPartialEq for MenuItemRecipe
Auto Trait Implementations§
impl Freeze for MenuItemRecipe
impl RefUnwindSafe for MenuItemRecipe
impl Send for MenuItemRecipe
impl Sync for MenuItemRecipe
impl Unpin for MenuItemRecipe
impl UnsafeUnpin for MenuItemRecipe
impl UnwindSafe for MenuItemRecipe
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more