-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for tooltip #7
base: master
Are you sure you want to change the base?
Conversation
I can say macOS definitely does not have tooltips for menu bar icons and Linux is (as usual) a mixed bag. Some do, some don't. It will also depend which desktop environment is being used. That being said, I would classify this feature as "Windows only" and therefore should not be part of a cross-platform library. |
I find that an odd conclusion - any cross-platform library should only offer the lowest common denominator. |
I can see what you are saying. There are always going to be some sacrifices when using cross-platform utilities such as this. Usually x-platform applications have a single code base for the functionality and all UI/platform specific features are built on top of that for each platform. Maybe setting a default tooltip such as the executable name would be a good middle-ground solution. |
I appreciate that. 👍 The thing about building on top - well... the problem with UI is that the "top" is in a sense the bottom. In that - the user code provides the generic data structure (in this case tray_menu) and then the library does the platform-specific stuff, depending on what is supported. I've seen this done many times and that way, you don't have to sacrifice anything. The user just has to be made aware of what they can do on a given platform. |
I agree with you that you don't HAVE to sacrifice anything. A developer can implement as many features as they want. I think in this case it is a question of expectancy. Lets say a dev builds an app using Tray on Windows and decides to put some information about the process in the tooltip for users to have a quick look whenever they need to, then builds on macOS and there is no tooltip. Thus needing to re-write certain parts specifically for macOS/*nix to show an additional menu item for that information. Granted, this wouldn't be difficult but it wouldn't be "expected behavior". Starting down a road where some platforms have some features that others don't seems outside the scope of this project as it is not presented as a complete UI library. Really though, we can lay out our POVs until we are dead but at the end of the day it isn't up to us. It is up to the owner(s) of the project to decide the road ahead. |
That's true. You seemed to speak with authority in your first post ("therefore should not be..."), so I assumed that you are an owner. 😄 |
At least on Windows, it is standard for tray icons to have tooltips. Hence, I added an option to set one. (If the user doesn't want that, he can set NULL or an empty string)
I am only able to implement the Windows part though (I realize the check for TRAY_WINAPI isn't really necessary because on the other platforms it simply wouldn't do anything... I merely put it there for emphasis) and don't know what the common behavior on Linux distros and macOS is.