mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Ladybird: Don't scroll web view if wheel event is a Ctrl+Wheel zoom
This commit is contained in:
parent
bf16618fba
commit
c0a5787395
Notes:
sideshowbarker
2024-07-16 22:11:09 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c0a5787395
2 changed files with 11 additions and 0 deletions
|
@ -262,6 +262,16 @@ KeyCode get_keycode_from_qt_keyboard_event(QKeyEvent const& event)
|
|||
return Key_Invalid;
|
||||
}
|
||||
|
||||
void WebContentView::wheelEvent(QWheelEvent* event)
|
||||
{
|
||||
if (!event->modifiers().testFlag(Qt::ControlModifier)) {
|
||||
QAbstractScrollArea::wheelEvent(event);
|
||||
event->accept();
|
||||
return;
|
||||
}
|
||||
event->ignore();
|
||||
}
|
||||
|
||||
void WebContentView::mouseMoveEvent(QMouseEvent* event)
|
||||
{
|
||||
Gfx::IntPoint position(event->position().x() / m_inverse_pixel_scaling_ratio, event->position().y() / m_inverse_pixel_scaling_ratio);
|
||||
|
|
|
@ -46,6 +46,7 @@ public:
|
|||
|
||||
virtual void paintEvent(QPaintEvent*) override;
|
||||
virtual void resizeEvent(QResizeEvent*) override;
|
||||
virtual void wheelEvent(QWheelEvent*) override;
|
||||
virtual void mouseMoveEvent(QMouseEvent*) override;
|
||||
virtual void mousePressEvent(QMouseEvent*) override;
|
||||
virtual void mouseReleaseEvent(QMouseEvent*) override;
|
||||
|
|
Loading…
Reference in a new issue