Files
mail/ui/tray.slint
T

32 lines
1.1 KiB
Plaintext

// Keep the non-visual tray in its own Slint compilation unit. app.slint embeds
// the UI font; compiling a SystemTrayIcon alongside it makes Slint create
// a window adapter just to register that font, which leaks an empty 800x600
// "Slint Window" into Linux task switchers.
export component FlectarTray inherits SystemTrayIcon {
in-out property <bool> enabled: false;
visible: root.enabled;
// Rust sets the chosen icon's tray image from AppIcon.tray-image, which
// explains the small size; this compilation unit cannot share globals
// with app.slint.
in property <image> image: @image-url("../resources/app-icon/flectar-mail-tray.png");
icon: root.image;
title: @tr("Flectar Mail");
tooltip: @tr("Flectar Mail");
callback show_window();
callback quit_app();
clicked => { root.show_window(); }
Menu {
MenuItem {
title: @tr("Show Flectar Mail");
activated => { root.show_window(); }
}
MenuItem {
title: @tr("Quit");
activated => { root.quit_app(); }
}
}
}