1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:17:35 +00:00

SoundPlayer: Fix playback slider page stepping

Fixes a bug that was preventing the playback slider from changing
value when clicking ahead/behind the current position.
This commit is contained in:
Nick Miller 2021-06-01 18:45:09 -07:00 committed by Andreas Kling
parent 15b69eef66
commit f02d976ed7
2 changed files with 22 additions and 3 deletions

View file

@ -19,17 +19,29 @@ public:
GUI::Slider::set_value(value);
}
bool mouse_is_down() const { return m_mouse_is_down; }
protected:
AutoSlider(Orientation orientation)
: GUI::Slider(orientation)
{
}
virtual void mousedown_event(GUI::MouseEvent& event) override
{
m_mouse_is_down = true;
GUI::Slider::mousedown_event(event);
}
virtual void mouseup_event(GUI::MouseEvent& event) override
{
m_mouse_is_down = false;
if (on_knob_released && is_enabled())
on_knob_released(value());
GUI::Slider::mouseup_event(event);
}
private:
bool m_mouse_is_down { false };
};