pub struct DropDownButton {
pub content: WidgetRef,
pub flyout: Option<Ref<Flyout>>,
pub click: Option<Listener>,
pub is_enabled: bool,
pub is_tab_stop: bool,
pub focus_node: Option<FocusNodeRef>,
pub key: Option<KeyRef>,
}Expand description
A button that displays a chevron and opens its associated flyout after Click.
Fields§
§content: WidgetRefContent in the first template column.
flyout: Option<Ref<Flyout>>Associated persistent flyout, owned and disposed by the caller.
click: Option<Listener>Called before opening the associated flyout.
is_enabled: boolWhether pointer and keyboard input can activate the button.
is_tab_stop: boolWhether keyboard traversal stops at the button.
focus_node: Option<FocusNodeRef>Optional caller-owned focus node.
key: Option<KeyRef>Widget identity across parent rebuilds.
Implementations§
Source§impl DropDownButton
impl DropDownButton
Sourcepub fn new<K>(content: impl IntoWidget<K>) -> Self
pub fn new<K>(content: impl IntoWidget<K>) -> Self
Creates a button with the default DropDownButton template.
Sourcepub fn click(self, click: Listener) -> Self
pub fn click(self, click: Listener) -> Self
Sets the callback raised before opening the flyout.
Sourcepub fn is_enabled(self, value: bool) -> Self
pub fn is_enabled(self, value: bool) -> Self
Enables or disables activation.
Sourcepub fn is_tab_stop(self, value: bool) -> Self
pub fn is_tab_stop(self, value: bool) -> Self
Includes or excludes this button from sequential keyboard traversal.
Sourcepub fn focus_node(self, node: FocusNodeRef) -> Self
pub fn focus_node(self, node: FocusNodeRef) -> Self
Supplies a caller-owned focus node.
Trait Implementations§
Source§impl Clone for DropDownButton
impl Clone for DropDownButton
Source§impl Debug for DropDownButton
impl Debug for DropDownButton
Source§impl StatelessWidget for DropDownButton
impl StatelessWidget for DropDownButton
Source§fn build(&self, _: &mut App, _: BuildContext) -> WidgetRef
fn build(&self, _: &mut App, _: BuildContext) -> WidgetRef
Describes the part of the user interface represented by this widget. 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 debug_check_constructor(&self)
fn debug_check_constructor(&self)
Dart’s constructor asserts that relate two or more arguments. Read more
Source§fn as_preferred_size_widget(
&self,
) -> Option<&(dyn PreferredSizeWidget + 'static)>
fn as_preferred_size_widget( &self, ) -> Option<&(dyn PreferredSizeWidget + 'static)>
Dart’s
this is PreferredSizeWidget: a widget that implements PreferredSizeWidget
answers with itself, which is what a parent asking an erased child for its preferred
size reads.Auto Trait Implementations§
impl !RefUnwindSafe for DropDownButton
impl !Send for DropDownButton
impl !Sync for DropDownButton
impl !UnwindSafe for DropDownButton
impl Forget for DropDownButton
impl Freeze for DropDownButtonwhere
*const RcInner<dyn Widget> is !null: Freeze,
PhantomData<RcInner<dyn Widget>>: Freeze,
NonZero<u32>: Freeze,
PhantomData<fn() -> Flyout>: Freeze,
*const RcInner<Keep> is !null: Freeze,
PhantomData<RcInner<Keep>>: Freeze,
*const RcInner<dyn Fn(&mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut App)>>: Freeze,
*const (): Freeze,
&'static FocusNodeVTable: Freeze,
*const RcInner<dyn Key> is !null: Freeze,
PhantomData<RcInner<dyn Key>>: Freeze,
impl Move for DropDownButton
impl Unpin for DropDownButton
impl UnsafeUnpin for DropDownButtonwhere
*const RcInner<dyn Widget> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Widget>>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
PhantomData<fn() -> Flyout>: UnsafeUnpin,
*const RcInner<Keep> is !null: UnsafeUnpin,
PhantomData<RcInner<Keep>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut App)>>: UnsafeUnpin,
*const (): UnsafeUnpin,
&'static FocusNodeVTable: 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<StatelessKind> for Wwhere
W: StatelessWidget,
impl<W> IntoWidget<StatelessKind> for Wwhere
W: StatelessWidget,
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.