pub struct StatusItemSpec {
pub id: String,
pub icon: Option<Icon>,
pub raster: Option<StatusImage>,
pub template: bool,
pub title: String,
pub tooltip: String,
pub menu: Vec<MenuItem>,
pub activate: u64,
}Expand description
One status item: an icon in the menu bar (macOS), the notification area (Windows) or a StatusNotifierItem host’s tray (Linux), with a menu (docs/status-item.md).
Fields§
§id: StringThe app’s name for the item, stable across updates: what a backend diffs by.
icon: Option<Icon>The glyph. None shows the title alone (macOS) or the app’s icon (elsewhere).
raster: Option<StatusImage>A runtime image. AppKit prefers this over icon, preserving aspect ratio and point
size up to 18pt high; other backends ignore it and show icon/title as before.
template: boolDraw the icon as a template: its shape only, in the menu bar’s or panel’s own color, so it reads in light and dark. Symbols are always templates.
title: StringText beside the icon where the platform shows one (the macOS menu bar). Empty: icon only.
tooltip: StringThe hover text.
The menu the item opens. Same model and dispatch as the app menu.
activate: u64A dispatch id (the Event::MenuAction registry) run when the user clicks the item
itself, where the platform separates a click from opening the menu (a left click on macOS
and Windows, the host’s “activate” on Linux). 0: a click opens the menu.
Trait Implementations§
Source§impl Clone for StatusItemSpec
impl Clone for StatusItemSpec
Source§fn clone(&self) -> StatusItemSpec
fn clone(&self) -> StatusItemSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more