1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Added a parameter to Slider::setPopupDisplayEnabled() to set the timeout for displaying the popup display on mouse hover

This commit is contained in:
ed 2017-10-16 08:54:55 +01:00
parent 6344cd549a
commit 725947d764
2 changed files with 7 additions and 3 deletions

View file

@ -966,7 +966,7 @@ public:
showPopupDisplay();
if (popupDisplay != nullptr)
popupDisplay->startTimer (2000);
popupDisplay->startTimer (popupHoverTimeout);
}
}
}
@ -1259,6 +1259,8 @@ public:
bool scrollWheelEnabled = true;
bool snapsToMousePos = true;
int popupHoverTimeout = 2000;
ScopedPointer<Label> valueBox;
ScopedPointer<Button> incButton, decButton;
@ -1446,11 +1448,12 @@ void Slider::setChangeNotificationOnlyOnRelease (bool onlyNotifyOnRelease)
bool Slider::getSliderSnapsToMousePosition() const noexcept { return pimpl->snapsToMousePos; }
void Slider::setSliderSnapsToMousePosition (const bool shouldSnapToMouse) { pimpl->snapsToMousePos = shouldSnapToMouse; }
void Slider::setPopupDisplayEnabled (bool showOnDrag, bool showOnHover, Component* parent)
void Slider::setPopupDisplayEnabled (bool showOnDrag, bool showOnHover, Component* parent, int hoverTimeout)
{
pimpl->showPopupOnDrag = showOnDrag;
pimpl->showPopupOnHover = showOnHover;
pimpl->parentForPopupDisplay = parent;
pimpl->popupHoverTimeout = hoverTimeout;
}
Component* Slider::getCurrentPopupDisplay() const noexcept { return pimpl->popupDisplay.get(); }

View file

@ -629,7 +629,8 @@ public:
*/
void setPopupDisplayEnabled (bool shouldShowOnMouseDrag,
bool shouldShowOnMouseHover,
Component* parentComponentToUse);
Component* parentComponentToUse,
int hoverTimeout = 2000);
/** If a popup display is enabled and is currently visible, this returns the component
that is being shown, or nullptr if none is currently in use.