#[non_exhaustive]pub struct MenuStyle {Show 16 fields
pub panel_min_width: Option<Pixels>,
pub panel_max_width: Option<Pixels>,
pub panel_max_height: Option<Pixels>,
pub panel_padding: Option<Pixels>,
pub panel_gap: Option<Pixels>,
pub row_height: Option<Pixels>,
pub row_padding_x: Option<Pixels>,
pub row_padding_y: Option<Pixels>,
pub row_text_size: Option<Pixels>,
pub row_gap: Option<Pixels>,
pub row_hover_bg: Option<ComponentColor>,
pub row_hover_foreground: Option<ComponentColor>,
pub radius: Option<Pixels>,
pub separator_inset: Option<Pixels>,
pub separator_thickness: Option<Pixels>,
pub animate_entry: Option<bool>,
}Expand description
Menu panel and row presentation; also inherited by submenus.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.panel_min_width: Option<Pixels>Minimum panel width.
panel_max_width: Option<Pixels>Maximum panel width.
panel_max_height: Option<Pixels>Maximum panel height.
panel_padding: Option<Pixels>Padding inside the panel.
panel_gap: Option<Pixels>Gap between rows in the panel.
row_height: Option<Pixels>Row height.
row_padding_x: Option<Pixels>Horizontal padding on a row.
row_padding_y: Option<Pixels>Vertical padding on a row.
row_text_size: Option<Pixels>Row text size.
row_gap: Option<Pixels>Gap between a row’s contents.
row_hover_bg: Option<ComponentColor>Background of a hovered row.
row_hover_foreground: Option<ComponentColor>Foreground of a hovered row.
radius: Option<Pixels>Corner radius.
separator_inset: Option<Pixels>An absolute horizontal inset on each edge of a
MenuItem::Separator, in place of v3’s proportional
ms-[3%] w-[94%].
Unset keeps that proportional rule. Set, the inset is the same number of pixels at any panel width — AppKit’s own menu separator is inset 15pt on each side inside wider panel bounds.
separator_thickness: Option<Pixels>Thickness of a MenuItem::Separator.
Unset keeps LayoutTheme::border_width, the hairline every other
rule in the port uses.
animate_entry: Option<bool>Whether the panel and its submenus play their entry animation.
Implementations§
Source§impl MenuStyle
impl MenuStyle
Sourcepub fn panel_min_width(self, value: impl Into<Pixels>) -> Self
pub fn panel_min_width(self, value: impl Into<Pixels>) -> Self
Minimum panel width.
Sourcepub fn panel_max_width(self, value: impl Into<Pixels>) -> Self
pub fn panel_max_width(self, value: impl Into<Pixels>) -> Self
Maximum panel width.
Sourcepub fn panel_max_height(self, value: impl Into<Pixels>) -> Self
pub fn panel_max_height(self, value: impl Into<Pixels>) -> Self
Maximum panel height.
Sourcepub fn panel_padding(self, value: impl Into<Pixels>) -> Self
pub fn panel_padding(self, value: impl Into<Pixels>) -> Self
Padding inside the panel.
Sourcepub fn row_height(self, value: impl Into<Pixels>) -> Self
pub fn row_height(self, value: impl Into<Pixels>) -> Self
Row height.
Sourcepub fn row_padding_x(self, value: impl Into<Pixels>) -> Self
pub fn row_padding_x(self, value: impl Into<Pixels>) -> Self
Horizontal padding on a row.
Sourcepub fn row_padding_y(self, value: impl Into<Pixels>) -> Self
pub fn row_padding_y(self, value: impl Into<Pixels>) -> Self
Vertical padding on a row.
Sourcepub fn row_text_size(self, value: impl Into<Pixels>) -> Self
pub fn row_text_size(self, value: impl Into<Pixels>) -> Self
Row text size.
Sourcepub fn row_hover_bg(self, value: impl Into<ComponentColor>) -> Self
pub fn row_hover_bg(self, value: impl Into<ComponentColor>) -> Self
Background of a hovered row.
Sourcepub fn row_hover_foreground(self, value: impl Into<ComponentColor>) -> Self
pub fn row_hover_foreground(self, value: impl Into<ComponentColor>) -> Self
Foreground of a hovered row.
Sourcepub fn separator_inset(self, value: impl Into<Pixels>) -> Self
pub fn separator_inset(self, value: impl Into<Pixels>) -> Self
An absolute horizontal inset on each edge of a
MenuItem::Separator, in place of v3’s proportional
ms-[3%] w-[94%].
Unset keeps that proportional rule. Set, the inset is the same number of pixels at any panel width — AppKit’s own menu separator is inset 15pt on each side inside wider panel bounds.
Sourcepub fn separator_thickness(self, value: impl Into<Pixels>) -> Self
pub fn separator_thickness(self, value: impl Into<Pixels>) -> Self
Thickness of a MenuItem::Separator.
Unset keeps LayoutTheme::border_width, the hairline every other
rule in the port uses.
Sourcepub fn animate_entry(self, value: impl Into<bool>) -> Self
pub fn animate_entry(self, value: impl Into<bool>) -> Self
Whether the panel and its submenus play their entry animation.
Trait Implementations§
Source§impl ComponentStyle for MenuStyle
impl ComponentStyle for MenuStyle
Auto Trait Implementations§
impl Freeze for MenuStyle
impl RefUnwindSafe for MenuStyle
impl Send for MenuStyle
impl Sync for MenuStyle
impl Unpin for MenuStyle
impl UnsafeUnpin for MenuStyle
impl UnwindSafe for MenuStyle
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().