[][src]Struct ksni::menu::CheckmarkItem

pub struct CheckmarkItem<T> {
    pub label: String,
    pub enabled: bool,
    pub visible: bool,
    pub checked: bool,
    pub icon_name: String,
    pub icon_data: Vec<u8>,
    pub shortcut: Vec<Vec<String>>,
    pub disposition: Disposition,
    pub activate: Box<dyn Fn(&mut T)>,
}

Fields

label: String

Text of the item, except that: -# two consecutive underscore characters "__" are displayed as a single underscore, -# any remaining underscore characters are not displayed at all, -# the first of those remaining underscore characters (unless it is the last character in the string) indicates that the following character is the access key.

enabled: bool

Whether the item can be activated or not.

visible: bool

True if the item is visible in the menu.

checked: boolicon_name: String

PNG data of the icon.

icon_data: Vec<u8>

PNG data of the icon.

shortcut: Vec<Vec<String>>

The shortcut of the item. Each array represents the key press in the list of keypresses. Each list of strings contains a list of modifiers and then the key that is used. The modifier strings allowed are: "Control", "Alt", "Shift" and "Super".

  • A simple shortcut like Ctrl+S is represented as: [["Control", "S"]]
  • A complex shortcut like Ctrl+Q, Alt+X is represented as: [["Control", "Q"], ["Alt", "X"]]
disposition: Disposition

How the menuitem feels the information it's displaying to the user should be presented.

activate: Box<dyn Fn(&mut T)>

Trait Implementations

impl<T> Default for CheckmarkItem<T>[src]

impl<T> From<CheckmarkItem<T>> for MenuItem<T>[src]

Auto Trait Implementations

impl<T> !Send for CheckmarkItem<T>

impl<T> Unpin for CheckmarkItem<T>

impl<T> !Sync for CheckmarkItem<T>

impl<T> !UnwindSafe for CheckmarkItem<T>

impl<T> !RefUnwindSafe for CheckmarkItem<T>

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]