mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03: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:
parent
15b69eef66
commit
f02d976ed7
2 changed files with 22 additions and 3 deletions
|
@ -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 };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue