From 91e8e5cd46a079fec514c933c46cd4c0da3bf49c Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 25 Oct 2021 17:40:47 -0300 Subject: [PATCH] Support scrolling the debugger source code viewport w/the mouse wheel --- src/app/commands/debugger.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/app/commands/debugger.cpp b/src/app/commands/debugger.cpp index fd5a9f0c2..2916caa3e 100644 --- a/src/app/commands/debugger.cpp +++ b/src/app/commands/debugger.cpp @@ -170,6 +170,25 @@ public: protected: bool onProcessMessage(Message* msg) override { + switch (msg->type()) { + + case kMouseWheelMessage: { + View* view = View::getView(this); + if (view) { + auto mouseMsg = static_cast(msg); + gfx::Point scroll = view->viewScroll(); + + if (mouseMsg->preciseWheel()) + scroll += mouseMsg->wheelDelta(); + else + scroll += mouseMsg->wheelDelta() * textHeight()*3; + + view->setViewScroll(scroll); + } + break; + } + + } return Widget::onProcessMessage(msg); }