summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/window.cpp15
-rw-r--r--src/gui/widgets/window.h3
2 files changed, 13 insertions, 5 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index c438b5475..cd526db98 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -138,6 +138,9 @@ Window::Window(const std::string &caption,
mGripPadding(2),
mResizeHandles(-1),
mOldResizeHandles(-1),
+ mClosePadding(0),
+ mStickySpacing(0),
+ mStickyPadding(0),
mCaptionFont(getFont()),
mModal(modal),
mShowTitle(true),
@@ -196,6 +199,9 @@ Window::Window(const std::string &caption,
setPalette(getOption("palette"));
childPalette = getOption("childPalette");
mShowTitle = getOptionBool("showTitle", true);
+ mClosePadding = getOption("closePadding");
+ mStickySpacing = getOption("stickySpacing");
+ mStickyPadding = getOption("stickyPadding");
}
}
@@ -570,13 +576,12 @@ void Window::widgetResized(const Event &event A_UNUSED)
{
const bool showClose = mCloseWindowButton
&& mSkin->getCloseImage(false);
- const int closePadding = getOption("closePadding");
if (showClose)
{
const Image *const button = mSkin->getCloseImage(false);
const int buttonWidth = button->getWidth();
- mCloseRect.x = mDimension.width - buttonWidth - closePadding;
- mCloseRect.y = closePadding;
+ mCloseRect.x = mDimension.width - buttonWidth - mClosePadding;
+ mCloseRect.y = mClosePadding;
mCloseRect.width = buttonWidth;
mCloseRect.height = button->getHeight();
}
@@ -587,13 +592,13 @@ void Window::widgetResized(const Event &event A_UNUSED)
{
const int buttonWidth = button->getWidth();
int x = mDimension.width - buttonWidth
- - getOption("stickySpacing") - closePadding;
+ - mStickySpacing - mClosePadding;
if (showClose)
x -= mSkin->getCloseImage(false)->getWidth();
mStickyRect.x = x;
- mStickyRect.y = getOption("stickyPadding");
+ mStickyRect.y = mStickyPadding;
mStickyRect.width = buttonWidth;
mStickyRect.height = button->getHeight();
}
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index 2b2bdb261..386b7e16b 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -692,6 +692,9 @@ class Window notfinal : public BasicContainer2,
int mGripPadding;
int mResizeHandles;
int mOldResizeHandles;
+ int mClosePadding;
+ int mStickySpacing;
+ int mStickyPadding;
Font *mCaptionFont;
Modal mModal; /**< Window is modal */
bool mShowTitle; /**< Window has a title bar */