From 41f2ef9745307ddbaf8b7746e0179d1448bb200f Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Mon, 18 Nov 2019 20:34:08 +0100 Subject: GUI: Use the item at the click position in PopUpDialog Fixes the having the drag in the dialog to change the selection on platforms with a touch screen. --- gui/widgets/popup.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gui') diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp index 351d0fe559..ebb69f1e4d 100644 --- a/gui/widgets/popup.cpp +++ b/gui/widgets/popup.cpp @@ -155,7 +155,8 @@ void PopUpDialog::handleMouseUp(int x, int y, int button, int clickCount) { // let the popup stay open. If it did move, assume the user made his selection. int dist = (_clickX - absX) * (_clickX - absX) + (_clickY - absY) * (_clickY - absY); if (dist > 3 * 3 || g_system->getMillis() - _openTime > 300) { - setResult(_selection); + int item = findItem(x, y); + setResult(item); close(); } _clickX = -1; -- cgit v1.2.3