pub struct CommandBar {Show 18 fields
pub is_open: bool,
pub changed: CommandBarOpenChangedHandler,
pub primary_commands: Vec<CommandBarElement>,
pub secondary_commands: Vec<CommandBarElement>,
pub content: Option<WidgetRef>,
pub default_label_position: CommandBarDefaultLabelPosition,
pub overflow_button_visibility: CommandBarOverflowButtonVisibility,
pub is_dynamic_overflow_enabled: bool,
pub closed_display_mode: AppBarClosedDisplayMode,
pub is_sticky: bool,
pub light_dismiss_overlay_mode: LightDismissOverlayMode,
pub background: Option<Brush>,
pub opening: Option<Listener>,
pub opened: Option<Listener>,
pub closing: Option<Listener>,
pub closed: Option<Listener>,
pub dynamic_overflow_items_changing: Option<DynamicOverflowItemsChangingHandler>,
pub key: Option<KeyRef>,
}Expand description
XAML CommandBar.
Fields§
§is_open: boolIsOpen.
changed: CommandBarOpenChangedHandlerAsked for a new IsOpen by the MoreButton, a command, light dismiss and the keyboard; the bar opens and closes as is_open follows.
primary_commands: Vec<CommandBarElement>PrimaryCommands: the commands in the bar.
secondary_commands: Vec<CommandBarElement>SecondaryCommands: the commands in the overflow menu.
content: Option<WidgetRef>Content: shown at the bar’s start.
default_label_position: CommandBarDefaultLabelPositionDefaultLabelPosition.
OverflowButtonVisibility.
is_dynamic_overflow_enabled: boolIsDynamicOverflowEnabled: primary commands that do not fit move into the overflow.
closed_display_mode: AppBarClosedDisplayModeClosedDisplayMode.
is_sticky: boolIsSticky: the open bar keeps the focus where it is and ignores light dismiss.
light_dismiss_overlay_mode: LightDismissOverlayModeLightDismissOverlayMode: whether the layer under the open bar dims the window.
background: Option<Brush>Background, while the bar is closed; the theme’s CommandBarBackground when None.
opening: Option<Listener>Opening.
opened: Option<Listener>Opened.
closing: Option<Listener>Closing.
closed: Option<Listener>Closed.
dynamic_overflow_items_changing: Option<DynamicOverflowItemsChangingHandler>DynamicOverflowItemsChanging.
key: Option<KeyRef>Identity retained across parent rebuilds.
Implementations§
Source§impl CommandBar
impl CommandBar
Sourcepub fn new(is_open: bool, changed: impl Fn(&mut App, bool) + 'static) -> Self
pub fn new(is_open: bool, changed: impl Fn(&mut App, bool) + 'static) -> Self
Creates a bar with its IsOpen and the callback asked for a new one.
Sourcepub fn primary_commands(self, commands: Vec<CommandBarElement>) -> Self
pub fn primary_commands(self, commands: Vec<CommandBarElement>) -> Self
Sets the XAML PrimaryCommands.
Sourcepub fn secondary_commands(self, commands: Vec<CommandBarElement>) -> Self
pub fn secondary_commands(self, commands: Vec<CommandBarElement>) -> Self
Sets the XAML SecondaryCommands.
Sourcepub fn content<K>(self, content: impl IntoWidget<K>) -> Self
pub fn content<K>(self, content: impl IntoWidget<K>) -> Self
Sets the XAML Content.
Sourcepub fn default_label_position(
self,
position: CommandBarDefaultLabelPosition,
) -> Self
pub fn default_label_position( self, position: CommandBarDefaultLabelPosition, ) -> Self
Sets the XAML DefaultLabelPosition.
Sets the XAML OverflowButtonVisibility.
Sourcepub fn is_dynamic_overflow_enabled(self, value: bool) -> Self
pub fn is_dynamic_overflow_enabled(self, value: bool) -> Self
Sets the XAML IsDynamicOverflowEnabled.
Sourcepub fn closed_display_mode(self, mode: AppBarClosedDisplayMode) -> Self
pub fn closed_display_mode(self, mode: AppBarClosedDisplayMode) -> Self
Sets the XAML ClosedDisplayMode.
Sourcepub fn light_dismiss_overlay_mode(self, mode: LightDismissOverlayMode) -> Self
pub fn light_dismiss_overlay_mode(self, mode: LightDismissOverlayMode) -> Self
Sets the XAML LightDismissOverlayMode.
Sourcepub fn background(self, brush: Brush) -> Self
pub fn background(self, brush: Brush) -> Self
Sets the XAML Background.
Sourcepub fn dynamic_overflow_items_changing(
self,
handler: impl Fn(&mut App, &DynamicOverflowItemsChangingEventArgs) + 'static,
) -> Self
pub fn dynamic_overflow_items_changing( self, handler: impl Fn(&mut App, &DynamicOverflowItemsChangingEventArgs) + 'static, ) -> Self
Sets the XAML DynamicOverflowItemsChanging handler.
Trait Implementations§
Source§impl Clone for CommandBar
impl Clone for CommandBar
Source§impl Debug for CommandBar
impl Debug for CommandBar
Source§impl StatefulWidget for CommandBar
impl StatefulWidget for CommandBar
Source§type State = CommandBarState
type State = CommandBarState
Source§fn create_state(&self) -> CommandBarState
fn create_state(&self) -> CommandBarState
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
debugFillProperties: the properties a dump shows for this widget, in Dart’s
order. Dart’s Widget base only sets the dense tree style, which the framework does.Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Widget::type_name. A stateful form another widget kind becomes (an animated or
status transition widget) names the widget it wraps.Auto Trait Implementations§
impl !RefUnwindSafe for CommandBar
impl !Send for CommandBar
impl !Sync for CommandBar
impl !UnwindSafe for CommandBar
impl Forget for CommandBar
impl Freeze for CommandBarwhere
*const RcInner<dyn Fn(&mut App, bool)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, bool)>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<CommandBarElement>: Freeze,
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
NonZero<u32>: Freeze,
*const (): Freeze,
*const RcInner<dyn Fn(&mut App, &DynamicOverflowItemsChangingEventArgs)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, &DynamicOverflowItemsChangingEventArgs)>>: Freeze,
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
impl Move for CommandBar
impl Unpin for CommandBarwhere
Rc<dyn Fn(&mut App, bool)>: Unpin,
*const u8 is !null: Unpin,
Rc<dyn Fn(&mut App)>: Unpin,
NonZero<u32>: Unpin,
*const (): Unpin,
Rc<dyn Widget>: Unpin,
Rc<Keep>: Unpin,
&'static FocusNodeVTable: Unpin,
Rc<dyn Key>: Unpin,
Rc<dyn Fn(&mut App, Option<bool>)>: Unpin,
Rc<dyn Fn(&mut App, &DynamicOverflowItemsChangingEventArgs)>: Unpin,
impl UnsafeUnpin for CommandBarwhere
*const RcInner<dyn Fn(&mut App, bool)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, bool)>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<CommandBarElement>: UnsafeUnpin,
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const (): UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, &DynamicOverflowItemsChangingEventArgs)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, &DynamicOverflowItemsChangingEventArgs)>>: UnsafeUnpin,
*const RcInner<dyn Key> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Key>>: UnsafeUnpin,
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<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
impl<W> IntoWidget<StatefulKind> for Wwhere
W: StatefulWidget,
Source§fn into_widget(self) -> Rc<dyn Widget>
fn into_widget(self) -> Rc<dyn Widget>
creation_location.