From e4876723a4ed506b641db9df9f5e00155c9be378 Mon Sep 17 00:00:00 2001 From: Jens Bache-Wiig Date: Tue, 27 Jan 2009 10:09:37 +0100 Subject: [PATCH] Fixes: Use alternate row colors for sidebar Task: As discussed with b_lindeijer Details: This enables alternate row colors, with filled empty area on the side bar for improved usability. --- src/plugins/coreplugin/manhattanstyle.cpp | 13 +++++++++---- src/plugins/projectexplorer/projecttreewidget.cpp | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/plugins/coreplugin/manhattanstyle.cpp b/src/plugins/coreplugin/manhattanstyle.cpp index 47e13dec297..af361aacbb9 100644 --- a/src/plugins/coreplugin/manhattanstyle.cpp +++ b/src/plugins/coreplugin/manhattanstyle.cpp @@ -388,15 +388,20 @@ QPixmap ManhattanStyle::standardPixmap(StandardPixmap standardPixmap, const QSty int ManhattanStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const { - int ret = 0; + int ret = d->style->styleHint(hint, option, widget, returnData); switch (hint) { + // Make project explorer alternate rows all the way + case QStyle::SH_ItemView_PaintAlternatingRowColorsForEmptyArea: + if (widget && widget->property("AlternateEmpty").toBool()) + ret = true; + break; case QStyle::SH_EtchDisabledText: - ret = false; // We really should only enforce this for panel widgets + if (panelWidget(widget)) + ret = false; break; default: - ret = d->style->styleHint(hint, option, widget, returnData); + break; } - return ret; } diff --git a/src/plugins/projectexplorer/projecttreewidget.cpp b/src/plugins/projectexplorer/projecttreewidget.cpp index 3329f80788a..f08885ab6b9 100644 --- a/src/plugins/projectexplorer/projecttreewidget.cpp +++ b/src/plugins/projectexplorer/projecttreewidget.cpp @@ -73,6 +73,8 @@ public: setContextMenuPolicy(Qt::CustomContextMenu); setUniformRowHeights(true); setTextElideMode(Qt::ElideNone); + setAlternatingRowColors(true); + setProperty("AlternateEmpty", true); // Let Manhattan to override style default // setExpandsOnDoubleClick(false); }