summaryrefslogtreecommitdiffstats
path: root/src/gui/styles/qwindowsvistastyle.cpp
diff options
context:
space:
mode:
authorJens Bache-Wiig <jbache@trolltech.com>2009-09-03 14:42:47 (GMT)
committerJens Bache-Wiig <jbache@trolltech.com>2009-09-09 13:14:18 (GMT)
commit0963768ba79b6304c27c9ea293c71824e77a64ef (patch)
treea749e7afb0c2fca96e19d35e98491724af04c446 /src/gui/styles/qwindowsvistastyle.cpp
parent7c33e0f95789af1f6c091db89581f8a26b10682d (diff)
downloadQt-0963768ba79b6304c27c9ea293c71824e77a64ef.zip
Qt-0963768ba79b6304c27c9ea293c71824e77a64ef.tar.gz
Qt-0963768ba79b6304c27c9ea293c71824e77a64ef.tar.bz2
Make itemviews use gradient selection on Vista by default
We postponed this in 4.3 when the vista style was introduced since a lot of microsoft apps still used the legacy style and microsoft did not enable it by default. It has been reported as bugs a few times and it seems increasingly odd that we are not using the more modern look and feel when we can. Instead of only enabling it for QTreeView, we now only disable it for QTableView as the look still cannot be used to span vertical cells. Task-number: QTBUG-3746 Reviewed-by: prasanth
Diffstat (limited to 'src/gui/styles/qwindowsvistastyle.cpp')
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index b062a3f..6cb8b40 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -731,14 +731,11 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt
{
const QStyleOptionViewItemV4 *vopt;
const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(widget);
- bool newStyle = false;
+ bool newStyle = true;
+
+ if (qobject_cast<const QTableView*>(widget))
+ newStyle = false;
- if (const QListView *listview = qobject_cast<const QListView *>(widget)) {
- if (listview->viewMode() == QListView::IconMode)
- newStyle = true;
- } else if (qobject_cast<const QTreeView *>(widget)) {
- newStyle = true;
- }
if (newStyle && view && (vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))) {
bool selected = vopt->state & QStyle::State_Selected;
bool hover = vopt->state & QStyle::State_MouseOver;
@@ -1496,14 +1493,11 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
{
const QStyleOptionViewItemV4 *vopt;
const QAbstractItemView *view = qobject_cast<const QAbstractItemView *>(widget);
- bool newStyle = false;
+ bool newStyle = true;
+
+ if (qobject_cast<const QTableView*>(widget))
+ newStyle = false;
- if (const QListView *listview = qobject_cast<const QListView *>(widget)) {
- if (listview->viewMode() == QListView::IconMode)
- newStyle = true;
- } else if (qobject_cast<const QTreeView *>(widget)) {
- newStyle = true;
- }
if (newStyle && view && (vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option))) {
/*
// We cannot currently get the correct selection color for "explorer style" views