Slider's hover popup shows up when when slider is disabled


#1

At the moment the slider’s hover popup will popup even if the slider is disabled.
I think it should not, and that a isEnabled() condition should be added before showing the popup.


#2

I disagree. There will be users that want to know the current value, even when it has no audible effect.


#3

In my opinion disabling a slider is not about making it “not having audible effect”, but it’s about disabling it in the interface so that it does not react to any user input.

And those popups are brought to front, so it’s really annoying if you have the popup of a disabled slider getting drawn on top of another component that you want at the front (like you disable all your interface except a child window, and still, you got some popups drawn over it when the mouse hovers some disabled sliders next to it).


#4

Then simply call “setPopupDisplayEnabled (false, false);” after or before you call “setEnabled (false)”.

I don’t think it’s a good idea to hard-code this functionality into the slider itself. If you really want this for all sliders and don’t want to add that one line of code, then you could also inherit from the slider (you probably already do that anyway) and override the “enablementChanged” function to also disable/enable the popup.


#5

ok, I’m not sure… maybe you’re right. perhaps that would be coherent with the tooltips behaviour.

Or perhaps we could have an additional method to turn that off/on.

Temporary disabling that when the slider gets disabled is complicate at the moment, as I would need to set back the previous state when the slider gets enabled again. I would need some getters for shouldShowOnMouseDrag and shouldShowOnMouseDrag.


#6

maybe you could call slider->setInterceptsMouseClicks (false, false) when disabling the slider, and slider->setInterceptMouseClicks (true, true) when enabling it again?

Despite its name, that method will affect all mouse interactions with your Component, including events triggered by mouse hovering, because it affects what’s returned by the Component’s hitTest() method.


#7

good idea! grazie fede!