[Scummvm-git-logs] scummvm master -> 325260f1ae26c4e8954235f32c314445eb78cbb6

bluegr noreply at scummvm.org
Mon Apr 11 20:01:33 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:
325260f1ae GUI: Fix scrolling in launcher and GMM tabs


Commit: 325260f1ae26c4e8954235f32c314445eb78cbb6
    https://github.com/scummvm/scummvm/commit/325260f1ae26c4e8954235f32c314445eb78cbb6
Author: antoniou79 (a.antoniou79 at gmail.com)
Date: 2022-04-11T23:01:30+03:00

Commit Message:
GUI: Fix scrolling in launcher and GMM tabs

This should address the #13106 issue and similar

It makes widgets, who don't implement handleMouseWheel(), call the handleMouseWheel() of their parent by default
Logic is borrowed from how widgets forward unhandle commands to their parent in handleCommand()

Changed paths:
    gui/object.h
    gui/widget.h


diff --git a/gui/object.h b/gui/object.h
index 1d2fd13c2d1..e614380d325 100644
--- a/gui/object.h
+++ b/gui/object.h
@@ -103,6 +103,7 @@ public:
 	 */
 	virtual Common::Rect getClipRect() const;
 
+	virtual void handleMouseWheel(int x, int y, int direction) {};
 protected:
 	virtual void	releaseFocus() = 0;
 };
diff --git a/gui/widget.h b/gui/widget.h
index 048c2de2312..f6a1ca75bd4 100644
--- a/gui/widget.h
+++ b/gui/widget.h
@@ -138,7 +138,7 @@ public:
 	virtual void handleMouseEntered(int button) {}
 	virtual void handleMouseLeft(int button) {}
 	virtual void handleMouseMoved(int x, int y, int button) {}
-	virtual void handleMouseWheel(int x, int y, int direction) {}
+	void handleMouseWheel(int x, int y, int direction) override { assert(_boss); _boss->handleMouseWheel(x, y, direction); }
 	virtual bool handleKeyDown(Common::KeyState state) { return false; }	// Return true if the event was handled
 	virtual bool handleKeyUp(Common::KeyState state) { return false; }	// Return true if the event was handled
 	virtual void handleTickle() {}




More information about the Scummvm-git-logs mailing list