FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    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.

    View source

    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.

    Source

    invariant

    fn invariant() -> Rc<KeyGestureFormatInfo>
    

    The invariant format info, used as formatting fallback.

    Source

    meta

    fn meta(self: &Self) -> &str
    

    The string used to represent Meta on the platform.

    Source

    ctrl

    fn ctrl(self: &Self) -> &str
    

    The string used to represent Ctrl on the platform.

    Source

    alt

    fn alt(self: &Self) -> &str
    

    The string used to represent Alt on the platform.

    Source

    shift

    fn shift(self: &Self) -> &str
    

    The string used to represent Shift on the platform.

    Source

    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.

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.