diff options
author | Bastien Bouclet | 2019-11-18 20:34:08 +0100 |
---|---|---|
committer | Bastien Bouclet | 2019-11-24 14:06:25 +0100 |
commit | 41f2ef9745307ddbaf8b7746e0179d1448bb200f (patch) | |
tree | c0090552d702a76b9f87519e22690747a9d53367 | |
parent | 2c812a6b7a0b24b9012379118867fb4f64f32c14 (diff) | |
download | scummvm-rg350-41f2ef9745307ddbaf8b7746e0179d1448bb200f.tar.gz scummvm-rg350-41f2ef9745307ddbaf8b7746e0179d1448bb200f.tar.bz2 scummvm-rg350-41f2ef9745307ddbaf8b7746e0179d1448bb200f.zip |
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.
-rw-r--r-- | gui/widgets/popup.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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; |