[Scummvm-git-logs] scummvm branch-2-6 -> 2d0afce13ccf438e28e2b666ad730f8cff0469a8
antoniou79
noreply at scummvm.org
Thu Jun 30 10:34:42 UTC 2022
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
2d0afce13c GUI: Fix infinite loop with mouse wheel over tab
Commit: 2d0afce13ccf438e28e2b666ad730f8cff0469a8
https://github.com/scummvm/scummvm/commit/2d0afce13ccf438e28e2b666ad730f8cff0469a8
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2022-06-30T13:17:25+03:00
Commit Message:
GUI: Fix infinite loop with mouse wheel over tab
Reported as regression in #13106
Comment link: https://bugs.scummvm.org/ticket/13106#comment:4
Changed paths:
gui/widgets/tab.cpp
gui/widgets/tab.h
diff --git a/gui/widgets/tab.cpp b/gui/widgets/tab.cpp
index 07af143c5fa..1e130ea34b6 100644
--- a/gui/widgets/tab.cpp
+++ b/gui/widgets/tab.cpp
@@ -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;
diff --git a/gui/widgets/tab.h b/gui/widgets/tab.h
index 3c33166ae38..fd92671948f 100644
--- a/gui/widgets/tab.h
+++ b/gui/widgets/tab.h
@@ -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);
More information about the Scummvm-git-logs
mailing list