mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 08:32:43 +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
					
				
					 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
	
	 Nick Miller
						Nick Miller