diff options
author | Nick Miller <nick.miller.83@gmail.com> | 2021-06-02 17:42:08 -0700 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-06-08 00:10:54 +0430 |
commit | c3a60a5dcd8f4275520229df482ce7e43eefdde7 (patch) | |
tree | 51c5876ac84798276cbe9e583a2367e8753b7235 /Userland/Applications | |
parent | 6612e026ba5657357bd1e15ad76b5d150e3cdcad (diff) | |
download | serenity-c3a60a5dcd8f4275520229df482ce7e43eefdde7.zip |
LibGUI+SoundPlayer: Add Slider option to jump to cursor
When the cursor is clicked outside of the slider knob,
the current behavior is that it will step up or down by the
Slider page step amount.
This commit adds an option to jump the slider knob
directly to the where the mouse cursor is on mouse down events.
This behavior is disabled by default. It must be enabled with
`Slider::set_jump_to_cursor()`.
Jump to cursor is enabled in SoundPlayer since most music players
have this behavior.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp index 477278d8e7..778fdc0dcb 100644 --- a/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp +++ b/Userland/Applications/SoundPlayer/SoundPlayerWidgetAdvancedView.cpp @@ -53,6 +53,7 @@ SoundPlayerWidgetAdvancedView::SoundPlayerWidgetAdvancedView(GUI::Window& window m_playback_progress_slider = m_player_view->add<AutoSlider>(Orientation::Horizontal); m_playback_progress_slider->set_fixed_height(20); + m_playback_progress_slider->set_jump_to_cursor(true); m_playback_progress_slider->set_min(0); m_playback_progress_slider->set_max(total_samples); m_playback_progress_slider->set_page_step(total_samples / 10); |