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

**URL:** <https://forum.juce.com/t/sliders-hover-popup-shows-up-when-when-slider-is-disabled/25124>\
**Category:** General JUCE discussion\
**Created:** [November 14, 2017, 10:59am UTC](https://forum.juce.com/t/sliders-hover-popup-shows-up-when-when-slider-is-disabled/25124 "2017-11-14T10:59:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [November 14, 2017, 10:59am UTC](https://forum.juce.com/t/sliders-hover-popup-shows-up-when-when-slider-is-disabled/25124/1 "2017-11-14T10:59:51Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Toddler-Boy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/toddler-boy/32/2007_2.png) [@Toddler-Boy](https://forum.juce.com/u/Toddler-Boy)\
**Post date:** [November 14, 2017, 7:30pm UTC](https://forum.juce.com/t/sliders-hover-popup-shows-up-when-when-slider-is-disabled/25124/2 "2017-11-14T19:30:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [November 14, 2017, 7:47pm UTC](https://forum.juce.com/t/sliders-hover-popup-shows-up-when-when-slider-is-disabled/25124/3 "2017-11-14T19:47:08Z")

</div>

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).

---

<div class="post-metadata">

**Author:** ![Toddler-Boy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/toddler-boy/32/2007_2.png) [@Toddler-Boy](https://forum.juce.com/u/Toddler-Boy)\
**Post date:** [November 14, 2017, 8:56pm UTC](https://forum.juce.com/t/sliders-hover-popup-shows-up-when-when-slider-is-disabled/25124/4 "2017-11-14T20:56:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [November 15, 2017, 7:00am UTC](https://forum.juce.com/t/sliders-hover-popup-shows-up-when-when-slider-is-disabled/25124/5 "2017-11-15T07:00:34Z")

</div>

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`.

---

<div class="post-metadata">

**Author:** ![yfede](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/yfede/32/506_2.png) [@yfede](https://forum.juce.com/u/yfede)\
**Post date:** [November 15, 2017, 8:11am UTC](https://forum.juce.com/t/sliders-hover-popup-shows-up-when-when-slider-is-disabled/25124/6 "2017-11-15T08:11:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lalala](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/lalala/32/8577_2.png) [@lalala](https://forum.juce.com/u/lalala)\
**Post date:** [November 15, 2017, 8:59am UTC](https://forum.juce.com/t/sliders-hover-popup-shows-up-when-when-slider-is-disabled/25124/7 "2017-11-15T08:59:55Z")

</div>

good idea! grazie fede!
