tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.82k stars 2.45k forks source link

[bug] with_title on macos not working when called after SystemTray::new() #8425

Open callmearta opened 9 months ago

callmearta commented 9 months ago

Describe the bug

As documentation states and I've found people replying in issues, you should be able to display text next to tray icon by just calling with_title on the tray, but apparently it does not work when getting called after SystemTray::new() and only works if you call set_title in setup(). It's best if documentation mentions this as well

Reproduction

No response

Expected behavior

No response

Platform and versions

mac os

Stack trace

No response

Additional context

No response

FabianLars commented 9 months ago

Can you show an example of what you tried? I don't really get what you mean to be honest.

Also please add the output of the tauri info command as requested in the issue template, thanks :)

callmearta commented 9 months ago

Sorry for not outputting tauri info as I don't have access to my macbook rn. It's not a critical bug to break anything but still it's better if it's fixed maybe? This is the scenario: I wanted to make an app that displays current date in the menubar in Mac os. I've been an electron user but for such thing electron was definitely not good because of 90MB package size, so I decided to give Tauri a shot. I followed as mentioned in the documentation and tried the following but got no result:

  1. Adding title to systemTray in taufi.conf.json
  2. Creating a tray like the documentation said and using with_title like let tray = SystemTray::new().with_title('This is the date in menubar'); You can test it for yourself to see that it does not display any title next to the Tray icon in menubar. set_title() works though