mirror of https://github.com/aseprite/aseprite.git
Make showing a slider for an IntEntry optional
This commit is contained in:
parent
8c1fa31abd
commit
26cf154198
|
@ -175,6 +175,7 @@ void IntEntry::openPopup()
|
|||
{
|
||||
m_slider->setValue(getValue());
|
||||
|
||||
if (m_useSlider) {
|
||||
// We weren't able to reproduce it, but there are crash reports
|
||||
// where this openPopup() function is called and the popup is still
|
||||
// alive, with the slider inside (we have to remove it before
|
||||
|
@ -212,6 +213,7 @@ void IntEntry::openPopup()
|
|||
m_popupWindow->setHotRegion(rgn);
|
||||
|
||||
m_popupWindow->openWindow();
|
||||
}
|
||||
}
|
||||
|
||||
void IntEntry::closePopup()
|
||||
|
|
|
@ -27,6 +27,10 @@ public:
|
|||
virtual int getValue() const;
|
||||
virtual void setValue(int value);
|
||||
|
||||
// If useSlider is false, then it won't show the slider popup to change its
|
||||
// value.
|
||||
void useSlider(bool useSlider) { m_useSlider = useSlider; }
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(Message* msg) override;
|
||||
void onInitTheme(InitThemeEvent& ev) override;
|
||||
|
@ -42,6 +46,8 @@ protected:
|
|||
int m_max;
|
||||
std::unique_ptr<PopupWindow> m_popupWindow;
|
||||
bool m_changeFromSlider;
|
||||
// If true a slider can be used to modify the value.
|
||||
bool m_useSlider = true;
|
||||
std::unique_ptr<Slider> m_slider;
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue