fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
24.56k stars 1.37k forks source link

SystemTray function enhancement suggestions: Add left-click to display the main form and right-click to open the menu #4491

Open ShaunPort opened 8 months ago

ShaunPort commented 8 months ago

Checklist

Is your feature request related to a problem?

Can SystemTray add a left-click to display the main form, and a right-click to open the menu, and this menu, which comes with the default 'Quite', can have a name defined by the user, because we have the desire to change it to Chinese. Hope to get a reply.

Is it possible to construct a solution with the existing API?

No response

Describe the solution you'd like to see.

Can SystemTray add a left-click to display the main form, and a right-click to open the menu, and this menu, which comes with the default 'Quite', can have a name defined by the user, because we have the desire to change it to Chinese. Hope to get a reply.

Jacalz commented 8 months ago

Please stick to English for bug reports. The vast majority of out development team does not speak Chinese

Jacalz commented 8 months ago

I translated the entire issue to English.

andydotxyz commented 8 months ago

I could be wrong, but I don't think all OS support different events for left and right click on system tray icons... others have hit this: https://bugs.openjdk.org/browse/JDK-8041890

ShaunPort commented 8 months ago

I could be wrong, but I don't think all OS support different events for left and right click on system tray icons... others have hit this: https://bugs.openjdk.org/browse/JDK-8041890

I understand that certain features are missing in order to fit different operating systems. So will the development team write different call methods according to different operating systems like golang cross-platform, and do different system trays for windows and mac os systems. image The other one is the default Quit button in the system tray on windows, but I can't change its name.Because I want to change it to Chinese.

andydotxyz commented 8 months ago

In general we don't have APIs that support different behaviours on different platforms. We are looking for a consistent user experience.

If you launch the menu only on some platforms then how would others use your app?

Regarding changing the menu item "Quit" text that is tracked in different issues and relates to the Localisation work we are adding.

heaxo commented 8 months ago

I also strongly recommend left clicking to open the main window and right clicking to open the menu

andydotxyz commented 8 months ago

I also strongly recommend left clicking to open the main window and right clicking to open the menu

Just for some info - I checked all the macOS apps I have with system tray icons. 75% do identical things for left and right, but none of them open a window when left clicked (those that differ show a rich content popup instead of menu on left click). Also of note is that Apple's icons (right next to the system tray, look identical) do nothing on right click.

ShaunPort commented 7 months ago

But on almost all windows desktop programs, the left-clicking icon opens the application and the right-clicking icon opens the menu.

andydotxyz commented 7 months ago

This was discussed on our call today, and as we understand it the status is:

So in this case it seems like the right thing to do is to show a window on left click for Windows only - without exposing more Apis which would be platform specific. So the question becomes, which window to show? The first, the last, or the master? We are opting for the latter (whichever window is marked as master) but looking for feedback on this.

ShaunPort commented 7 months ago

In windows software released in China, the left button tray icon displays the main window, regardless of other Windows.But I don't clean up foreign software habits.

gschafra commented 3 months ago

Has anyone see this PR (https://github.com/getlantern/systray/pull/234/files) from the upstream repo of systray? IMHO I think this might be the way to go to allow devs to implement the behaviour as needed/wished, don't you?

andydotxyz commented 3 months ago

The PR you linked to only works on Windows (where the clicks are often different) but not on macOS (where most apps have the same action) or Linux (where right click is not supported).

As Fyne aims to be consistent functionality across all platforms I don't think this helps.

williambrode commented 1 month ago

We are opting for the latter (whichever window is marked as master) but looking for feedback on this.

My feedback is: that sounds great! I think loading the master window is better than doing nothing, even if the app would prefer more control.