mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:38:10 +00:00
LibGUI: Add page_step setting to AbstractSlider and use it in Slider
This makes clicking on the track of a GUI::Slider actually move the knob more than 1 value unit (assuming page_step > 1)
This commit is contained in:
parent
fa836a4dda
commit
3b445bc66a
3 changed files with 12 additions and 2 deletions
|
@ -105,9 +105,9 @@ void Slider::mousedown_event(MouseEvent& event)
|
|||
return;
|
||||
} else {
|
||||
if (event.position().primary_offset_for_orientation(orientation()) > knob_rect().last_edge_for_orientation(orientation()))
|
||||
set_value(value() + 1);
|
||||
set_value(value() + page_step());
|
||||
else if (event.position().primary_offset_for_orientation(orientation()) < knob_rect().first_edge_for_orientation(orientation()))
|
||||
set_value(value() - 1);
|
||||
set_value(value() - page_step());
|
||||
}
|
||||
}
|
||||
return Widget::mousedown_event(event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue