From 22ed653d8b630c813333d5c73a4ca02dede2a5a5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Sep 2012 22:12:03 +0300 Subject: Add theme attribute for close button padding. Attribute name: closePadding Default value: 3 pixels. --- src/gui/widgets/window.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/gui/widgets/window.cpp') diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index e08908c7a..2a417c633 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -187,12 +187,14 @@ void Window::draw(gcn::Graphics *graphics) static_cast(mCaptionAlign)); } + int closePadding = getOption("closePadding"); + // Draw Close Button if (mCloseButton && mSkin->getCloseImage()) { const Image *const button = mSkin->getCloseImage(); - const int x = getWidth() - button->getWidth() - getPadding(); - g->drawImage(button, x, getPadding()); + const int x = getWidth() - button->getWidth() - closePadding; + g->drawImage(button, x, closePadding); } // Draw Sticky Button @@ -201,11 +203,11 @@ void Window::draw(gcn::Graphics *graphics) const Image *const button = mSkin->getStickyImage(mSticky); if (button) { - int x = getWidth() - button->getWidth() - getPadding(); + int x = getWidth() - button->getWidth() - closePadding; if (mCloseButton && mSkin->getCloseImage()) - x -= mSkin->getCloseImage()->getWidth() + getPadding(); + x -= mSkin->getCloseImage()->getWidth() + closePadding; - g->drawImage(button, x, getPadding()); + g->drawImage(button, x, closePadding); } } -- cgit v1.2.3-60-g2f50