mirror of
https://github.com/flectar/mail.git
synced 2026-11-11 17:57:54 +00:00
32 lines
1.1 KiB
Plaintext
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(); }
|
|
}
|
|
}
|
|
}
|