summaryrefslogtreecommitdiffstats
path: root/qt-ui/modeldelegates.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@gmail.com>2015-07-20 21:25:10 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-20 21:43:20 -0700
commit8856753fafb9dc2a10e8da907b661f50a8c2ed27 (patch)
tree8da2663dd5be2868e7eaf49f21b56b78142999ec /qt-ui/modeldelegates.cpp
parente8d4bdff59e9750a237b6be3856ceed2c9abe43b (diff)
downloadsubsurface-8856753fafb9dc2a10e8da907b661f50a8c2ed27.tar.gz
Use correct colors on selection
I was wondering why the colors where wrong on mac, it took me a while to find the correct spot to fix. It seems that the Brush is not used to paint the fonts, but the Pen is. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/modeldelegates.cpp')
-rw-r--r--qt-ui/modeldelegates.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/modeldelegates.cpp b/qt-ui/modeldelegates.cpp
index 6253be021..a2dc7c0e8 100644
--- a/qt-ui/modeldelegates.cpp
+++ b/qt-ui/modeldelegates.cpp
@@ -558,6 +558,7 @@ print_part:
fontBigger.setPointSize(fontBigger.pointSize() + 1);
fontBigger.setBold(true);
+ QPen textPen = QPen(option.state & QStyle::State_Selected ? option.palette.brightText() : option.palette.text(), 1);
initStyleOption(&opt, index);
opt.text = QString();
@@ -566,13 +567,12 @@ print_part:
qApp->style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, NULL);
painter->save();
- painter->setBrush(option.palette.text());
+ painter->setPen(textPen);
painter->setFont(fontBigger);
painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height(), diveSiteName);
double pointSize = fontSmaller.pointSizeF();
fontSmaller.setPointSizeF(0.9 * pointSize);
painter->setFont(fontSmaller);
- painter->setBrush(option.palette.brightText());
painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height() * 2, bottomText);
painter->restore();