From 35efb9eba3a198b1dd2959434e82c8da45af689e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 20 Oct 2012 03:22:32 +0300 Subject: Add load theme id for windows and popups. New theme options: palette - palette number for window or popup. childPalette - palette number for window child controls. palette and childPalette should be from 0 to 4. --- src/gui/widgets/window.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/gui/widgets/window.cpp') diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index fa673e420..ae47cb001 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -98,6 +98,7 @@ Window::Window(const std::string &caption, const bool modal, if (skin == "") skin = "window.xml"; + int childPalette = 1; // Loads the skin if (Theme::instance()) { @@ -122,6 +123,8 @@ Window::Window(const std::string &caption, const bool modal, { mCaptionAlign = gcn::Graphics::LEFT; } + setPalette(getOption("palette")); + childPalette = getOption("childPalette"); } } @@ -140,6 +143,9 @@ Window::Window(const std::string &caption, const bool modal, addWidgetListener(this); mForegroundColor = getThemeColor(Theme::WINDOW); + logger->log("window palettes: %d, %d", mPalette, childPalette); + if (childPalette != mPalette) + setPalette(childPalette); } Window::~Window() -- cgit v1.2.3-60-g2f50