mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 12:39:56 +00:00
GUI: Fix infinite loop with mouse wheel over tab
Reported as regression in #13106 Comment link: https://bugs.scummvm.org/ticket/13106#comment:4
This commit is contained in:
parent
125edd6724
commit
dc69bd4d67
@ -318,6 +318,14 @@ bool TabWidget::handleKeyDown(Common::KeyState state) {
|
||||
return Widget::handleKeyDown(state);
|
||||
}
|
||||
|
||||
void TabWidget::handleMouseWheel(int x, int y, int direction) {
|
||||
if (direction == 1) {
|
||||
adjustTabs(kTabForwards);
|
||||
} else {
|
||||
adjustTabs(kTabBackwards);
|
||||
}
|
||||
}
|
||||
|
||||
void TabWidget::adjustTabs(int value) {
|
||||
// Determine which tab is next
|
||||
int tabID = _activeTab + value;
|
||||
|
@ -112,6 +112,7 @@ public:
|
||||
void handleMouseMoved(int x, int y, int button) override;
|
||||
void handleMouseLeft(int button) override { _lastRead = -1; };
|
||||
bool handleKeyDown(Common::KeyState state) override;
|
||||
void handleMouseWheel(int x, int y, int direction) override;
|
||||
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
||||
virtual int getFirstVisible() const;
|
||||
virtual void setFirstVisible(int tabID, bool adjustIfRoom = false);
|
||||
|
Loading…
Reference in New Issue
Block a user