app: show a red tray icon while recording
The tray kept the app's medallion while the daemon recorded, so the notification area said nothing about it. The icon now becomes a plain red disc, set with the menu whenever the recording state changes. The state comes from the daemon's status, so a recording started from another program shows too. Rune's tray could only replace its menu and tooltip, so the vendored rune takes Tray::set_icon: Windows rebuilds the HICON and sends NIM_MODIFY, Linux swaps IconPixmap and emits NewIcon.
This commit is contained in:
1 parent
9e4349fe42
commit
5377d88ca6
5 files changed
+107
-26
No files matched your search
+2
-1
@@ -657,7 +657,7 @@ pub fn setup(app: &mut App, waker: rune::Waker) {
|
||||
}
|
||||
|
||||
let (tx, rx) = channel::<rune::TrayEvent>();
|
||||
let spec = rune::TraySpec::new(os::APP_ID, os::APP_NAME, os::tray_icon())
|
||||
let spec = rune::TraySpec::new(os::APP_ID, os::APP_NAME, os::tray_icon(false))
|
||||
.tooltip("League Recorder")
|
||||
.menu(os::tray_menu(false));
|
||||
let wake = waker.clone();
|
||||
@@ -685,6 +685,7 @@ impl App {
|
||||
if self.status.is_recording != was_recording {
|
||||
if let Some(tray) = &self.tray {
|
||||
tray.set_menu(os::tray_menu(self.status.is_recording));
|
||||
tray.set_icon(os::tray_icon(self.status.is_recording));
|
||||
}
|
||||
if self.status.is_recording {
|
||||
os::notify(
|
||||
|
||||
Reference in new issue
Block a user