From b8026b230dd9021151e07d750d7de09658047bbf Mon Sep 17 00:00:00 2001 From: Colin Lienard Date: Mon, 20 May 2024 17:49:44 +0200 Subject: [PATCH 1/4] feat(tray): new icons for non macos --- src-tauri/icons/tray-base-macos.png | Bin 0 -> 1412 bytes src-tauri/icons/tray-base.png | Bin 1412 -> 6652 bytes src-tauri/icons/tray-new-macos.png | Bin 0 -> 1533 bytes src-tauri/icons/tray-new.png | Bin 1533 -> 5760 bytes src-tauri/src/commands.rs | 34 ++++++++++++++++++++-------- src-tauri/src/main.rs | 8 ++++++- 6 files changed, 31 insertions(+), 11 deletions(-) create mode 100644 src-tauri/icons/tray-base-macos.png create mode 100644 src-tauri/icons/tray-new-macos.png diff --git a/src-tauri/icons/tray-base-macos.png b/src-tauri/icons/tray-base-macos.png new file mode 100644 index 0000000000000000000000000000000000000000..9faac860f40cc186087b10467ce0a9e593c1c099 GIT binary patch literal 1412 zcmV-~1$+95P)07euDf(MAA z$=`eTXpz7H1OeO~0Iz5w02KPN)^cO7nHA!PK=Urfsj#z$f9y+K#-4&!|FK3Ml1%@LR`KNa&D5-?wWYDVb^E4mPv zarr_glQu*}#?-x9Y0M#;#{abBLOpCcKg_~h>PEQLvPXFGQ!u`OM3)Na;WDjw%)bdSBslV1+gpRG2KWyHnx71P{Qbun8DXoTL_{C~k8u}$3CEeP| zv(|F(bnOEo>^zK@$;04%EP^fEeSy-B;dM_Qe)*7}a17+lt?ox#R$EU&Q=<#rVVKN$ z0VT+Dbn;~wcCNNGHG-EpIO%tgQ#yGM1L+kd@*5=pGgk9~WM7@%Ym##}pvxskVw{lF z03>r(TyquE0NH>pA2IrWk=g)klRs*CBD07gL7I+{+Imj6w{@u~f!`?s>x}HJ{G8p% z^ol~u-*j?-+B}oo&8?i@tg|N5@Qq_sEy{O5*KCGJ>dupaM7s;)Cq!9*Yu70W7!%00 z`IDCWn8E{%!20fmI@mW@+p>2yZ;~lYiUnY7eBpWYGhiWOw(3UQv1&~g=fAPHIQ`xY zbXw-N5uR6?K+A>agby?YFyUwnqA%-|afdjj^9B(&p*4tt7MSk+hpE_XCF zu<^JcU5>P+as`2ZZ+pXFx=DcP-nVXrAhZ82rK2Nj^wS){`GTlIcP${6wUb}9o*igT zz;6}qoitH6c{ia3x`fnd(B(~dFO^Jq@BM&dmT*1<)`%x><?+>yKm|yzZe!xEix^pcD$mfPJ z*Y!lYY~A>*LOzgmL%(-r@1ABNz+wQR`D8>6JpFAPXqSY33lj57Dt|ojJgc&8kQLhUQP-+U6JWf14m|31)kU5#c?^ zJVsaOP{Z`+afG0M&7!0f0*#Q<%s~IxFXb{1t$x@^*lf@>;C|4$=Z&m Sq9zmo0000i literal 0 HcmV?d00001 diff --git a/src-tauri/icons/tray-base.png b/src-tauri/icons/tray-base.png index 9faac860f40cc186087b10467ce0a9e593c1c099..1bcd5581d97fdf69deddad00a6f7fcc4e7cd992d 100644 GIT binary patch delta 6625 zcmV<786M_@3;Z*XReu?gNkl;-4N7%4Ks(!DPFyLRk!Z{-T(jo<=z(bf6%0qf`4c+j_pEUIVxyNR&36$ z{s*U!xICoz1Vf6^A<1fzLI{KM6b6TkShyoWx$V;yT(^z3;IV9tq8K7TNDK1eBUPuaD)MlFd76#VOsjIV)!)W zPRnwiG|Z#RXMYV}xUUQZEe!$JDFxw_0dUN$Z`o_Sa`+GD`2MhF&oggyY%-jpB&R6I z_Xvk18S*ovrW6`L1`Z1V#1cfwDnao$Q6h^y!7mA{}BY%L&ZFad{&ZOAo3hN^DK18Lw`SR_^btd7!bU6EKXcW2Ea$Uon%dp-FTdfA{ThUmGl!D|pxNM=Z~5KQrd(#&%0fm=V&M}bVC$Iqp1n#E zt=fVGk;>Nf_tM)%1cH!Z7>WSEF=%1L5e7(6Sbw+%El8$e9zz9H)yRD{skUq84udAZ z9E4~NX^_pLK{gCd6W)#nBhx)>xowL{S=hVd!p3`u?4xY#5yLaVL3q=IKqdr9v{NeC zM)BBD)tBRrBHI}!Y-co?@D2=uA4m$=Q-B9TN2)1il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4 z)aX%6UI84wQ%g_E(9edx8fwjKeJhahWauZ)dtNO^sSGKq8$gPlp)Bmcj&y4HK028xi(2CvcgcZ_z7Iz#V#?FwEg~YO})IJ;Ip6 zs`mX*GzZ`|vl9{1=N)C zP@20=v=3E}t0Y3+cp;QVtseKby0nQiu16l;ytOA`nxs*0lx~!*rXWF zA*P{9@SWfgEk$G?lo8q(7qO1&UL*T`MH7MH?2D_os9*puM>Ez|(&&sWCiqQ2?y7*d zmI3%GIPnInj4q84p$fwsA?vq{zm@?)7c5P`D*S6khBDNld~ayj^FQI?c;#(E^J=R=hum=ka#wXvo0#fJrV;69~A##pS52tcGgy{Q$O>;77FJ#LJ!BX<>@f@04+?%z`(;KFOyb0>Qxr>GoU z_Y0K*Z*OPCUW(kZ_JdToWFJ8IID3|(r~m;ujfBY#VB-fY$_WID#Z?(U+cAjid>Ec} zbdKS??8cyBvf3i$m%J&66Cn(v*p@PbpK@8zGI@(Y8)-o#*$<(N#{jFM0&A6G;O7|L zC`(IXT|!UxWQp)(CTG7v9kfht=sd2GFN%)d1Tm%%i+o{3iqI+uohu||aXXMNJ-MBb zClskxlwr&npo3e^mbU)cD$;?r>wx^w%M}`!?K453ku*D4We7hHOsIu|}$ngMWbXa{8D jKR<|_ypf9EROR>|e7ERtk1bBP00000NkvXXu0mjfK1tKD literal 0 HcmV?d00001 diff --git a/src-tauri/icons/tray-new.png b/src-tauri/icons/tray-new.png index 78c2e224152e9f115ca6127b2313bf20cb2db27d..01330b6957281e228666ddf634f99ddc761de13d 100644 GIT binary patch delta 5726 zcmV-k7NP0=3xF+Annf_0A-`BinU_g+^41()wA|Qfb1O}st ziFx2!JT{^w}~oqq*VN(rJ>7`ueI(j#bF zR=k{j>hIh_;);;s(<~(>g`{do2_Y=XQz+lDV&U!t<#x^c@HIPW8*a1Gp{JI+~Y6jD_S+TeDSo6{J#LtC6tX)d+{vaTd7@@=nqeWm9wqu49 z!_iiI9LM{KWq#1cfwYC-WhQ6h3aXzj z$cE5d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z78OYu9rpdnKo+99;Jcl>%>XXT@HM+_LtARJddx zK=?R&mZPWu0XdC?$qr!S2Q1171b>RfRT)3qF^KDY7@l=>j^VuQ#-L%c+9KtbyeWti zAq=C~mNJ8%a#_(bd5b_BX+b2}521|50IQ+`Yn5W)=NR57OG{#1LQnQ&iST45XTL!m zv`lX3Jg$*1ijLj{F{TiUd|^b2&?*R>Dwx^w%M}`!?K453ku*E1>+Y8PC3ojMmjTbcoIZfFN&<3B%$oxG8X-&E!JAAGmy UZ;vfbxBvhE07*qoM6N<$f;9BYR{#J2 diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 3df3e243..ac21b7d1 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -9,17 +9,9 @@ pub fn update_tray(app_handle: tauri::AppHandle, title: Option, new_icon } if let Some(new_icon) = new_icon { if new_icon { - tray_handle - .set_icon(tauri::Icon::Raw( - include_bytes!("../icons/tray-new.png").to_vec(), - )) - .unwrap(); + tray_handle.set_icon(get_raw_tray_icon("new")).unwrap(); } else { - tray_handle - .set_icon(tauri::Icon::Raw( - include_bytes!("../icons/tray-base.png").to_vec(), - )) - .unwrap(); + tray_handle.set_icon(get_raw_tray_icon("base")).unwrap(); } } } @@ -41,3 +33,25 @@ pub fn toggle_tray(app_handle: tauri::AppHandle, show: bool) { .unwrap(); } } + +pub fn get_raw_tray_icon(image: &str) -> tauri::Icon { + let is_macos = cfg!(target_os = "macos"); + let bytes = match image { + "base" => { + if is_macos { + include_bytes!("../icons/tray-base-macos.png").to_vec() + } else { + include_bytes!("../icons/tray-base.png").to_vec() + } + } + "new" => { + if is_macos { + include_bytes!("../icons/tray-new-macos.png").to_vec() + } else { + include_bytes!("../icons/tray-new.png").to_vec() + } + } + _ => panic!("Unknown tray icon"), + }; + tauri::Icon::Raw(bytes) +} diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 62557e55..23abf7d1 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -7,6 +7,7 @@ #[macro_use] extern crate objc; +use commands::get_raw_tray_icon; use tauri::{Manager, SystemTray, SystemTrayEvent}; use tauri_plugin_autostart::MacosLauncher; use tauri_plugin_positioner::{Position, WindowExt}; @@ -24,6 +25,11 @@ fn main() { builder = builder.plugin(devtools); } + let mut system_tray = SystemTray::new().with_id("tray"); + if cfg!(target_os = "macos") { + system_tray = system_tray.with_icon(get_raw_tray_icon("base")); + } + builder .setup(|app| { let handle = app.handle(); @@ -54,7 +60,7 @@ fn main() { )) .plugin(tauri_plugin_positioner::init()) .plugin(tauri_plugin_window_state::Builder::default().build()) - .system_tray(SystemTray::new().with_id("tray")) + .system_tray(system_tray) .on_system_tray_event(|app, event| { tauri_plugin_positioner::on_tray_event(app, &event); match event { From 5b2e7981061d9f2027ecd545320be19f13118151 Mon Sep 17 00:00:00 2001 From: Colin Lienard Date: Mon, 20 May 2024 18:19:13 +0200 Subject: [PATCH 2/4] changes --- src-tauri/Cargo.toml | 2 +- src-tauri/src/commands.rs | 11 ++++++++--- src-tauri/src/main.rs | 11 +++-------- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index fe80969e..83e2db8f 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -18,7 +18,7 @@ tauri-build = { version = "1.5.1", features = [] } devtools = "0.3.1" serde_json = "1.0.116" serde = { version = "1.0.200", features = ["derive"] } -tauri = { version = "1.6.2", features = [ "os-all", "system-tray", "notification-all", "shell-open", "updater", "window-start-dragging", "icon-png"] } +tauri = { version = "1.6.2", features = [ "system-tray", "os-all", "notification-all", "shell-open", "updater", "window-start-dragging", "icon-png"] } tauri-plugin-autostart = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } tauri-plugin-deep-link = "0.1.2" tauri-plugin-positioner = { version = "1.0.5", features = ["system-tray"] } diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index ac21b7d1..43ef2fe7 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -18,11 +18,16 @@ pub fn update_tray(app_handle: tauri::AppHandle, title: Option, new_icon #[tauri::command] pub fn toggle_tray(app_handle: tauri::AppHandle, show: bool) { - let tray_handle = app_handle.tray_handle_by_id("tray").unwrap(); - tray_handle.destroy().unwrap(); + let tray_handle = app_handle.tray_handle_by_id("tray"); + if let Some(tray_handle) = tray_handle { + tray_handle.destroy().unwrap(); + } if show { SystemTray::new() .with_id("tray") + .with_icon(get_raw_tray_icon("base")) + .with_icon_as_template(true) + .with_menu_on_left_click(false) .with_menu( SystemTrayMenu::new() .add_item(CustomMenuItem::new("dashboard".to_string(), "Dashboard...")) @@ -34,7 +39,7 @@ pub fn toggle_tray(app_handle: tauri::AppHandle, show: bool) { } } -pub fn get_raw_tray_icon(image: &str) -> tauri::Icon { +fn get_raw_tray_icon(image: &str) -> tauri::Icon { let is_macos = cfg!(target_os = "macos"); let bytes = match image { "base" => { diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 23abf7d1..7c3b3f70 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -7,8 +7,7 @@ #[macro_use] extern crate objc; -use commands::get_raw_tray_icon; -use tauri::{Manager, SystemTray, SystemTrayEvent}; +use tauri::{Manager, SystemTrayEvent}; use tauri_plugin_autostart::MacosLauncher; use tauri_plugin_positioner::{Position, WindowExt}; @@ -25,11 +24,6 @@ fn main() { builder = builder.plugin(devtools); } - let mut system_tray = SystemTray::new().with_id("tray"); - if cfg!(target_os = "macos") { - system_tray = system_tray.with_icon(get_raw_tray_icon("base")); - } - builder .setup(|app| { let handle = app.handle(); @@ -52,6 +46,8 @@ fn main() { #[cfg(not(target_os = "macos"))] tray_window.set_decorations(false).unwrap(); + commands::toggle_tray(app.handle(), true); + Ok(()) }) .plugin(tauri_plugin_autostart::init( @@ -60,7 +56,6 @@ fn main() { )) .plugin(tauri_plugin_positioner::init()) .plugin(tauri_plugin_window_state::Builder::default().build()) - .system_tray(system_tray) .on_system_tray_event(|app, event| { tauri_plugin_positioner::on_tray_event(app, &event); match event { From c25b927e1bf25534257e9eb66774242703cd84f2 Mon Sep 17 00:00:00 2001 From: Colin Lienard Date: Mon, 20 May 2024 18:30:56 +0200 Subject: [PATCH 3/4] changes --- src-tauri/src/commands.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 43ef2fe7..0ba6d38e 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -23,19 +23,21 @@ pub fn toggle_tray(app_handle: tauri::AppHandle, show: bool) { tray_handle.destroy().unwrap(); } if show { - SystemTray::new() + let mut system_tray = SystemTray::new() .with_id("tray") .with_icon(get_raw_tray_icon("base")) - .with_icon_as_template(true) - .with_menu_on_left_click(false) .with_menu( SystemTrayMenu::new() .add_item(CustomMenuItem::new("dashboard".to_string(), "Dashboard...")) .add_native_item(SystemTrayMenuItem::Separator) .add_item(CustomMenuItem::new("quit".to_string(), "Quit")), - ) - .build(&app_handle) - .unwrap(); + ); + if cfg!(target_os = "macos") { + system_tray = system_tray + .with_icon_as_template(true) + .with_menu_on_left_click(false) + } + system_tray.build(&app_handle).unwrap(); } } From 4b42de7eeddd528efba533bdfc6af51fa21ee0f5 Mon Sep 17 00:00:00 2001 From: Colin Lienard Date: Mon, 20 May 2024 18:33:48 +0200 Subject: [PATCH 4/4] changes --- src-tauri/src/commands.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src-tauri/src/commands.rs b/src-tauri/src/commands.rs index 0ba6d38e..896a493a 100644 --- a/src-tauri/src/commands.rs +++ b/src-tauri/src/commands.rs @@ -32,7 +32,8 @@ pub fn toggle_tray(app_handle: tauri::AppHandle, show: bool) { .add_native_item(SystemTrayMenuItem::Separator) .add_item(CustomMenuItem::new("quit".to_string(), "Quit")), ); - if cfg!(target_os = "macos") { + #[cfg(target_os = "macos")] + { system_tray = system_tray .with_icon_as_template(true) .with_menu_on_left_click(false)