Support scrolling the debugger source code viewport w/the mouse wheel

This commit is contained in:
David Capello 2021-10-25 17:40:47 -03:00
parent 534163ae5f
commit 91e8e5cd46

View File

@ -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<MouseMessage*>(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);
}