summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-02 01:00:19 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-02 01:00:19 +0300
commitdc7431273d948d298976fc54dfba04dc9607917b (patch)
treef2ebef6567cc2ce07ae567de6602a3e6ffc3e53d /src
parent209fdbeaf69176fdab23604e820a73103e66776d (diff)
downloadmanaverse-dc7431273d948d298976fc54dfba04dc9607917b.tar.gz
manaverse-dc7431273d948d298976fc54dfba04dc9607917b.tar.bz2
manaverse-dc7431273d948d298976fc54dfba04dc9607917b.tar.xz
manaverse-dc7431273d948d298976fc54dfba04dc9607917b.zip
add new theme option for adjusting titlebar height.
New theme option: titlebarHeightRelative Default value: 0 Because titlebar height can be calculated from font height. It can be changed by this option.
Diffstat (limited to 'src')
-rw-r--r--src/gui/theme.cpp7
-rw-r--r--src/gui/widgets/window.cpp1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 860174efb..05d0f75ab 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -506,6 +506,7 @@ Skin *Theme::readSkin(const std::string &filename, const bool full)
int padding = 3;
int titlePadding = 4;
int titlebarHeight = 0;
+ int titlebarHeightRelative = 0;
int closePadding = 3;
int stickySpacing = 3;
int stickyPadding = 3;
@@ -579,6 +580,11 @@ Skin *Theme::readSkin(const std::string &filename, const bool full)
titlebarHeight = XML::getProperty(
partNode, "value", 0);
}
+ else if (name == "titlebarHeightRelative")
+ {
+ titlebarHeightRelative = XML::getProperty(
+ partNode, "value", 0);
+ }
else if (name == "resizePadding")
{
resizePadding = XML::getProperty(
@@ -606,6 +612,7 @@ Skin *Theme::readSkin(const std::string &filename, const bool full)
(*mOptions)["stickyPadding"] = stickyPadding;
(*mOptions)["stickySpacing"] = stickySpacing;
(*mOptions)["titlebarHeight"] = titlebarHeight;
+ (*mOptions)["titlebarHeightRelative"] = titlebarHeightRelative;
(*mOptions)["resizePadding"] = resizePadding;
Skin *const skin = new Skin(border, images, filename, "", padding,
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index ad8014ee8..1b9b955f0 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -134,6 +134,7 @@ Window::Window(const std::string &caption, const bool modal,
if (!mTitleBarHeight)
mTitleBarHeight = mCaptionFont->getHeight();
+ mTitleBarHeight += getOption("titlebarHeightRelative");
setPalette(getOption("palette"));
childPalette = getOption("childPalette");
}