From ee39f800bd1809b25cc7c05238e2fa7abccd8ab3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 10 Sep 2011 23:09:21 +0300 Subject: Allow load for each window own xml theme file. --- src/gui/theme.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/gui/theme.cpp') diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 0607564f9..12e7736c0 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -215,6 +215,9 @@ Skin *Theme::load(const std::string &filename, const std::string &defaultPath) Skin *skin = readSkin(filename); + if (!skin) + skin = readSkin("window.xml"); + if (!skin) { // Try falling back on the defaultPath if this makes sense @@ -240,6 +243,31 @@ Skin *Theme::load(const std::string &filename, const std::string &defaultPath) return skin; } +void Theme::unload(Skin *skin) +{ + if (!skin) + return; + skin->instances --; +/* + // unload theme if no instances + if (!skin->instances) + { + SkinIterator it = mSkins.begin(); + SkinIterator it_end = mSkins.end(); + while (it != it_end) + { + if (it->second == skin) + { + mSkins.erase(it); + break; + } + ++ it; + } + delete skin; + } +*/ +} + void Theme::setMinimumOpacity(float minimumOpacity) { if (minimumOpacity > 1.0f) -- cgit v1.2.3-70-g09d2