[Scummvm-git-logs] scummvm master -> 4f1ae736e5cfff1f3b9d0fe913a0e4e31f9a8098
bluegr
noreply at scummvm.org
Mon Sep 23 20:00:25 UTC 2024
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:
4f1ae736e5 GUI: Fix clicking on PopUpDialog separator
Commit: 4f1ae736e5cfff1f3b9d0fe913a0e4e31f9a8098
https://github.com/scummvm/scummvm/commit/4f1ae736e5cfff1f3b9d0fe913a0e4e31f9a8098
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2024-09-23T23:00:22+03:00
Commit Message:
GUI: Fix clicking on PopUpDialog separator
Clicking on a separator caused an empty selection.
Introduced in: 41f2ef9745307ddbaf8b7746e0179d1448bb200f
Changed paths:
gui/widgets/popup.cpp
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index 54c4d2d7e8e..5b3f1168a7f 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -162,6 +162,12 @@ void PopUpDialog::handleMouseUp(int x, int y, int button, int clickCount) {
int dist = (_clickX - absX) * (_clickX - absX) + (_clickY - absY) * (_clickY - absY);
if (dist > 3 * 3 || g_system->getMillis() - _openTime > 300) {
int item = findItem(x, y);
+
+ // treat separator item as if no item was clicked
+ if (item >= 0 && _entries[item].size() == 0) {
+ item = -1;
+ }
+
setResult(item);
close();
}
@@ -181,6 +187,7 @@ void PopUpDialog::handleMouseMoved(int x, int y, int button) {
// Compute over which item the mouse is...
int item = findItem(x, y);
+ // treat separator item as if no item was moused over
if (item >= 0 && _entries[item].size() == 0)
item = -1;
More information about the Scummvm-git-logs
mailing list