mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:17:35 +00:00
Userland: Add horizontal mouse scroll support
This commit is contained in:
parent
d61cc47055
commit
1662213737
43 changed files with 112 additions and 84 deletions
|
@ -239,7 +239,12 @@ void RollWidget::mouseup_event([[maybe_unused]] GUI::MouseEvent& event)
|
|||
void RollWidget::mousewheel_event(GUI::MouseEvent& event)
|
||||
{
|
||||
if (event.modifiers() & KeyModifier::Mod_Shift) {
|
||||
horizontal_scrollbar().increase_slider_by(event.wheel_delta() * horizontal_scroll_sensitivity);
|
||||
horizontal_scrollbar().increase_slider_by(event.wheel_delta_y() * horizontal_scroll_sensitivity);
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.wheel_delta_x() != 0) {
|
||||
horizontal_scrollbar().increase_slider_by(event.wheel_delta_x() * horizontal_scroll_sensitivity);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -248,7 +253,7 @@ void RollWidget::mousewheel_event(GUI::MouseEvent& event)
|
|||
return;
|
||||
}
|
||||
|
||||
double multiplier = event.wheel_delta() >= 0 ? 0.5 : 2;
|
||||
double multiplier = event.wheel_delta_y() >= 0 ? 0.5 : 2;
|
||||
|
||||
if (m_zoom_level * multiplier > max_zoom)
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue