diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2013-03-20 17:05:41 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-21 10:32:59 (GMT) |
commit | 9b0922e64152bd4cd06932df247a5f80e9d069cb (patch) | |
tree | d972223d22f15ae8ff8e9e55538209280eb4e366 /src/gui/styles | |
parent | e5356a5848d6f325e99e0b71ba68e0209c1a5448 (diff) | |
download | Qt-9b0922e64152bd4cd06932df247a5f80e9d069cb.zip Qt-9b0922e64152bd4cd06932df247a5f80e9d069cb.tar.gz Qt-9b0922e64152bd4cd06932df247a5f80e9d069cb.tar.bz2 |
QWindowsVistaStyle::drawPrimitive(PE_Frame): fix background clipping
The purpose of PE_Frame is to draw the frame, not the background. The
old code tried to check whether a custom base brush was set, and
otherwise let the theme draw the background. That didn't work together
with CSS background images. This change removes the background drawing
from PE_Frame, and let's PE_Widget to draw the background using the
base brush that defaults to a color fetched from the theme.
Task-number: QTBUG-24783
(cherry picked from qtbase/f1e681bed21e131864fe1e1c91679f7a56b06823)
Change-Id: Ief256d1d5861abc95dedf0b5d0a4f8e338c48941
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qwindowsvistastyle.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp index 5fe77f3..47cce9f 100644 --- a/src/gui/styles/qwindowsvistastyle.cpp +++ b/src/gui/styles/qwindowsvistastyle.cpp @@ -563,16 +563,13 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt else if (state & State_HasFocus) stateId = ETS_SELECTED; XPThemeData theme(widget, painter, QLatin1String("EDIT"), EP_EDITBORDER_HVSCROLL, stateId, option->rect); - uint resolve_mask = option->palette.resolve(); - if (resolve_mask & (1 << QPalette::Base)) { - // Since EP_EDITBORDER_HVSCROLL does not us borderfill, theme.noContent cannot be used for clipping - int borderSize = 1; - pGetThemeInt(theme.handle(), theme.partId, theme.stateId, TMT_BORDERSIZE, &borderSize); - QRegion clipRegion = option->rect; - QRegion content = option->rect.adjusted(borderSize, borderSize, -borderSize, -borderSize); - clipRegion ^= content; - painter->setClipRegion(clipRegion); - } + // Since EP_EDITBORDER_HVSCROLL does not us borderfill, theme.noContent cannot be used for clipping + int borderSize = 1; + pGetThemeInt(theme.handle(), theme.partId, theme.stateId, TMT_BORDERSIZE, &borderSize); + QRegion clipRegion = option->rect; + QRegion content = option->rect.adjusted(borderSize, borderSize, -borderSize, -borderSize); + clipRegion ^= content; + painter->setClipRegion(clipRegion); d->drawBackground(theme); painter->restore(); } else |