mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibGUI: Add mouse wheel event and step property to Slider
This commit is contained in:
parent
69bb0c0246
commit
c7f549ba19
Notes:
sideshowbarker
2024-07-19 09:16:24 +09:00
Author: https://github.com/xTibor
Commit: c7f549ba19
Pull-request: https://github.com/SerenityOS/serenity/pull/1229
2 changed files with 17 additions and 0 deletions
|
@ -167,6 +167,19 @@ void Slider::mouseup_event(MouseEvent& event)
|
|||
return Widget::mouseup_event(event);
|
||||
}
|
||||
|
||||
void Slider::mousewheel_event(MouseEvent& event)
|
||||
{
|
||||
if (!is_enabled())
|
||||
return;
|
||||
|
||||
if (orientation() == Orientation::Horizontal)
|
||||
set_value(value() - event.wheel_delta() * m_step);
|
||||
else
|
||||
set_value(value() + event.wheel_delta() * m_step);
|
||||
|
||||
Widget::mousewheel_event(event);
|
||||
}
|
||||
|
||||
void Slider::leave_event(Core::Event& event)
|
||||
{
|
||||
if (!is_enabled())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue