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
impl MenuTheme
Sourcepub fn or(self, other: MenuTheme) -> MenuTheme
pub fn or(self, other: MenuTheme) -> MenuTheme
This theme, with other’s answer wherever this one says nothing.
Sourcepub fn desktop(theme: &Theme) -> MenuTheme
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.