Struct ksni::menu::SubMenu[][src]

pub struct SubMenu<T> {
    pub label: String,
    pub enabled: bool,
    pub visible: bool,
    pub icon_name: String,
    pub icon_data: Vec<u8>,
    pub shortcut: Vec<Vec<String>>,
    pub disposition: Disposition,
    pub submenu: Vec<MenuItem<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.

icon_name: String

Icon name of the item, following the freedesktop.org icon spec.

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.

submenu: Vec<MenuItem<T>>

Trait Implementations

Returns the “default value” for a type. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.