From f1e681bed21e131864fe1e1c91679f7a56b06823 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 20 Mar 2013 14:45:13 +0100 Subject: [PATCH] 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 Change-Id: Iaddfcbd613122a9aed39e77ba05a26f94995f7d2 Reviewed-by: Andy Shaw Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qwindowsvistastyle.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 6f261ae3d50..f7d886b3bdd 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -537,16 +537,13 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt XPThemeData theme(widget, painter, QWindowsXPStylePrivate::EditTheme, 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 {