From 8cb26074bd8d5381d11cae9e9acb2da3df9d5387 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Wed, 6 Aug 2008 15:06:22 +0000 Subject: Added support for customized background dimming on dialogs. Bugfix: Popup widgets were dimming the background. svn-id: r33663 --- gui/ThemeParser.cpp | 11 +++++++++++ gui/ThemeParser.h | 1 + gui/newgui.cpp | 2 +- gui/themes/default.inc | 2 +- gui/themes/modern.stx | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 4226bd714a..868b6fa9e7 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -493,6 +493,17 @@ bool ThemeParser::parserCallback_child(ParserNode *node) { bool ThemeParser::parserCallback_dialog(ParserNode *node) { Common::String var = "Dialog." + node->values["name"]; _theme->themeEval()->addDialog(var, node->values["overlays"]); + + if (node->values.contains("shading")) { + int shading = 0; + if (node->values["shading"] == "dim") + shading = 1; + else if (node->values["shading"] == "luminance") + shading = 2; + else return parserError("Invalid value for Dialog background shading."); + + _theme->themeEval()->setVar(var + ".Shading", shading); + } return true; } diff --git a/gui/ThemeParser.h b/gui/ThemeParser.h index d8993439af..256d1d3770 100644 --- a/gui/ThemeParser.h +++ b/gui/ThemeParser.h @@ -436,6 +436,7 @@ protected: XML_KEY(dialog) XML_PROP(name, true) XML_PROP(overlays, true) + XML_PROP(shading, false) XML_KEY(layout) XML_PROP(type, true) XML_PROP(center, false) diff --git a/gui/newgui.cpp b/gui/newgui.cpp index b8c953619c..e45c081e9b 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -214,7 +214,7 @@ void NewGui::redraw() { _theme->updateScreen(); case kRedrawOpenDialog: - _theme->openDialog(true, GUI::Theme::kShadingDim); + _theme->openDialog(true, (Theme::ShadingStyle)xmlEval()->getVar("Dialog." + _dialogStack.top()->_name + ".Shading", 0)); _dialogStack.top()->drawDialog(); _theme->finishBuffering(); break; diff --git a/gui/themes/default.inc b/gui/themes/default.inc index e34dc80646..499ca752e7 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -1 +1 @@ -" " +" " diff --git a/gui/themes/modern.stx b/gui/themes/modern.stx index 5ae8db30ea..e1639cd6a6 100644 --- a/gui/themes/modern.stx +++ b/gui/themes/modern.stx @@ -519,7 +519,7 @@ - +