pub struct AppBarToggleButton {
pub label: String,
pub is_checked: Option<bool>,
pub checked: AppBarToggleButtonCheckedHandler,
pub icon: Option<WidgetRef>,
pub label_position: CommandBarLabelPosition,
pub is_three_state: bool,
pub is_enabled: bool,
pub dynamic_overflow_order: i32,
pub keyboard_accelerator_text_override: String,
pub key: Option<KeyRef>,
/* private fields */
}Expand description
XAML AppBarToggleButton: a command that keeps a checked state, for a CommandBar.
Fields§
§label: StringLabel.
is_checked: Option<bool>IsChecked; None is indeterminate.
checked: AppBarToggleButtonCheckedHandlerAsked for the next IsChecked on each click; the button shows the value it is given.
icon: Option<WidgetRef>Icon.
label_position: CommandBarLabelPositionLabelPosition.
is_three_state: boolIsThreeState: a click on a checked button makes it indeterminate.
is_enabled: boolIsEnabled.
dynamic_overflow_order: i32DynamicOverflowOrder.
keyboard_accelerator_text_override: StringKeyboardAcceleratorTextOverride.
key: Option<KeyRef>Identity retained across parent rebuilds.
Implementations§
Source§impl AppBarToggleButton
impl AppBarToggleButton
Sourcepub fn new(
label: impl Into<String>,
is_checked: Option<bool>,
checked: impl Fn(&mut App, Option<bool>) + 'static,
) -> Self
pub fn new( label: impl Into<String>, is_checked: Option<bool>, checked: impl Fn(&mut App, Option<bool>) + 'static, ) -> Self
Creates a toggle button with a Label, its IsChecked and the callback asked for the next value.
Sourcepub fn icon<K>(self, icon: impl IntoWidget<K>) -> Self
pub fn icon<K>(self, icon: impl IntoWidget<K>) -> Self
Sets the XAML Icon.
Sourcepub fn label_position(self, position: CommandBarLabelPosition) -> Self
pub fn label_position(self, position: CommandBarLabelPosition) -> Self
Sets the XAML LabelPosition.
Sourcepub fn is_three_state(self, value: bool) -> Self
pub fn is_three_state(self, value: bool) -> Self
Sets the XAML IsThreeState.
Sourcepub fn is_enabled(self, enabled: bool) -> Self
pub fn is_enabled(self, enabled: bool) -> Self
Sets the XAML IsEnabled.
Sourcepub fn dynamic_overflow_order(self, order: i32) -> Self
pub fn dynamic_overflow_order(self, order: i32) -> Self
Sets the XAML DynamicOverflowOrder.
Sourcepub fn keyboard_accelerator_text_override(self, text: impl Into<String>) -> Self
pub fn keyboard_accelerator_text_override(self, text: impl Into<String>) -> Self
Sets the XAML KeyboardAcceleratorTextOverride.
Trait Implementations§
Source§impl Clone for AppBarToggleButton
impl Clone for AppBarToggleButton
Source§impl Debug for AppBarToggleButton
impl Debug for AppBarToggleButton
Source§impl From<AppBarToggleButton> for CommandBarElement
impl From<AppBarToggleButton> for CommandBarElement
Source§fn from(button: AppBarToggleButton) -> Self
fn from(button: AppBarToggleButton) -> Self
Converts to this type from the input type.
Source§impl StatefulWidget for AppBarToggleButton
impl StatefulWidget for AppBarToggleButton
Source§type State = AppBarToggleButtonState
type State = AppBarToggleButtonState
The state this widget creates.
Source§fn create_state(&self) -> AppBarToggleButtonState
fn create_state(&self) -> AppBarToggleButtonState
Creates the mutable state for this widget at a given location in the tree. Read more
Source§fn debug_fill_properties(
&self,
_app: &App,
properties: &mut DiagnosticPropertiesBuilder,
)
fn debug_fill_properties( &self, _app: &App, properties: &mut DiagnosticPropertiesBuilder, )
Dart’s
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
See
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 AppBarToggleButton
impl !Send for AppBarToggleButton
impl !Sync for AppBarToggleButton
impl !UnwindSafe for AppBarToggleButton
impl Forget for AppBarToggleButton
impl Freeze for AppBarToggleButtonwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const RcInner<dyn Fn(&mut App, Option<bool>)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App, Option<bool>)>>: 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,
&'static FocusNodeVTable: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
impl Move for AppBarToggleButton
impl Unpin for AppBarToggleButton
impl UnsafeUnpin for AppBarToggleButtonwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App, Option<bool>)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App, Option<bool>)>>: 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,
&'static FocusNodeVTable: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: 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
Mutably borrows from an owned value. Read more
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>
The widget as a tree node, made where this is called: its
creation_location.