pub trait Tray: Sized {
Show 21 methods
// Provided methods
fn activate(&mut self, _x: i32, _y: i32) { ... }
fn secondary_activate(&mut self, _x: i32, _y: i32) { ... }
fn scroll(&mut self, _delta: i32, _dir: &str) { ... }
fn category(&self) -> Category { ... }
fn id(&self) -> String { ... }
fn title(&self) -> String { ... }
fn status(&self) -> Status { ... }
fn window_id(&self) -> i32 { ... }
fn icon_theme_path(&self) -> String { ... }
fn icon_name(&self) -> String { ... }
fn icon_pixmap(&self) -> Vec<Icon> { ... }
fn overlay_icon_name(&self) -> String { ... }
fn overlay_icon_pixmap(&self) -> Vec<Icon> { ... }
fn attention_icon_name(&self) -> String { ... }
fn attention_icon_pixmap(&self) -> Vec<Icon> { ... }
fn attention_movie_name(&self) -> String { ... }
fn tool_tip(&self) -> ToolTip { ... }
fn text_direction(&self) -> TextDirection { ... }
fn menu(&self) -> Vec<MenuItem<Self>> { ... }
fn watcher_online(&self) { ... }
fn watcher_offine(&self) -> bool { ... }
}
Expand description
A system tray, implement this to create your tray
NOTE: On some system trays, Tray::id
is a required property to avoid unexpected behaviors
Provided Methods§
sourcefn activate(&mut self, _x: i32, _y: i32)
fn activate(&mut self, _x: i32, _y: i32)
Asks the status notifier item for activation, this is typically a consequence of user input, such as mouse left click over the graphical representation of the item. The application will perform any task is considered appropriate as an activation request.
the x and y parameters are in screen coordinates and is to be considered an hint to the item where to show eventual windows (if any).
sourcefn secondary_activate(&mut self, _x: i32, _y: i32)
fn secondary_activate(&mut self, _x: i32, _y: i32)
Is to be considered a secondary and less important form of activation compared to Activate. This is typically a consequence of user input, such as mouse middle click over the graphical representation of the item. The application will perform any task is considered appropriate as an activation request.
the x and y parameters are in screen coordinates and is to be considered an hint to the item where to show eventual windows (if any).
sourcefn scroll(&mut self, _delta: i32, _dir: &str)
fn scroll(&mut self, _delta: i32, _dir: &str)
The user asked for a scroll action. This is caused from input such as mouse wheel over the graphical representation of the item.
The delta parameter represent the amount of scroll, the orientation parameter represent the horizontal or vertical orientation of the scroll request and its legal values are horizontal and vertical.
sourcefn id(&self) -> String
fn id(&self) -> String
It’s a name that should be unique for this application and consistent between sessions, such as the application name itself.
sourcefn title(&self) -> String
fn title(&self) -> String
It’s a name that describes the application, it can be more descriptive than Id.
sourcefn window_id(&self) -> i32
fn window_id(&self) -> i32
It’s the windowing-system dependent identifier for a window, the application can chose one of its windows to be available through this property or just set 0 if it’s not interested.
sourcefn icon_theme_path(&self) -> String
fn icon_theme_path(&self) -> String
An additional path to add to the theme search path to find the icons.
sourcefn icon_name(&self) -> String
fn icon_name(&self) -> String
The item only support the context menu, the visualization should prefer showing the menu or sending ContextMenu() instead of Activate() The StatusNotifierItem can carry an icon that can be used by the visualization to identify the item.
sourcefn icon_pixmap(&self) -> Vec<Icon>
fn icon_pixmap(&self) -> Vec<Icon>
Carries an ARGB32 binary representation of the icon
sourcefn overlay_icon_name(&self) -> String
fn overlay_icon_name(&self) -> String
The Freedesktop-compliant name of an icon. This can be used by the visualization to indicate extra state information, for instance as an overlay for the main icon.
sourcefn overlay_icon_pixmap(&self) -> Vec<Icon>
fn overlay_icon_pixmap(&self) -> Vec<Icon>
ARGB32 binary representation of the overlay icon described in the previous paragraph.
sourcefn attention_icon_name(&self) -> String
fn attention_icon_name(&self) -> String
The Freedesktop-compliant name of an icon. this can be used by the visualization to indicate that the item is in RequestingAttention state.
sourcefn attention_icon_pixmap(&self) -> Vec<Icon>
fn attention_icon_pixmap(&self) -> Vec<Icon>
ARGB32 binary representation of the requesting attention icon describe in the previous paragraph.
sourcefn attention_movie_name(&self) -> String
fn attention_movie_name(&self) -> String
An item can also specify an animation associated to the RequestingAttention state. This should be either a Freedesktop-compliant icon name or a full path. The visualization can chose between the movie or AttentionIconPixmap (or using neither of those) at its discretion.
sourcefn tool_tip(&self) -> ToolTip
fn tool_tip(&self) -> ToolTip
Data structure that describes extra information associated to this item, that can be visualized for instance by a tooltip (or by any other mean the visualization consider appropriate.
sourcefn text_direction(&self) -> TextDirection
fn text_direction(&self) -> TextDirection
Represents the way the text direction of the application. This allows the server to handle mismatches intelligently.
The menu that you want to display
sourcefn watcher_online(&self)
fn watcher_online(&self)
The org.kde.StatusNotifierWatcher
is online
sourcefn watcher_offine(&self) -> bool
fn watcher_offine(&self) -> bool
The org.kde.StatusNotifierWatcher
is offine
You can setup a fallback tray here
Return false
to shutdown the tray service