summaryrefslogtreecommitdiff
path: root/src/gui/theme.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-10 23:09:21 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-10 23:59:22 +0300
commitee39f800bd1809b25cc7c05238e2fa7abccd8ab3 (patch)
treefce3f585f15a2f6f332130d92d8078b2d0ad0475 /src/gui/theme.cpp
parentdba5ec4c1f249599a5f718fe4e532c66e917ffa9 (diff)
downloadmv-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.cpp28
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)