summaryrefslogtreecommitdiffstats
path: root/src/widgets/styles
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/styles')
-rw-r--r--src/widgets/styles/qwindowsvistastyle.cpp6
-rw-r--r--src/widgets/styles/qwindowsxpstyle.cpp4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp
index daa8ab12a9..b8ed82fee3 100644
--- a/src/widgets/styles/qwindowsvistastyle.cpp
+++ b/src/widgets/styles/qwindowsvistastyle.cpp
@@ -396,7 +396,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
case PE_IndicatorBranch:
{
- XPThemeData theme(0, painter, QWindowsXPStylePrivate::TreeViewTheme);
+ XPThemeData theme(widget, painter, QWindowsXPStylePrivate::TreeViewTheme);
static int decoration_size = 0;
if (d->initTreeViewTheming() && theme.isValid() && !decoration_size) {
XPThemeData themeSize = theme;
@@ -657,6 +657,8 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
newStyle = !qobject_cast<const QTableView*>(view);
selectionBehavior = view->selectionBehavior();
selectionMode = view->selectionMode();
+ } else if (!widget) {
+ newStyle = !QStyleHelper::hasAncestor(option->styleObject, QAccessible::MenuItem) ;
}
if (newStyle && (vopt = qstyleoption_cast<const QStyleOptionViewItem *>(option))) {
@@ -710,7 +712,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
state = LISS_HOT;
QPainter pixmapPainter(&pixmap);
- XPThemeData theme(0, &pixmapPainter,
+ XPThemeData theme(widget, &pixmapPainter,
QWindowsXPStylePrivate::TreeViewTheme,
LVP_LISTITEM, state, QRect(0, 0, sectionSize.width(), sectionSize.height()));
if (d->initTreeViewTheming() && theme.isValid()) {
diff --git a/src/widgets/styles/qwindowsxpstyle.cpp b/src/widgets/styles/qwindowsxpstyle.cpp
index 54271c5ce8..7776773b87 100644
--- a/src/widgets/styles/qwindowsxpstyle.cpp
+++ b/src/widgets/styles/qwindowsxpstyle.cpp
@@ -1224,7 +1224,7 @@ void QWindowsXPStyle::polish(QWidget *widget)
if (!d->hasInitColors) {
// Get text color for group box labels
COLORREF cref;
- XPThemeData theme(0, 0, QWindowsXPStylePrivate::ButtonTheme, 0, 0);
+ XPThemeData theme(widget, 0, QWindowsXPStylePrivate::ButtonTheme, 0, 0);
QWindowsXPStylePrivate::pGetThemeColor(theme.handle(), BP_GROUPBOX, GBS_NORMAL, TMT_TEXTCOLOR, &cref);
d->groupBoxTextColor = qRgb(GetRValue(cref), GetGValue(cref), GetBValue(cref));
QWindowsXPStylePrivate::pGetThemeColor(theme.handle(), BP_GROUPBOX, GBS_DISABLED, TMT_TEXTCOLOR, &cref);
@@ -1540,7 +1540,7 @@ case PE_Frame:
return;
themeNumber = QWindowsXPStylePrivate::ListViewTheme;
partId = LVP_LISTGROUP;
- XPThemeData theme(0, 0, themeNumber, partId, 0);
+ XPThemeData theme(widget, 0, themeNumber, partId, 0);
if (!(flags & State_Enabled))
stateId = ETS_DISABLED;