diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dialogs.cpp | 43 | ||||
-rw-r--r-- | engines/dialogs.h | 3 |
2 files changed, 46 insertions, 0 deletions
diff --git a/engines/dialogs.cpp b/engines/dialogs.cpp index 3d93a0da23..7c5963544c 100644 --- a/engines/dialogs.cpp +++ b/engines/dialogs.cpp @@ -35,6 +35,7 @@ #include "gui/eval.h" #include "gui/newgui.h" #include "gui/ListWidget.h" +#include "gui/theme.h" #include "engines/dialogs.h" #include "engines/engine.h" @@ -77,7 +78,18 @@ enum { MainMenuDialog::MainMenuDialog(Engine *engine) : GlobalDialog("globalmain"), _engine(engine) { +#ifndef DISABLE_FANCY_THEMES + _logo = 0; + if (g_gui.evaluator()->getVar("global_logo.visible") == 1 && g_gui.theme()->supportsImages()) { + _logo = new GUI::GraphicsWidget(this, "global_logo"); + _logo->useThemeTransparency(true); + _logo->setGfx(g_gui.theme()->getImageSurface(GUI::Theme::kImageLogoSmall)); + } else { + new StaticTextWidget(this, "global_title", "ScummVM"); + } +#else new StaticTextWidget(this, "global_title", "ScummVM"); +#endif new StaticTextWidget(this, "global_version", gScummVMVersionDate); @@ -136,6 +148,37 @@ void MainMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat } } +void MainMenuDialog::reflowLayout() { +#ifndef DISABLE_FANCY_THEMES + if (g_gui.evaluator()->getVar("global_logo.visible") == 1 && g_gui.theme()->supportsImages()) { + if (!_logo) + _logo = new GUI::GraphicsWidget(this, "global_logo"); + _logo->useThemeTransparency(true); + _logo->setGfx(g_gui.theme()->getImageSurface(GUI::Theme::kImageLogoSmall)); + + GUI::StaticTextWidget *title = (StaticTextWidget *)findWidget("global_title"); + if (title) { + removeWidget(title); + title->setNext(0); + delete title; + } + } else { + GUI::StaticTextWidget *title = (StaticTextWidget *)findWidget("global_title"); + if (!title) + new StaticTextWidget(this, "global_title", "ScummVM"); + + if (_logo) { + removeWidget(_logo); + _logo->setNext(0); + delete _logo; + _logo = 0; + } + } +#endif + + Dialog::reflowLayout(); +} + enum { kOKCmd = 'ok ' }; diff --git a/engines/dialogs.h b/engines/dialogs.h index 61c06006cb..66ea13b8f1 100644 --- a/engines/dialogs.h +++ b/engines/dialogs.h @@ -49,9 +49,12 @@ public: virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data); + virtual void reflowLayout(); + protected: Engine *_engine; + GUI::GraphicsWidget *_logo; GUI::ButtonWidget *_rtlButton; GUI::Dialog *_aboutDialog; GUI::Dialog *_optionsDialog; |