From 5ffed55e37bfcf8bf1b0d36a16e8471cbc490c2d Mon Sep 17 00:00:00 2001 From: jmb05 Date: Tue, 3 Nov 2026 01:14:50 +0100 Subject: [PATCH] Fix systray formatting --- src/ui/systray.rs | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/ui/systray.rs b/src/ui/systray.rs index 11f5243..6ed1a9b 100644 --- a/src/ui/systray.rs +++ b/src/ui/systray.rs @@ -10,31 +10,28 @@ pub fn _build() -> gtk::Box { let host = TrayHost::new(); if let Ok(mut host) = host { - glib::timeout_add_local( - Duration::from_millis(1_000), - move || { - for event in host.poll().unwrap() { - match event { - TrayEvent::ItemAdded(id) | TrayEvent::ItemChanged(id) => { - if let Some(item) = host.items().get(&id) { - println!("tray: {} — {}", item.title, item.status); - println!(" category: {}", item.category); - println!(" has menu: {}", item.has_menu()); - } + glib::timeout_add_local(Duration::from_millis(1_000), move || { + for event in host.poll().unwrap() { + match event { + TrayEvent::ItemAdded(id) | TrayEvent::ItemChanged(id) => { + if let Some(item) = host.items().get(&id) { + println!("tray: {} — {}", item.title, item.status); + println!(" category: {}", item.category); + println!(" has menu: {}", item.has_menu()); } - TrayEvent::ItemRemoved(id) => { - println!("item gone: {id}"); - } - TrayEvent::HostShutdown => break, - _ => {} } + TrayEvent::ItemRemoved(id) => { + println!("item gone: {id}"); + } + TrayEvent::HostShutdown => break, + _ => {} } - ControlFlow::Continue } - ); + ControlFlow::Continue + }); } else { error!(&LOGGER, "Couldn't get SystemTray"); } systray -} \ No newline at end of file +}