summaryrefslogtreecommitdiff
path: root/src/gui/theme.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-05-08 01:03:20 +0300
committerAndrei Karas <akaras@inbox.ru>2012-05-08 01:03:20 +0300
commitbfab477aead2b4376e9caa193dca2c62c2ff26f9 (patch)
treee0fe0fb39d0ad476d7109ecafb452de05c0a1566 /src/gui/theme.cpp
parent9e65d853ef4cbebb9899dabe0233ad83a0b9e97a (diff)
downloadManaVerse-bfab477aead2b4376e9caa193dca2c62c2ff26f9.tar.gz
ManaVerse-bfab477aead2b4376e9caa193dca2c62c2ff26f9.tar.bz2
ManaVerse-bfab477aead2b4376e9caa193dca2c62c2ff26f9.tar.xz
ManaVerse-bfab477aead2b4376e9caa193dca2c62c2ff26f9.zip
Add titlepadding option to theme file.
Now used only in shortcuts window without title bar.
Diffstat (limited to 'src/gui/theme.cpp')
-rw-r--r--src/gui/theme.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 4112a702f..311863f41 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -65,7 +65,7 @@ static void initDefaultThemePath()
Skin::Skin(ImageRect skin, Image *close, Image *stickyUp, Image *stickyDown,
const std::string &filePath,
- const std::string &name, int padding):
+ const std::string &name, int padding, int titlePadding):
instances(0),
mFilePath(filePath),
mName(name),
@@ -73,8 +73,10 @@ Skin::Skin(ImageRect skin, Image *close, Image *stickyUp, Image *stickyDown,
mCloseImage(close),
mStickyImageUp(stickyUp),
mStickyImageDown(stickyDown),
- mPadding(padding)
-{}
+ mPadding(padding),
+ mTitlePadding(titlePadding)
+{
+}
Skin::~Skin()
{
@@ -337,6 +339,7 @@ Skin *Theme::readSkin(const std::string &filename)
ImageRect border;
memset(&border, 0, sizeof(ImageRect));
int padding = 3;
+ int titlePadding = 4;
// iterate <widget>'s
for_each_xml_child_node(widgetNode, rootNode)
@@ -485,6 +488,8 @@ Skin *Theme::readSkin(const std::string &filename)
partNode, "name", "");
if (name == "padding")
padding = XML::getProperty(partNode, "value", 3);
+ else if (name == "titlePadding")
+ titlePadding = XML::getProperty(partNode, "value", 4);
}
}
}
@@ -514,7 +519,7 @@ Skin *Theme::readSkin(const std::string &filename)
}
Skin *skin = new Skin(border, closeImage, stickyImageUp, stickyImageDown,
- filename, "", padding);
+ filename, "", padding, titlePadding);
skin->updateAlpha(mMinimumOpacity);
return skin;
}