mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +00:00
LibGUI: Add mouse wheel event and step property to Slider
This commit is contained in:
committed by
Andreas Kling
parent
69bb0c0246
commit
c7f549ba19
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user