mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:47:36 +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
1 changed files with 6 additions and 1 deletions
|
@ -364,6 +364,11 @@ void WebContentView::mouseReleaseEvent(QMouseEvent* event)
|
||||||
|
|
||||||
void WebContentView::wheelEvent(QWheelEvent* event)
|
void WebContentView::wheelEvent(QWheelEvent* event)
|
||||||
{
|
{
|
||||||
|
if (event->modifiers().testFlag(Qt::ControlModifier)) {
|
||||||
|
event->ignore();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
enqueue_native_event(Web::MouseEvent::Type::MouseWheel, *event);
|
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_x = 0;
|
||||||
int wheel_delta_y = 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);
|
auto const& wheel_event = static_cast<QWheelEvent const&>(event);
|
||||||
|
|
||||||
if (auto pixel_delta = -wheel_event.pixelDelta(); !pixel_delta.isNull()) {
|
if (auto pixel_delta = -wheel_event.pixelDelta(); !pixel_delta.isNull()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue