[Scummvm-git-logs] scummvm master -> dc69bd4d67292db883f7b98d80d528df53a6f8f3

antoniou79 noreply at scummvm.org
Wed Jun 29 12:54:22 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:
dc69bd4d67 GUI: Fix infinite loop with mouse wheel over tab


Commit: dc69bd4d67292db883f7b98d80d528df53a6f8f3
    https://github.com/scummvm/scummvm/commit/dc69bd4d67292db883f7b98d80d528df53a6f8f3
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2022-06-29T15:54:06+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