mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Ladybird/Qt: Explicitly ignore wheel events with the ctrl key pressed
This allows ctrl+wheel events to zoom in and out of the page. This was
ported incorrectly in commit c1476c3405
.
This commit is contained in:
parent
6dfb2f9dc8
commit
8a602876d7
Notes:
sideshowbarker
2024-07-17 06:51:40 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/8a602876d7 Pull-request: https://github.com/SerenityOS/serenity/pull/23488
1 changed files with 6 additions and 1 deletions
|
@ -364,6 +364,11 @@ void WebContentView::mouseReleaseEvent(QMouseEvent* event)
|
|||
|
||||
void WebContentView::wheelEvent(QWheelEvent* event)
|
||||
{
|
||||
if (event->modifiers().testFlag(Qt::ControlModifier)) {
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
|
||||
enqueue_native_event(Web::MouseEvent::Type::MouseWheel, *event);
|
||||
}
|
||||
|
||||
|
@ -699,7 +704,7 @@ void WebContentView::enqueue_native_event(Web::MouseEvent::Type type, QSinglePoi
|
|||
int wheel_delta_x = 0;
|
||||
int wheel_delta_y = 0;
|
||||
|
||||
if (type == Web::MouseEvent::Type::MouseWheel && !event.modifiers().testFlag(Qt::ControlModifier)) {
|
||||
if (type == Web::MouseEvent::Type::MouseWheel) {
|
||||
auto const& wheel_event = static_cast<QWheelEvent const&>(event);
|
||||
|
||||
if (auto pixel_delta = -wheel_event.pixelDelta(); !pixel_delta.isNull()) {
|
||||
|
|
Loading…
Reference in a new issue