pub struct ShortcutText(/* private fields */);Expand description
W Display keyboard shortcuts.
Implementations§
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn widget_new() -> ShortcutText
pub fn widget_new() -> ShortcutText
Start building a new instance.
Sourcepub fn widget_type() -> WidgetType
pub fn widget_type() -> WidgetType
Gets the widget type info.
Source§impl ShortcutText
impl ShortcutText
Source§impl ShortcutText
impl ShortcutText
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn first_n(&self, n: impl IntoVar<usize>)
pub fn first_n(&self, n: impl IntoVar<usize>)
P Maximum number of shortcuts to display.
This property sets the FIRST_N_VAR.
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn panel_fn(&self, panel_fn: impl IntoVar<WidgetFn<PanelFnArgs>>)
pub fn panel_fn(&self, panel_fn: impl IntoVar<WidgetFn<PanelFnArgs>>)
P Widget function that converts PanelFnArgs to a widget.
This property sets the PANEL_FN_VAR.
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn none_fn(&self, none_fn: impl IntoVar<WidgetFn<NoneFnArgs>>)
pub fn none_fn(&self, none_fn: impl IntoVar<WidgetFn<NoneFnArgs>>)
P Widget function that converts NoneFnArgs to a widget.
This property sets the NONE_FN_VAR.
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn shortcuts_separator_fn(
&self,
separator_fn: impl IntoVar<WidgetFn<ShortcutsSeparatorFnArgs>>,
)
pub fn shortcuts_separator_fn( &self, separator_fn: impl IntoVar<WidgetFn<ShortcutsSeparatorFnArgs>>, )
P Widget function that converts ShortcutsSeparatorFnArgs to a widget.
This is the separators between shortcuts, when first_n is more than one and the shortcut has mode them one shortcut.
Set to nil to not generate a separator.
This property sets the SHORTCUTS_SEPARATOR_FN_VAR.
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn shortcut_fn(&self, panel_fn: impl IntoVar<WidgetFn<ShortcutFnArgs>>)
pub fn shortcut_fn(&self, panel_fn: impl IntoVar<WidgetFn<ShortcutFnArgs>>)
P Widget function that converts ShortcutFnArgs to a widget.
Set to WidgetFn::nil or return the items as a node to pass the items directly to panel_fn.
This property sets the SHORTCUT_FN_VAR.
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn chord_separator_fn(
&self,
separator_fn: impl IntoVar<WidgetFn<ChordSeparatorFnArgs>>,
)
pub fn chord_separator_fn( &self, separator_fn: impl IntoVar<WidgetFn<ChordSeparatorFnArgs>>, )
P Widget function that converts ChordSeparatorFnArgs to a widget.
This is the separator between the starter and complement in a KeyChord.
This property sets the CHORD_SEPARATOR_FN_VAR.
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn key_gesture_fn(&self, panel_fn: impl IntoVar<WidgetFn<KeyGestureFnArgs>>)
pub fn key_gesture_fn(&self, panel_fn: impl IntoVar<WidgetFn<KeyGestureFnArgs>>)
P Widget function that converts KeyGestureFnArgs to a widget.
Set to WidgetFn::nil or return the items as a node to pass the items directly to shortcut_fn.
This property sets the KEY_GESTURE_FN_VAR.
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn key_gesture_separator_fn(
&self,
separator_fn: impl IntoVar<WidgetFn<KeyGestureSeparatorFnArgs>>,
)
pub fn key_gesture_separator_fn( &self, separator_fn: impl IntoVar<WidgetFn<KeyGestureSeparatorFnArgs>>, )
P Widget function that converts KeyGestureSeparatorFnArgs to a widget.
This is the separator between the modifiers and key in a KeyGesture.
This property sets the KEY_GESTURE_SEPARATOR_FN_VAR.
Source§impl ShortcutText
impl ShortcutText
Sourcepub fn modifier_fn(&self, modifier_fn: impl IntoVar<WidgetFn<ModifierFnArgs>>)
pub fn modifier_fn(&self, modifier_fn: impl IntoVar<WidgetFn<ModifierFnArgs>>)
P Widget function that converts a ModifierFnArgs to a widget.
This is used for both the Shortcut::Modifier standalone and the KeyGesture::modifiers flags.
This property sets the MODIFIER_FN_VAR.
Source§impl ShortcutText
impl ShortcutText
Methods from Deref<Target = WidgetBase>§
Sourcepub fn widget_builder(&mut self) -> &mut WidgetBuilder
pub fn widget_builder(&mut self) -> &mut WidgetBuilder
Returns a mutable reference to the widget builder.
Sourcepub fn widget_when(&mut self) -> Option<&mut WhenInfo>
pub fn widget_when(&mut self) -> Option<&mut WhenInfo>
Returns a mutable reference to the when block if called inside a when block.
Sourcepub fn widget_take(&mut self) -> WidgetBuilder
pub fn widget_take(&mut self) -> WidgetBuilder
Takes the widget builder, finishing the widget macro build.
After this call trying to set a property using self will panic,
the returned builder can still be manipulated directly.
Sourcepub fn widget_build(&mut self) -> UiNode
pub fn widget_build(&mut self) -> UiNode
Build the widget.
After this call trying to set a property will panic.
Sourcepub fn widget_importance(&mut self) -> &mut Importance
pub fn widget_importance(&mut self) -> &mut Importance
Returns a mutable reference to the importance of the next property assigns, unsets or when blocks.
Note that during the widget_intrinsic call this is Importance::WIDGET and after it is Importance::INSTANCE.
Sourcepub fn start_when_block(
&mut self,
inputs: Box<[WhenInput]>,
state: Var<bool>,
expr: &'static str,
location: SourceLocation,
)
pub fn start_when_block( &mut self, inputs: Box<[WhenInput]>, state: Var<bool>, expr: &'static str, location: SourceLocation, )
Start building a when block, all properties set after this call are pushed in the when block.
Sourcepub fn end_when_block(&mut self)
pub fn end_when_block(&mut self)
End the current when block, all properties set after this call are pushed in the widget.
Trait Implementations§
Source§impl Deref for ShortcutText
impl Deref for ShortcutText
Source§type Target = WidgetBase
type Target = WidgetBase
Source§impl DerefMut for ShortcutText
impl DerefMut for ShortcutText
Auto Trait Implementations§
impl !Freeze for ShortcutText
impl !RefUnwindSafe for ShortcutText
impl Send for ShortcutText
impl !Sync for ShortcutText
impl !Unpin for ShortcutText
impl !UnwindSafe for ShortcutText
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more