pub struct PopupMenuThemeData {Show 13 fields
pub color: Option<Color>,
pub shape: Option<ShapeBorderRef>,
pub menu_padding: Option<EdgeInsetsGeometry>,
pub elevation: Option<f64>,
pub shadow_color: Option<Color>,
pub surface_tint_color: Option<Color>,
pub text_style: Option<TextStyle>,
pub label_text_style: Option<WidgetStatePropertyRef<Option<TextStyle>>>,
pub enable_feedback: Option<bool>,
pub mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>,
pub position: Option<PopupMenuPosition>,
pub icon_color: Option<Color>,
pub icon_size: Option<f64>,
}Expand description
Defines the visual properties of the routes used to display popup menus
as well as PopupMenuItem and PopupMenuDivider widgets.
Descendant widgets obtain the current PopupMenuThemeData object
using PopupMenuTheme::of. Instances of PopupMenuThemeData can be
customized with PopupMenuThemeData::copy_with.
Typically, a PopupMenuThemeData is specified as part of the
overall Theme with ThemeData::popup_menu_theme. Otherwise,
PopupMenuTheme can be used to configure its own widget subtree.
All PopupMenuThemeData properties are null by default.
If any of these properties are null, the popup menu will provide its
own defaults.
See also:
ThemeData, which describes the overall theme information for the application.
Fields§
§color: Option<Color>The background color of the popup menu.
shape: Option<ShapeBorderRef>The shape of the popup menu.
If specified, the padding of the popup menu.
If PopupMenuButton::menu_padding is provided, menu_padding is
ignored.
elevation: Option<f64>The elevation of the popup menu.
shadow_color: Option<Color>The color used to paint shadow below the popup menu.
surface_tint_color: Option<Color>The color used as an overlay on color of the popup menu.
text_style: Option<TextStyle>The text style of items in the popup menu.
label_text_style: Option<WidgetStatePropertyRef<Option<TextStyle>>>You can use this to specify a different style of the label when the popup menu item is enabled and disabled.
enable_feedback: Option<bool>If specified, defines the feedback property for PopupMenuButton.
If PopupMenuButton::enable_feedback is provided,
enable_feedback is ignored.
mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>{@macro material_ui.popupmenu.mouseCursor}
If specified, overrides the default value of PopupMenuItem::mouse_cursor.
position: Option<PopupMenuPosition>Whether the popup menu is positioned over or under the popup menu button.
When not set, the position defaults to PopupMenuPosition::Over which makes the
popup menu appear directly over the button that was used to create it.
icon_color: Option<Color>The color of the icon in the popup menu button.
icon_size: Option<f64>The size of the icon in the popup menu button.
Implementations§
Source§impl PopupMenuThemeData
impl PopupMenuThemeData
Sourcepub fn new() -> PopupMenuThemeData
pub fn new() -> PopupMenuThemeData
Creates the set of properties used to configure PopupMenuTheme.
Sourcepub fn color(self, color: Color) -> PopupMenuThemeData
pub fn color(self, color: Color) -> PopupMenuThemeData
Dart PopupMenuThemeData(color:).
Sourcepub fn shape(self, shape: impl Into<ShapeBorderRef>) -> PopupMenuThemeData
pub fn shape(self, shape: impl Into<ShapeBorderRef>) -> PopupMenuThemeData
Dart PopupMenuThemeData(shape:).
Dart PopupMenuThemeData(menuPadding:).
Sourcepub fn elevation(self, elevation: f64) -> PopupMenuThemeData
pub fn elevation(self, elevation: f64) -> PopupMenuThemeData
Dart PopupMenuThemeData(elevation:).
Sourcepub fn shadow_color(self, shadow_color: Color) -> PopupMenuThemeData
pub fn shadow_color(self, shadow_color: Color) -> PopupMenuThemeData
Dart PopupMenuThemeData(shadowColor:).
Sourcepub fn surface_tint_color(self, surface_tint_color: Color) -> PopupMenuThemeData
pub fn surface_tint_color(self, surface_tint_color: Color) -> PopupMenuThemeData
Dart PopupMenuThemeData(surfaceTintColor:).
Sourcepub fn text_style(self, text_style: TextStyle) -> PopupMenuThemeData
pub fn text_style(self, text_style: TextStyle) -> PopupMenuThemeData
Dart PopupMenuThemeData(textStyle:).
Sourcepub fn label_text_style(
self,
label_text_style: WidgetStatePropertyRef<Option<TextStyle>>,
) -> PopupMenuThemeData
pub fn label_text_style( self, label_text_style: WidgetStatePropertyRef<Option<TextStyle>>, ) -> PopupMenuThemeData
Dart PopupMenuThemeData(labelTextStyle:).
Sourcepub fn enable_feedback(self, enable_feedback: bool) -> PopupMenuThemeData
pub fn enable_feedback(self, enable_feedback: bool) -> PopupMenuThemeData
Dart PopupMenuThemeData(enableFeedback:).
Sourcepub fn mouse_cursor(
self,
mouse_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>,
) -> PopupMenuThemeData
pub fn mouse_cursor( self, mouse_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>, ) -> PopupMenuThemeData
Dart PopupMenuThemeData(mouseCursor:).
Sourcepub fn position(self, position: PopupMenuPosition) -> PopupMenuThemeData
pub fn position(self, position: PopupMenuPosition) -> PopupMenuThemeData
Dart PopupMenuThemeData(position:).
Sourcepub fn icon_color(self, icon_color: Color) -> PopupMenuThemeData
pub fn icon_color(self, icon_color: Color) -> PopupMenuThemeData
Dart PopupMenuThemeData(iconColor:).
Sourcepub fn icon_size(self, icon_size: f64) -> PopupMenuThemeData
pub fn icon_size(self, icon_size: f64) -> PopupMenuThemeData
Dart PopupMenuThemeData(iconSize:).
Sourcepub fn copy_with(&self) -> PopupMenuThemeData
pub fn copy_with(&self) -> PopupMenuThemeData
Creates a copy of this object with the given fields replaced with the new values.
Dart’s named arguments are the fluent setters on the copy
(data.copy_with().elevation(2.0)).
Sourcepub fn lerp(
a: Option<&PopupMenuThemeData>,
b: Option<&PopupMenuThemeData>,
t: f64,
) -> Option<PopupMenuThemeData>
pub fn lerp( a: Option<&PopupMenuThemeData>, b: Option<&PopupMenuThemeData>, t: f64, ) -> Option<PopupMenuThemeData>
Linearly interpolate between two popup menu themes.
If both arguments are null, then null is returned.
{@macro dart.ui.shadow.lerp}
Trait Implementations§
Source§impl Clone for PopupMenuThemeData
impl Clone for PopupMenuThemeData
Source§impl Debug for PopupMenuThemeData
impl Debug for PopupMenuThemeData
Source§impl Default for PopupMenuThemeData
impl Default for PopupMenuThemeData
Source§impl Diagnosticable for PopupMenuThemeData
impl Diagnosticable for PopupMenuThemeData
Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Object.runtimeType as diagnostics print it: the last segment of
the Rust type path, without generic arguments.Source§fn identity_hash(&self) -> u64
fn identity_hash(&self) -> u64
Object.hashCode as diagnostics print it: the object’s address.Source§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
Source§fn to_diagnostics_node(&self) -> DiagnosticableNode
fn to_diagnostics_node(&self) -> DiagnosticableNode
DiagnosticsNode::to_string_deep.Source§fn to_diagnostics_node_with(
&self,
name: Option<String>,
style: Option<DiagnosticsTreeStyle>,
) -> DiagnosticableNode
fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode
toDiagnosticsNode(name:, style:).Source§fn to_string(&self) -> String
fn to_string(&self) -> String
toString: a single-line description with properties and no
children. Read moreSource§fn to_string_at(&self, min_level: DiagnosticLevel) -> String
fn to_string_at(&self, min_level: DiagnosticLevel) -> String
toString(minLevel:).Source§impl Display for PopupMenuThemeData
impl Display for PopupMenuThemeData
Source§impl PartialEq for PopupMenuThemeData
impl PartialEq for PopupMenuThemeData
Source§impl PopupMenuThemeDataGetters for PopupMenuThemeData
impl PopupMenuThemeDataGetters for PopupMenuThemeData
super(...)
arguments a defaults struct keeps.menu_padding getter.Source§fn surface_tint_color(&self, app: &mut App) -> Option<Color>
fn surface_tint_color(&self, app: &mut App) -> Option<Color>
surface_tint_color getter.Source§fn label_text_style(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<TextStyle>>>
fn label_text_style( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<TextStyle>>>
label_text_style getter.Source§fn mouse_cursor(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>
fn mouse_cursor( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>
mouse_cursor getter.Source§fn copy_with(&self, app: &mut App) -> PopupMenuThemeData
fn copy_with(&self, app: &mut App) -> PopupMenuThemeData
copyWith() with no arguments: a plain value holding what every getter
answers, for the caller’s setters to change.