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
2 changed files with 9 additions and 0 deletions
|
@ -318,6 +318,14 @@ bool TabWidget::handleKeyDown(Common::KeyState state) {
|
||||||
return Widget::handleKeyDown(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) {
|
void TabWidget::adjustTabs(int value) {
|
||||||
// Determine which tab is next
|
// Determine which tab is next
|
||||||
int tabID = _activeTab + value;
|
int tabID = _activeTab + value;
|
||||||
|
|
|
@ -112,6 +112,7 @@ public:
|
||||||
void handleMouseMoved(int x, int y, int button) override;
|
void handleMouseMoved(int x, int y, int button) override;
|
||||||
void handleMouseLeft(int button) override { _lastRead = -1; };
|
void handleMouseLeft(int button) override { _lastRead = -1; };
|
||||||
bool handleKeyDown(Common::KeyState state) override;
|
bool handleKeyDown(Common::KeyState state) override;
|
||||||
|
void handleMouseWheel(int x, int y, int direction) override;
|
||||||
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data) override;
|
||||||
virtual int getFirstVisible() const;
|
virtual int getFirstVisible() const;
|
||||||
virtual void setFirstVisible(int tabID, bool adjustIfRoom = false);
|
virtual void setFirstVisible(int tabID, bool adjustIfRoom = false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue