summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2010-06-16 15:23:34 (GMT)
committerSimon Hausmann <simon.hausmann@nokia.com>2010-06-16 15:23:34 (GMT)
commit0b9638476c1a8bad4e33cbd20be1f6ff33935766 (patch)
tree968c6927ef9cda975f1065c41d93882231383588 /src/gui/styles
parent8cb10f381af7fd6f1fa0ffc946f6a4e6ba106d5d (diff)
parentc9a89b253176547901e11d27c042983a65f43b1f (diff)
downloadQt-0b9638476c1a8bad4e33cbd20be1f6ff33935766.zip
Qt-0b9638476c1a8bad4e33cbd20be1f6ff33935766.tar.gz
Qt-0b9638476c1a8bad4e33cbd20be1f6ff33935766.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt into qt-4.7-from-4.6
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qcommonstyle.cpp4
-rw-r--r--src/gui/styles/qgtkstyle.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/styles/qcommonstyle.cpp b/src/gui/styles/qcommonstyle.cpp
index 4978565..039a6da 100644
--- a/src/gui/styles/qcommonstyle.cpp
+++ b/src/gui/styles/qcommonstyle.cpp
@@ -762,7 +762,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
#ifndef QT_NO_ITEMVIEWS
case PE_PanelItemViewRow:
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
- QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled
+ QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled))
? QPalette::Normal : QPalette::Disabled;
if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active))
cg = QPalette::Inactive;
@@ -775,7 +775,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
break;
case PE_PanelItemViewItem:
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) {
- QPalette::ColorGroup cg = vopt->state & QStyle::State_Enabled
+ QPalette::ColorGroup cg = (widget ? widget->isEnabled() : (vopt->state & QStyle::State_Enabled))
? QPalette::Normal : QPalette::Disabled;
if (cg == QPalette::Normal && !(vopt->state & QStyle::State_Active))
cg = QPalette::Inactive;
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);