diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/newgui.cpp | 2 | ||||
-rw-r--r-- | gui/newgui.h | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 2ad2c26afe..c3f8dbaf03 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -153,7 +153,7 @@ void NewGui::loop() case OSystem::EVENT_LBUTTONDOWN: case OSystem::EVENT_RBUTTONDOWN: { uint32 time = _s->_system->get_msecs(); - if (_lastClick.count && (time < _lastClick.time + 1000) + if (_lastClick.count && (time < _lastClick.time + kDoubleClickDelay) && ABS(_lastClick.x - t.mouse.x) < 3 && ABS(_lastClick.y - t.mouse.y) < 3) { _lastClick.count++; diff --git a/gui/newgui.h b/gui/newgui.h index b63ef50d9c..0b0aef913a 100644 --- a/gui/newgui.h +++ b/gui/newgui.h @@ -37,6 +37,10 @@ enum { kTextAlignRight, }; +enum { + kDoubleClickDelay = 500 // milliseconds +}; + // Extremly simple stack class, doesn't even do any error checking (for now) class DialogStack { protected: |