pub struct KeyGestureFormatInfo { /* private fields */ }Expand description
Provides platform specific formatting information for the KeyGesture
class.
A format info without platform key overrides is the invariant one: keys are formatted with their plain names.
Implementations§
Source§impl KeyGestureFormatInfo
impl KeyGestureFormatInfo
Sourcepub fn new(
platform_key_overrides: Option<HashMap<Key, String>>,
meta: &str,
ctrl: &str,
alt: &str,
shift: &str,
) -> Self
pub fn new( platform_key_overrides: Option<HashMap<Key, String>>, meta: &str, ctrl: &str, alt: &str, shift: &str, ) -> Self
Creates a format info.
platform_key_overrides holds the platform specific key names;
meta, ctrl, alt and shift are the names of the modifier
keys.
Sourcepub fn invariant() -> Rc<KeyGestureFormatInfo>
pub fn invariant() -> Rc<KeyGestureFormatInfo>
The invariant format info, used as formatting fallback.
Sourcepub fn get_instance(
format_provider: Option<Rc<KeyGestureFormatInfo>>,
) -> Rc<KeyGestureFormatInfo>
pub fn get_instance( format_provider: Option<Rc<KeyGestureFormatInfo>>, ) -> Rc<KeyGestureFormatInfo>
Returns format_provider if given, otherwise the format info
registered with the locator, otherwise the invariant one.
Sourcepub fn format_key(&self, key: Key) -> String
pub fn format_key(&self, key: Key) -> String
Checks the platform overrides and the common overrides, in that order, and returns the name of the key in the appropriate style, or the key’s plain name if there is none.
Trait Implementations§
Source§impl Clone for KeyGestureFormatInfo
impl Clone for KeyGestureFormatInfo
Source§impl Debug for KeyGestureFormatInfo
impl Debug for KeyGestureFormatInfo
Source§impl Default for KeyGestureFormatInfo
impl Default for KeyGestureFormatInfo
Source§impl PartialEq for KeyGestureFormatInfo
impl PartialEq for KeyGestureFormatInfo
impl StructuralPartialEq for KeyGestureFormatInfo
Auto Trait Implementations§
impl Freeze for KeyGestureFormatInfo
impl RefUnwindSafe for KeyGestureFormatInfo
impl Send for KeyGestureFormatInfo
impl Sync for KeyGestureFormatInfo
impl Unpin for KeyGestureFormatInfo
impl UnsafeUnpin for KeyGestureFormatInfo
impl UnwindSafe for KeyGestureFormatInfo
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more