mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-30 06:52:52 +00:00
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.
This commit is contained in:
parent
6612e026ba
commit
c3a60a5dcd
Notes:
sideshowbarker
2024-07-18 12:40:35 +09:00
Author: https://github.com/ncmiller
Commit: c3a60a5dcd
Pull-request: https://github.com/SerenityOS/serenity/pull/7719
3 changed files with 22 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue