From 6fb82b2494d278049515e789059867bc2052b6eb Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 30 Dec 2004 14:55:20 +0000 Subject: Final part of the fix for bug #1091802 (GUI: Credits scroll glitch) svn-id: r16388 --- gui/about.cpp | 8 ++++++-- gui/about.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gui/about.cpp b/gui/about.cpp index 4f4e932fb5..d5f4c2d4e2 100644 --- a/gui/about.cpp +++ b/gui/about.cpp @@ -82,7 +82,7 @@ static const char *credits_intro[] = { AboutDialog::AboutDialog() : Dialog(10, 20, 300, 174), - _scrollPos(0), _scrollTime(0), _modifiers(0) { + _scrollPos(0), _scrollTime(0), _modifiers(0), _willClose(false) { int i; @@ -116,6 +116,8 @@ AboutDialog::AboutDialog() void AboutDialog::open() { _scrollTime = g_system->getMillis() + kScrollStartDelay; _scrollPos = 0; + _modifiers = 0; + _willClose = false; Dialog::open(); } @@ -222,11 +224,13 @@ void AboutDialog::handleMouseUp(int x, int y, int button, int clickCount) { void AboutDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) { _modifiers = modifiers; + if (ascii) + _willClose = true; } void AboutDialog::handleKeyUp(uint16 ascii, int keycode, int modifiers) { _modifiers = modifiers; - if (ascii) + if (ascii && _willClose) close(); } diff --git a/gui/about.h b/gui/about.h index 094b8ec551..dc2e14e245 100644 --- a/gui/about.h +++ b/gui/about.h @@ -34,6 +34,7 @@ protected: StringList _lines; uint32 _lineHeight; byte _modifiers; + bool _willClose; public: AboutDialog(); -- cgit v1.2.3