# FR: make the bubble component used for the Slider::popup display customizable

**URL:** <https://forum.juce.com/t/fr-make-the-bubble-component-used-for-the-slider-popup-display-customizable/33823>\
**Category:** Feature Requests\
**Created:** [June 10, 2019, 11:04pm UTC](https://forum.juce.com/t/fr-make-the-bubble-component-used-for-the-slider-popup-display-customizable/33823 "2019-06-10T23:04:45Z")\
**Posts on this page:** 4\
**Page:** 1

<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:** [June 10, 2019, 11:04pm UTC](https://forum.juce.com/t/fr-make-the-bubble-component-used-for-the-slider-popup-display-customizable/33823/1 "2019-06-10T23:04:45Z")

</div>

Right now we can only override its “paint” function but we have almost no control over its size or layout. A simple

```auto
Rectangle<int> getSliderPopupLayout (Slider&)

```

callback in the LAF would be enough. It could return a “Rectangle” relative to its Slider.

We would like to make the popup display a minimum width to make it visually more stable in case of drastic value changes. Right now the popup changes it’s width dramatically and that simply looks ugly.

---

<div class="post-metadata">

**Author:** ![asimilon](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/asimilon/32/4235_2.png) [@asimilon](https://forum.juce.com/u/asimilon)\
**Post date:** [June 11, 2019, 11:37am UTC](https://forum.juce.com/t/fr-make-the-bubble-component-used-for-the-slider-popup-display-customizable/33823/2 "2019-06-11T11:37:55Z")

</div>

+1 for this, I implemented my own options for repositioning the pop up as they are designed to show relative to the edge of the slider bounds, which if you have a large margin looks really disconnected from the control.

---

<div class="post-metadata">

**Author:** ![basteln](https://avatars.discourse-cdn.com/v4/letter/b/f19dbf/32.png) [@basteln](https://forum.juce.com/u/basteln)\
**Post date:** [June 11, 2019, 12:18pm UTC](https://forum.juce.com/t/fr-make-the-bubble-component-used-for-the-slider-popup-display-customizable/33823/3 "2019-06-11T12:18:22Z")

</div>

The bubble also has a drop shadow effect by default, which can be quite CPU-heavy. Right now I remove it in every `Slider`'s `mouseDown`:

```cpp
if (auto* popupDisplay = getCurrentPopupDisplay())
        popupDisplay->setComponentEffect(nullptr);

```

So maybe a more general `createSliderPopupDisplay(Slider&)` would be good. You could implement it by first calling super, and then doing your own `setSize` on the BubbleComponent, or remove its drop shadow.

---

<div class="post-metadata">

**Author:** ![mathieudemange](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mathieudemange/32/13333_2.png) [@mathieudemange](https://forum.juce.com/u/mathieudemange)\
**Post date:** [June 12, 2019, 8:29am UTC](https://forum.juce.com/t/fr-make-the-bubble-component-used-for-the-slider-popup-display-customizable/33823/4 "2019-06-12T08:29:23Z")

</div>

+1 for that! I also had to implement my own “double-click on a slider to show its TextEditor” thing but always wished it could be the PopupDisplay that would turn into a TextEditor, right in place (and positioned with more control).
