diff options
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/ThemeParser.cpp | 28 | ||||
| -rw-r--r-- | gui/console.cpp | 2 | ||||
| -rw-r--r-- | gui/credits.h | 5 | ||||
| -rw-r--r-- | gui/options.cpp | 4 | ||||
| -rw-r--r-- | gui/widgets/list.cpp | 1 | ||||
| -rw-r--r-- | gui/widgets/scrollbar.cpp | 58 | ||||
| -rw-r--r-- | gui/widgets/scrollbar.h | 6 |
7 files changed, 47 insertions, 57 deletions
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index db45b5a995..7279279598 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -379,7 +379,7 @@ bool ThemeParser::parseDrawStep(ParserNode *stepNode, Graphics::DrawStep *drawst * theme description format. * @param force Sets if the key is optional or necessary. */ -#define __PARSER_ASSIGN_INT(struct_name, key_name, force) \ +#define PARSER_ASSIGN_INT(struct_name, key_name, force) \ if (stepNode->values.contains(key_name)) { \ if (!parseIntegerKey(stepNode->values[key_name], 1, &x)) \ return parserError("Error parsing key value for '" + Common::String(key_name) + "'."); \ @@ -398,7 +398,7 @@ bool ThemeParser::parseDrawStep(ParserNode *stepNode, Graphics::DrawStep *drawst * @param key_name Name as STRING of the key identifier as it appears in the * theme description format. */ -#define __PARSER_ASSIGN_RGB(struct_name, key_name) \ +#define PARSER_ASSIGN_RGB(struct_name, key_name) \ if (stepNode->values.contains(key_name)) { \ val = stepNode->values[key_name]; \ if (_palette.contains(val)) { \ @@ -415,16 +415,16 @@ bool ThemeParser::parseDrawStep(ParserNode *stepNode, Graphics::DrawStep *drawst drawstep->struct_name.set = true; \ } - __PARSER_ASSIGN_INT(stroke, "stroke", false); - __PARSER_ASSIGN_INT(bevel, "bevel", false); - __PARSER_ASSIGN_INT(shadow, "shadow", false); - __PARSER_ASSIGN_INT(factor, "gradient_factor", false); + PARSER_ASSIGN_INT(stroke, "stroke", false); + PARSER_ASSIGN_INT(bevel, "bevel", false); + PARSER_ASSIGN_INT(shadow, "shadow", false); + PARSER_ASSIGN_INT(factor, "gradient_factor", false); - __PARSER_ASSIGN_RGB(fgColor, "fg_color"); - __PARSER_ASSIGN_RGB(bgColor, "bg_color"); - __PARSER_ASSIGN_RGB(gradColor1, "gradient_start"); - __PARSER_ASSIGN_RGB(gradColor2, "gradient_end"); - __PARSER_ASSIGN_RGB(bevelColor, "bevel_color"); + PARSER_ASSIGN_RGB(fgColor, "fg_color"); + PARSER_ASSIGN_RGB(bgColor, "bg_color"); + PARSER_ASSIGN_RGB(gradColor1, "gradient_start"); + PARSER_ASSIGN_RGB(gradColor2, "gradient_end"); + PARSER_ASSIGN_RGB(bevelColor, "bevel_color"); if (functionSpecific) { assert(stepNode->values.contains("func")); @@ -444,7 +444,7 @@ bool ThemeParser::parseDrawStep(ParserNode *stepNode, Graphics::DrawStep *drawst if (stepNode->values.contains("radius") && stepNode->values["radius"] == "auto") { drawstep->radius = 0xFF; } else { - __PARSER_ASSIGN_INT(radius, "radius", true); + PARSER_ASSIGN_INT(radius, "radius", true); } } @@ -545,8 +545,8 @@ bool ThemeParser::parseDrawStep(ParserNode *stepNode, Graphics::DrawStep *drawst return parserError("'" + stepNode->values["fill"] + "' is not a valid fill mode for a shape."); } -#undef __PARSER_ASSIGN_INT -#undef __PARSER_ASSIGN_RGB +#undef PARSER_ASSIGN_INT +#undef PARSER_ASSIGN_RGB return true; } diff --git a/gui/console.cpp b/gui/console.cpp index dc2c5c4f33..49e2fccd98 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -245,6 +245,8 @@ void ConsoleDialog::handleTickle() { } else draw(); } + + _scrollBar->handleTickle(); } void ConsoleDialog::handleMouseWheel(int x, int y, int direction) { diff --git a/gui/credits.h b/gui/credits.h index fd5d87f0ab..8abd4bba69 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -84,6 +84,9 @@ static const char *credits[] = { "C0""Kari Salminen", "C0""Eugene Sandulenko", "", +"C1""Composer", +"C0""Alyssa Milburn", +"", "C1""CruisE", "C0""Paul Gilbert", "C0""Vincent Hamm", @@ -101,6 +104,7 @@ static const char *credits[] = { "C0""Torbj\366rn Andersson", "C0""Bertrand Augereau", "C0""Vladimir Menshakov", +"C2""(retired)", "", "C1""Gob", "C0""Torbj\366rn Andersson", @@ -214,6 +218,7 @@ static const char *credits[] = { "C0""Robert Megone", "C2""Help with callback rewriting", "C0""Vladimir Menshakov", +"C2""(retired)", "", "C1""Tinsel", "C0""Torbj\366rn Andersson", diff --git a/gui/options.cpp b/gui/options.cpp index 2291bb5ee9..4ded2edca3 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -216,7 +216,7 @@ void OptionsDialog::open() { #endif // SMALL_SCREEN_DEVICE // EGA undithering setting - if (_guioptions.contains(GUIO_EGAUNDITHER)) { + if (_guioptions.contains(GUIO_EGAUNDITHER) || _domain == Common::ConfigManager::kApplicationDomain) { _disableDitheringCheckbox->setEnabled(true); _disableDitheringCheckbox->setState(ConfMan.getBool("disable_dithering", _domain)); } else { @@ -609,7 +609,7 @@ void OptionsDialog::setGraphicSettingsState(bool enabled) { else _aspectCheckbox->setEnabled(enabled); #endif - if (_guioptions.contains(GUIO_EGAUNDITHER)) + if (_guioptions.contains(GUIO_EGAUNDITHER) && enabled) _disableDitheringCheckbox->setEnabled(true); else _disableDitheringCheckbox->setEnabled(false); diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp index 2a0d4afff0..13784ddf7f 100644 --- a/gui/widgets/list.cpp +++ b/gui/widgets/list.cpp @@ -220,6 +220,7 @@ void ListWidget::scrollBarRecalc() { void ListWidget::handleTickle() { if (_editMode) EditableWidget::handleTickle(); + _scrollBar->handleTickle(); } void ListWidget::handleMouseDown(int x, int y, int button, int clickCount) { diff --git a/gui/widgets/scrollbar.cpp b/gui/widgets/scrollbar.cpp index e0dbcec59c..c7c17bc908 100644 --- a/gui/widgets/scrollbar.cpp +++ b/gui/widgets/scrollbar.cpp @@ -45,28 +45,8 @@ ScrollBarWidget::ScrollBarWidget(GuiObject *boss, int x, int y, int w, int h) _numEntries = 0; _entriesPerPage = 0; _currentPos = 0; -} - -static void upArrowRepeater(void *ref) { - ScrollBarWidget *sb = (ScrollBarWidget *)ref; - int old_pos = sb->_currentPos; - - sb->_currentPos -= 3; - sb->checkBounds(old_pos); - - g_system->getTimerManager()->removeTimerProc(&upArrowRepeater); - g_system->getTimerManager()->installTimerProc(&upArrowRepeater, 1000000/10, ref, "guiScrollBarUp"); -} - -static void downArrowRepeater(void *ref) { - ScrollBarWidget *sb = (ScrollBarWidget *)ref; - int old_pos = sb->_currentPos; - sb->_currentPos += 3; - sb->checkBounds(old_pos); - - g_system->getTimerManager()->removeTimerProc(&downArrowRepeater); - g_system->getTimerManager()->installTimerProc(&downArrowRepeater, 1000000/10, ref, "guiScrollBarDown"); + _repeatTimer = 0; } void ScrollBarWidget::handleMouseDown(int x, int y, int button, int clickCount) { @@ -79,13 +59,13 @@ void ScrollBarWidget::handleMouseDown(int x, int y, int button, int clickCount) if (y <= UP_DOWN_BOX_HEIGHT) { // Up arrow _currentPos--; + _repeatTimer = g_system->getMillis() + kRepeatInitialDelay; _draggingPart = kUpArrowPart; - g_system->getTimerManager()->installTimerProc(&upArrowRepeater, 1000000/2, this, "guiScrollBarUp"); } else if (y >= _h - UP_DOWN_BOX_HEIGHT) { // Down arrow _currentPos++; + _repeatTimer = g_system->getMillis() + kRepeatInitialDelay; _draggingPart = kDownArrowPart; - g_system->getTimerManager()->installTimerProc(&downArrowRepeater, 1000000/2, this, "guiScrollBarDown"); } else if (y < _sliderPos) { _currentPos -= _entriesPerPage - 1; } else if (y >= _sliderPos + _sliderHeight) { @@ -101,9 +81,7 @@ void ScrollBarWidget::handleMouseDown(int x, int y, int button, int clickCount) void ScrollBarWidget::handleMouseUp(int x, int y, int button, int clickCount) { _draggingPart = kNoPart; - - g_system->getTimerManager()->removeTimerProc(&upArrowRepeater); - g_system->getTimerManager()->removeTimerProc(&downArrowRepeater); + _repeatTimer = 0; } void ScrollBarWidget::handleMouseWheel(int x, int y, int direction) { @@ -160,23 +138,21 @@ void ScrollBarWidget::handleMouseMoved(int x, int y, int button) { } void ScrollBarWidget::handleTickle() { -/* - // FIXME/TODO - this code is supposed to allow for "click-repeat" (like key repeat), - // i.e. if you click on one of the arrows and keep clicked, it will scroll - // continuously. However, just like key repeat, this requires two delays: - // First an "initial" delay that has to pass before repeating starts (otherwise - // it is near to impossible to achieve single clicks). Secondly, a repeat delay - // that determines how often per second a click is simulated. - int old_pos = _currentPos; + if (_repeatTimer) { + const uint32 curTime = g_system->getMillis(); + if (curTime >= _repeatTimer) { + const int old_pos = _currentPos; - if (_draggingPart == kUpArrowPart) - _currentPos--; - else if (_draggingPart == kDownArrowPart) - _currentPos++; + if (_part == kUpArrowPart) + _currentPos -= 3; + else if (_part == kDownArrowPart) + _currentPos += 3; - // Make sure that _currentPos is still inside the bounds - checkBounds(old_pos); -*/ + checkBounds(old_pos); + + _repeatTimer = curTime + kRepeatDelay; + } + } } void ScrollBarWidget::checkBounds(int old_pos) { diff --git a/gui/widgets/scrollbar.h b/gui/widgets/scrollbar.h index 3b248ce8a4..1c9f371cbc 100644 --- a/gui/widgets/scrollbar.h +++ b/gui/widgets/scrollbar.h @@ -49,6 +49,12 @@ protected: Part _draggingPart; int _sliderDeltaMouseDownPos; + enum { + kRepeatInitialDelay = 500, + kRepeatDelay = 100 + }; + uint32 _repeatTimer; + public: int _numEntries; int _entriesPerPage; |
