summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-05-01 23:13:02 +0300
committerAndrei Karas <akaras@inbox.ru>2013-05-02 00:55:47 +0300
commit209fdbeaf69176fdab23604e820a73103e66776d (patch)
tree70cb2c329035dcca2024c632b17620e823d50076 /src
parent721e1aa49134fb55241728528256b8662a5bb160 (diff)
downloadmv-209fdbeaf69176fdab23604e820a73103e66776d.tar.gz
mv-209fdbeaf69176fdab23604e820a73103e66776d.tar.bz2
mv-209fdbeaf69176fdab23604e820a73103e66776d.tar.xz
mv-209fdbeaf69176fdab23604e820a73103e66776d.zip
Fix tilebar padding with different font sizes.
Fix paddings in outfits window.
Diffstat (limited to 'src')
-rw-r--r--src/gui/outfitwindow.cpp5
-rw-r--r--src/gui/theme.cpp4
-rw-r--r--src/gui/widgets/window.cpp7
3 files changed, 10 insertions, 6 deletions
diff --git a/src/gui/outfitwindow.cpp b/src/gui/outfitwindow.cpp
index 809b99b37..f43f1ba54 100644
--- a/src/gui/outfitwindow.cpp
+++ b/src/gui/outfitwindow.cpp
@@ -313,8 +313,9 @@ void OutfitWindow::draw(gcn::Graphics *graphics)
for (unsigned int i = 0; i < OUTFIT_ITEM_COUNT; i++)
{
- const int itemX = 10 + ((i % mGridWidth) * mBoxWidth);
- const int itemY = 25 + ((i / mGridWidth) * mBoxHeight);
+ const int itemX = mPadding + ((i % mGridWidth) * mBoxWidth);
+ const int itemY = mPadding + getTitleBarHeight()
+ + ((i / mGridWidth) * mBoxHeight);
graphics->setColor(mBorderColor);
graphics->drawRectangle(gcn::Rectangle(itemX, itemY, 32, 32));
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index 565391ed9..860174efb 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -505,7 +505,7 @@ Skin *Theme::readSkin(const std::string &filename, const bool full)
memset(images, 0, sizeof(ImageRect));
int padding = 3;
int titlePadding = 4;
- int titlebarHeight = 20;
+ int titlebarHeight = 0;
int closePadding = 3;
int stickySpacing = 3;
int stickyPadding = 3;
@@ -577,7 +577,7 @@ Skin *Theme::readSkin(const std::string &filename, const bool full)
else if (name == "titlebarHeight")
{
titlebarHeight = XML::getProperty(
- partNode, "value", 16);
+ partNode, "value", 0);
}
else if (name == "resizePadding")
{
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 0619a85a9..ad8014ee8 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -116,8 +116,7 @@ Window::Window(const std::string &caption, const bool modal,
setPadding(mSkin->getPadding());
if (getOptionBool("titlebarBold"))
mCaptionFont = reinterpret_cast<gcn::Font*>(boldFont);
- setTitlePadding(mSkin->getTitlePadding());
- setTitleBarHeight(getOption("titlebarHeight"));
+ mTitlePadding = mSkin->getTitlePadding();
mGripPadding = getOption("resizePadding");
mCaptionOffsetX = getOption("captionoffsetx");
if (!mCaptionOffsetX)
@@ -131,6 +130,10 @@ Window::Window(const std::string &caption, const bool modal,
{
mCaptionAlign = gcn::Graphics::LEFT;
}
+ setTitleBarHeight(getOption("titlebarHeight"));
+ if (!mTitleBarHeight)
+ mTitleBarHeight = mCaptionFont->getHeight();
+
setPalette(getOption("palette"));
childPalette = getOption("childPalette");
}