diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-09-06 23:12:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-09-06 23:12:03 +0300 |
commit | 3aead4aa07f2b28c5a4d567d6ab53783a9de5556 (patch) | |
tree | 14d8771a03104fe629f0d81d8bd2a199af04f17c /src/gui/widgets | |
parent | 4ad3cd45f7a8c3f6d1817705c06223d1a2798a2f (diff) | |
download | manaplus-3aead4aa07f2b28c5a4d567d6ab53783a9de5556.tar.gz manaplus-3aead4aa07f2b28c5a4d567d6ab53783a9de5556.tar.bz2 manaplus-3aead4aa07f2b28c5a4d567d6ab53783a9de5556.tar.xz manaplus-3aead4aa07f2b28c5a4d567d6ab53783a9de5556.zip |
Add theme option for title bar height.
Option name: titlebarHeight
Default value: 20 px
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/window.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/window.h | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 2a417c633..58247870f 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -68,6 +68,7 @@ Window::Window(const std::string &caption, const bool modal, mCaptionOffsetX(7), mCaptionOffsetY(5), mCaptionAlign(gcn::Graphics::LEFT), + mTitlePadding(4), mRedraw(true) { logger->log("Window::Window(\"%s\")", caption.c_str()); @@ -91,6 +92,8 @@ Window::Window(const std::string &caption, const bool modal, if (mSkin) { setPadding(mSkin->getPadding()); + setTitlePadding(mSkin->getTitlePadding()); + setTitleBarHeight(getOption("titlebarHeight")); mCaptionOffsetX = getOption("captionoffsetx"); if (!mCaptionOffsetX) mCaptionOffsetX = 7; @@ -1064,10 +1067,3 @@ bool Window::getOptionBool(std::string name) return mSkin->getOption(name) != 0; return 0; } - -int Window::getTitlePadding() const -{ - if (mSkin) - mSkin->getTitlePadding(); - return 4; -} diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 2c6c0ab8e..9cc6acc54 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -408,7 +408,11 @@ class Window : public gcn::Window, private gcn::WidgetListener bool getOptionBool(std::string name); - int getTitlePadding() const; + void setTitlePadding(int p) + { mTitlePadding = p; } + + int getTitlePadding() const + { return mTitlePadding; } Skin *mSkin; /**< Skin in use by this window */ @@ -472,6 +476,7 @@ class Window : public gcn::Window, private gcn::WidgetListener int mCaptionOffsetX; int mCaptionOffsetY; int mCaptionAlign; + int mTitlePadding; bool mRedraw; gcn::Font *mCaptionFont; }; |