diff options
Diffstat (limited to 'Source/WebCore/platform/qt/RenderThemeQStyle.cpp')
-rw-r--r-- | Source/WebCore/platform/qt/RenderThemeQStyle.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/Source/WebCore/platform/qt/RenderThemeQStyle.cpp b/Source/WebCore/platform/qt/RenderThemeQStyle.cpp index b9c6953fa..edc252d1d 100644 --- a/Source/WebCore/platform/qt/RenderThemeQStyle.cpp +++ b/Source/WebCore/platform/qt/RenderThemeQStyle.cpp @@ -191,21 +191,25 @@ template<typename T> static void inflateCheckBoxRectImpl(T& originalRect, const QRect& rect) { if (!rect.isNull()) { - int dx = static_cast<int>((rect.width() - originalRect.width()) / 2); - originalRect.setX(originalRect.x() - dx); - originalRect.setWidth(rect.width()); - int dy = static_cast<int>((rect.height() - originalRect.height()) / 2); - originalRect.setY(originalRect.y() - dy); - originalRect.setHeight(rect.height()); + if (rect.width() > originalRect.width()) { + int dx = static_cast<int>((rect.width() - originalRect.width()) / 2); + originalRect.setX(originalRect.x() - dx); + originalRect.setWidth(rect.width()); + } + if (rect.height() > originalRect.height()) { + int dy = static_cast<int>((rect.height() - originalRect.height()) / 2); + originalRect.setY(originalRect.y() - dy); + originalRect.setHeight(rect.height()); + } } } -void RenderThemeQStyle::computeControlRect(QStyleFacade::ButtonType part, QRect& originalRect) const +void RenderThemeQStyle::inflateControlRect(QStyleFacade::ButtonType part, QRect& originalRect) const { inflateCheckBoxRectImpl(originalRect, indicatorRect(part, originalRect)); } -void RenderThemeQStyle::computeControlRect(QStyleFacade::ButtonType part, FloatRect& originalRect) const +void RenderThemeQStyle::inflateControlRect(QStyleFacade::ButtonType part, FloatRect& originalRect) const { inflateCheckBoxRectImpl(originalRect, indicatorRect(part, enclosingIntRect(originalRect))); } @@ -365,10 +369,10 @@ bool RenderThemeQStyle::paintButton(const RenderObject& o, const PaintInfo& i, c p.styleOption.rect = inflateButtonRect(p.styleOption.rect); p.paintButton(QStyleFacade::PushButton); } else if (p.appearance == RadioPart) { - computeControlRect(QStyleFacade::RadioButton, p.styleOption.rect); + inflateControlRect(QStyleFacade::RadioButton, p.styleOption.rect); p.paintButton(QStyleFacade::RadioButton); } else if (p.appearance == CheckboxPart) { - computeControlRect(QStyleFacade::CheckBox, p.styleOption.rect); + inflateControlRect(QStyleFacade::CheckBox, p.styleOption.rect); p.paintButton(QStyleFacade::CheckBox); } |