Do no draw uiSlider value on unix systems to match darwin & windows.#380
Do no draw uiSlider value on unix systems to match darwin & windows.#380szanni wants to merge 1 commit intoandlabs:masterfrom
Conversation
Maybe this could be added to windows and macos and exposed in the constructor? |
|
I can consider taking this if on GTK+ a tooltip is used instead. This is how it works on Windows; I forget if it's how it works on Mac. |
On macOS there is no indication whatsoever. |
|
Exactly, macOS has no indication whatsoever. So to make an app truly cross platform the library user has to provide some other means of conveying the current value to the app user. |
|
This would show a tooltip with the value after hovering over the knob. diff --git a/darwin/slider.m b/darwin/slider.m
index 6f5c5a76..8705a454 100644
--- a/darwin/slider.m
+++ b/darwin/slider.m
@@ -58,6 +58,7 @@ struct uiSlider {
s = (uiSlider *) uiprivMapGet(self->sliders, sender);
(*(s->onChanged))(s, s->onChangedData);
+ [s->slider setToolTip:[NSString stringWithFormat:@"%ld",[s->slider integerValue]]];
}
- (void)registerSlider:(uiSlider *)sBut more generally: What if the slider value isn't really what the user uses? Then the slider tooltip would be wrong. |
|
I just opened a new pr with a slightly different approach with default tooltips on all platforms and enable/disable functions to leave the choice up to the user in #424 |
As can be seen in the example screenshots provided in the README, the slider on Unix platforms looks somewhat different. It draws the current value above the slider. This commit fixes that - makes all platforms look the same.