aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-08-14 18:36:50 +0000
committerGerald Combs <gerald@wireshark.org>2012-08-14 18:36:50 +0000
commitac909fa890b271a5ac2e39a55f2eab2849bb09de (patch)
tree43a263f561a9c231a885358b1bb36c74f6fb986d /ui/qt
parentc3f223d3566d1c62a65023662aa4cf9c36a1b49b (diff)
Only apply the QWindowsVistaStyle hack when it's the current style.
svn path=/trunk/; revision=44499
Diffstat (limited to 'ui/qt')
-rw-r--r--ui/qt/sparkline_delegate.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/ui/qt/sparkline_delegate.cpp b/ui/qt/sparkline_delegate.cpp
index 2c725d6b39..7c126787b9 100644
--- a/ui/qt/sparkline_delegate.cpp
+++ b/ui/qt/sparkline_delegate.cpp
@@ -24,8 +24,7 @@
#include "sparkline_delegate.h"
#include <QPainter>
-
-#include <QDebug>
+#include <QApplication>
#define MIN_WIDTH 10
@@ -67,11 +66,11 @@ void SparkLineDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt
painter->save();
-#ifdef Q_WS_WIN
- // QWindowsVistaStyle::drawControl does this internally. Unfortunately there
- // doesn't appear to be a way to do this dynamically.
- optv4.palette.setColor(QPalette::All, QPalette::HighlightedText, optv4.palette.color(QPalette::Active, QPalette::Text));
-#endif
+ if (QApplication::style()->objectName().contains("vista")) {
+ // QWindowsVistaStyle::drawControl does this internally. Unfortunately there
+ // doesn't appear to be a more general way to do this.
+ optv4.palette.setColor(QPalette::All, QPalette::HighlightedText, optv4.palette.color(QPalette::Active, QPalette::Text));
+ }
QPalette::ColorGroup cg = optv4.state & QStyle::State_Enabled
? QPalette::Normal : QPalette::Disabled;