Skip to content
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

Make slider tooltip default on all platforms. Add slider tooltips with enable/disable functions. #424

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

szanni
Copy link

@szanni szanni commented Sep 26, 2018

This is an updated version of #380 addressing the concerns raised in that pull request.
As can be seen in the README the slider is not consistent across platforms.
This set of patches disables the value drawn over the slider on unix platforms and replaces it with a tooltip. macOS has a tooltip now by default too.
The displaying of tooltips can be enabled/disabled via the uiSliderSetHasTooltip function.
uiSliderHasTooltip can be used to check the current state of the slider tooltip.

Tested on Linux, macOS and wine/mingw-w64.

@mischnic
Copy link
Contributor

Ideally, the tooltip could be set by the user (via a callback for a different range or specifying units), but being able to disable them at least makes it possible to avoid confusion if two different values are displayed (e.g. in the tooltip and a separate label).

@szanni
Copy link
Author

szanni commented Sep 26, 2018

Ideally, the tooltip could be set by the user (via a callback for a different range or specifying units), but being able to disable them at least makes it possible to avoid confusion if two different values are displayed (e.g. in the tooltip and a separate label).

I thought about that. Unix and macOS should be fairly easy in that regard, but windows seems very convoluted. Or well, the MSDN docs are just crap. I've been browsing the wine source code to get a grip on tooltips but I haven't quite figured out how to set custom messages. It looks like TTM_UPDATETIPTEXT would be the message to send on every value change!? Since that takes a WCHAR every call would entail a conversion as well? I definitely want to look into that when I have more time. But I would think of this being a different API call.

@mischnic mischnic mentioned this pull request Sep 26, 2018
@andlabs andlabs added this to the Unassigned Backlog milestone Dec 31, 2018
szanni added 2 commits June 30, 2019 16:45
…unctions.

Introduce two new API functions uiSliderHasTooltip and uiSliderSetHasTooltip to
query and set uiSlider tooltip state.

Fix inconsistency between windows (tooltip), unix (value over slider) and
darwin (no value displayed at all).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants