Fixes bug with wrong colors in the logo after a screen change. (this time it works!)

svn-id: r21984
This commit is contained in:
Johannes Schickel 2006-04-17 18:50:33 +00:00
parent 43143daca7
commit 955b53fb88
2 changed files with 14 additions and 8 deletions

View File

@ -444,13 +444,14 @@ LauncherDialog::LauncherDialog(GameDetector &detector)
_w = screenW; _w = screenW;
_h = screenH; _h = screenH;
_logo = 0;
#ifndef DISABLE_FANCY_THEMES #ifndef DISABLE_FANCY_THEMES
if (g_gui.evaluator()->getVar("launcher_logo.visible") == 1) { if (g_gui.evaluator()->getVar("launcher_logo.visible") == 1) {
GraphicsWidget *logo = new GraphicsWidget(this, "launcher_logo"); _logo = new GraphicsWidget(this, "launcher_logo");
ThemeNew *th = (ThemeNew *)g_gui.theme(); ThemeNew *th = (ThemeNew *)g_gui.theme();
logo->useTransparency(true); _logo->useTransparency(true);
logo->setGfx(th->getImageSurface(th->kThemeLogo)); _logo->setGfx(th->getImageSurface(th->kThemeLogo));
new StaticTextWidget(this, "launcher_version", gScummVMVersionDate); new StaticTextWidget(this, "launcher_version", gScummVMVersionDate);
} else } else
@ -766,13 +767,14 @@ void LauncherDialog::updateButtons() {
void LauncherDialog::handleScreenChanged() { void LauncherDialog::handleScreenChanged() {
#ifndef DISABLE_FANCY_THEMES #ifndef DISABLE_FANCY_THEMES
if (g_gui.evaluator()->getVar("launcher_logo.visible") == 1) { if (g_gui.evaluator()->getVar("launcher_logo.visible") == 1) {
GraphicsWidget *logo = new GraphicsWidget(this, "launcher_logo"); if (!_logo)
_logo = new GraphicsWidget(this, "launcher_logo");
ThemeNew *th = (ThemeNew *)g_gui.theme(); ThemeNew *th = (ThemeNew *)g_gui.theme();
logo->useTransparency(true); _logo->useTransparency(true);
logo->setGfx(th->getImageSurface(th->kThemeLogo)); _logo->setGfx(th->getImageSurface(th->kThemeLogo));
} else {
new StaticTextWidget(this, "launcher_version", gScummVMVersionDate); delete _logo;
} }
#endif #endif
Dialog::handleScreenChanged(); Dialog::handleScreenChanged();

View File

@ -31,6 +31,7 @@ namespace GUI {
class BrowserDialog; class BrowserDialog;
class ListWidget; class ListWidget;
class GraphicsWidget;
class LauncherDialog : public Dialog { class LauncherDialog : public Dialog {
typedef Common::String String; typedef Common::String String;
@ -46,6 +47,9 @@ protected:
Widget *_startButton; Widget *_startButton;
Widget *_editButton; Widget *_editButton;
Widget *_removeButton; Widget *_removeButton;
#ifndef DISABLE_FANCY_THEMES
GraphicsWidget *_logo;
#endif
StringList _domains; StringList _domains;
GameDetector &_detector; GameDetector &_detector;
BrowserDialog *_browser; BrowserDialog *_browser;