Skip to main content

MenuTheme

Struct MenuTheme 

Source
pub struct MenuTheme {
    pub text_style: Option<TextStyle>,
    pub background: Option<Color>,
    pub shape: Option<ShapeBorder>,
    pub radius: Option<f32>,
    pub elevation: Option<f32>,
    pub shadow_color: Option<Color>,
    pub padding: Option<Insets>,
    pub item_padding: Option<Insets>,
    pub item_height: Option<f32>,
    pub border: Option<BorderSide>,
    pub divider_height: Option<f32>,
}
Expand description

Defaults for PopupMenuButton and its items.

Fields§

§text_style: Option<TextStyle>

The items’ type.

§background: Option<Color>

The panel’s surface. Unset, surface_container — a menu is a distinct area within the surface, not a thing that floats above it in a different colour (popup_menu.dart:1858).

§shape: Option<ShapeBorder>

What shape the panel is.

§radius: Option<f32>

The radius of its corners, for a theme that would rather give the number than the shape. Outranked by shape.

§elevation: Option<f32>

How far off the page the panel sits, in pixels. Unset, three (popup_menu.dart:1839).

§shadow_color: Option<Color>

The colour of the panel’s shadow. Unset, the scheme’s shadow at 30 %, the framework’s colour for a height; Color::TRANSPARENT casts none.

§padding: Option<Insets>

The room kept above and below the rows, inside the panel (popup_menu.dart:1872).

§item_padding: Option<Insets>

The room kept either side of a row’s label (popup_menu.dart:1876).

§item_height: Option<f32>

How tall one row is. Unset, the smallest box a finger can be asked to hit.

§border: Option<BorderSide>

An outline round the panel. Unset, none: the panel’s shadow says it is off the page. A desktop’s menus draw a hairline as well (milestone 636).

§divider_height: Option<f32>

How much room a separator takes, its line in the middle. Unset, the divider’s own.

Implementations§

Source§

impl MenuTheme

Source

pub fn or(self, other: MenuTheme) -> MenuTheme

This theme, with other’s answer wherever this one says nothing.

Source

pub fn desktop(theme: &Theme) -> MenuTheme

A desktop’s menus (milestone 636): 13 px words on 26 px rows, 12 px either side, 4 px above and below the rows, a 6 px corner, a hairline in outline_variant, a low shadow, and 9 px separators — what an application’s menus on Linux, macOS and Windows look like, rather than a phone’s 48 px rows.

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 Copy for MenuTheme

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 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 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
Source§

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

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.