mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
e8d4bdff59
commit
8856753faf
1 changed files with 2 additions and 2 deletions
|
@ -558,6 +558,7 @@ print_part:
|
||||||
|
|
||||||
fontBigger.setPointSize(fontBigger.pointSize() + 1);
|
fontBigger.setPointSize(fontBigger.pointSize() + 1);
|
||||||
fontBigger.setBold(true);
|
fontBigger.setBold(true);
|
||||||
|
QPen textPen = QPen(option.state & QStyle::State_Selected ? option.palette.brightText() : option.palette.text(), 1);
|
||||||
|
|
||||||
initStyleOption(&opt, index);
|
initStyleOption(&opt, index);
|
||||||
opt.text = QString();
|
opt.text = QString();
|
||||||
|
@ -566,13 +567,12 @@ print_part:
|
||||||
qApp->style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, NULL);
|
qApp->style()->drawControl(QStyle::CE_ItemViewItem, &opt, painter, NULL);
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
painter->setBrush(option.palette.text());
|
painter->setPen(textPen);
|
||||||
painter->setFont(fontBigger);
|
painter->setFont(fontBigger);
|
||||||
painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height(), diveSiteName);
|
painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height(), diveSiteName);
|
||||||
double pointSize = fontSmaller.pointSizeF();
|
double pointSize = fontSmaller.pointSizeF();
|
||||||
fontSmaller.setPointSizeF(0.9 * pointSize);
|
fontSmaller.setPointSizeF(0.9 * pointSize);
|
||||||
painter->setFont(fontSmaller);
|
painter->setFont(fontSmaller);
|
||||||
painter->setBrush(option.palette.brightText());
|
|
||||||
painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height() * 2, bottomText);
|
painter->drawText(option.rect.x(),option.rect.y() + fmBigger.boundingRect("YH").height() * 2, bottomText);
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue