diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-10 23:09:21 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-10 23:59:22 +0300 |
commit | ee39f800bd1809b25cc7c05238e2fa7abccd8ab3 (patch) | |
tree | fce3f585f15a2f6f332130d92d8078b2d0ad0475 /src/gui/theme.cpp | |
parent | dba5ec4c1f249599a5f718fe4e532c66e917ffa9 (diff) | |
download | mv-ee39f800bd1809b25cc7c05238e2fa7abccd8ab3.tar.gz mv-ee39f800bd1809b25cc7c05238e2fa7abccd8ab3.tar.bz2 mv-ee39f800bd1809b25cc7c05238e2fa7abccd8ab3.tar.xz mv-ee39f800bd1809b25cc7c05238e2fa7abccd8ab3.zip |
Allow load for each window own xml theme file.
Diffstat (limited to 'src/gui/theme.cpp')
-rw-r--r-- | src/gui/theme.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
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 @@ -216,6 +216,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 if (filename != defaultPath) @@ -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) |