summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qgtkstyle.cpp
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2010-06-07 10:33:27 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2010-06-07 10:36:05 (GMT)
commit91fa2c1beb79124db4a70a37e2224c1de9b9ded4 (patch)
treea10b292fa3fee1c5c1398594ce4242fc9ec7ca99 /src/gui/styles/qgtkstyle.cpp
parent8a4d4c1f0d3761cbf46cf0fee076647ec4a6ac5a (diff)
downloadQt-91fa2c1beb79124db4a70a37e2224c1de9b9ded4.zip
Qt-91fa2c1beb79124db4a70a37e2224c1de9b9ded4.tar.gz
Qt-91fa2c1beb79124db4a70a37e2224c1de9b9ded4.tar.bz2
Disabled item view items use incorrect background color
This was a problem when using alternate row colors. We use a separate palette for base/alternate when using disabled colors. However, we should only use this if the entire view is disabled. To keep compatibility with style sheets we have to preserve the disabled state per item, but we now use the widget pointer to decide which palette role to use. Task-number: QTBUG-11263 Reviewed-by: ogoffart
Diffstat (limited to 'src/gui/styles/qgtkstyle.cpp')
-rw-r--r--src/gui/styles/qgtkstyle.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/styles/qgtkstyle.cpp b/src/gui/styles/qgtkstyle.cpp
index b59a033..c989bd3 100644
--- a/src/gui/styles/qgtkstyle.cpp
+++ b/src/gui/styles/qgtkstyle.cpp
@@ -855,9 +855,10 @@ void QGtkStyle::drawPrimitive(PrimitiveElement element,
key = QLS("a");
GTK_WIDGET_SET_FLAGS(gtkTreeView, GTK_HAS_FOCUS);
}
+ bool isEnabled = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled));
gtkPainter.paintFlatBox(gtkTreeView, detail, option->rect,
option->state & State_Selected ? GTK_STATE_SELECTED :
- option->state & State_Enabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
+ isEnabled ? GTK_STATE_NORMAL : GTK_STATE_INSENSITIVE,
GTK_SHADOW_OUT, gtkTreeView->style, key);
if (isActive )
GTK_WIDGET_UNSET_FLAGS(gtkTreeView, GTK_HAS_FOCUS);