diff options
author | Gerald Combs <gerald@wireshark.org> | 2012-08-04 02:02:40 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2012-08-04 02:02:40 +0000 |
commit | 215d89c8900dbc41ef4b97252b52576dcf1850a7 (patch) | |
tree | 1b9b732fe38ddf4261ab95bc21adc84507031a7d /ui/qt/sparkline_delegate.cpp | |
parent | 1500f3bd4280e190fc5bbcc0e8e131560bd5b24c (diff) | |
download | wireshark-215d89c8900dbc41ef4b97252b52576dcf1850a7.tar.gz |
Draw selected items properly.
svn path=/trunk/; revision=44259
Diffstat (limited to 'ui/qt/sparkline_delegate.cpp')
-rw-r--r-- | ui/qt/sparkline_delegate.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ui/qt/sparkline_delegate.cpp b/ui/qt/sparkline_delegate.cpp index 178e8180c5..7047894c91 100644 --- a/ui/qt/sparkline_delegate.cpp +++ b/ui/qt/sparkline_delegate.cpp @@ -20,6 +20,8 @@ void SparkLineDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt qreal idx = 0.0; QVector<QPointF> fpoints; + QStyledItemDelegate::paint(painter, option, index); + if (!points || points->isEmpty() || content_w <= 0 || content_h <= 0) { return; } @@ -41,8 +43,13 @@ void SparkLineDelegate::paint(QPainter *painter, const QStyleOptionViewItem &opt painter->setRenderHint(QPainter::Antialiasing, true); painter->translate(option.rect.x() + SL_MARGIN, option.rect.y() + SL_MARGIN); - painter->setPen(Qt::ForegroundRole); - painter->setBrush(option.palette.foreground()); + // XXX Handle disabled + if (option.state & QStyle::State_Selected) { + painter->setPen(option.palette.color(QPalette::HighlightedText)); + qDebug() << "sel"; + } else { + painter->setPen(option.palette.color(QPalette::WindowText)); + } painter->drawPolyline(QPolygonF(fpoints)); // painter->setPen(Qt::NoPen); |