KeyGestureFormatInfo
struct · ferroui-base · v0.5.0
struct KeyGestureFormatInfo
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.
Members
new
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.
invariant
fn invariant() -> Rc<KeyGestureFormatInfo>
The invariant format info, used as formatting fallback.
meta
fn meta(self: &Self) -> &str
The string used to represent Meta on the platform.
ctrl
fn ctrl(self: &Self) -> &str
The string used to represent Ctrl on the platform.
alt
fn alt(self: &Self) -> &str
The string used to represent Alt on the platform.
shift
fn shift(self: &Self) -> &str
The string used to represent Shift on the platform.
get_instance
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.
format_key
fn format_key(self: &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
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedErasedDestructorIntoEitherCloneDebugStructuralPartialEqPartialEqDefault
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.