From e5685035dac2018ca1cbe9fb47560abc7f944d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 4 Jan 2019 19:21:05 +0100 Subject: [PATCH] Improved look&feel in dark styles --- src/GUI/axisitem.cpp | 5 +++-- src/GUI/graphview.cpp | 1 - src/GUI/sliderinfoitem.cpp | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/GUI/axisitem.cpp b/src/GUI/axisitem.cpp index 49d56409..e3a591e7 100644 --- a/src/GUI/axisitem.cpp +++ b/src/GUI/axisitem.cpp @@ -111,10 +111,11 @@ void AxisItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QFontMetrics fm(_font); QRect ts; - painter->setRenderHint(QPainter::Antialiasing, false); painter->setFont(_font); - painter->setPen(QPen(Qt::black, AXIS_WIDTH)); + QPen pen(painter->pen()); + pen.setWidth(AXIS_WIDTH); + painter->setPen(pen); if (_type == X) { painter->drawLine(0, 0, _size, 0); diff --git a/src/GUI/graphview.cpp b/src/GUI/graphview.cpp index 00e85e96..20c2801c 100644 --- a/src/GUI/graphview.cpp +++ b/src/GUI/graphview.cpp @@ -27,7 +27,6 @@ GraphView::GraphView(QWidget *parent) _scene = new QGraphicsScene(this); setScene(_scene); - setBackgroundBrush(QBrush(Qt::white)); setViewportUpdateMode(QGraphicsView::FullViewportUpdate); setRenderHint(QPainter::Antialiasing, true); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); diff --git a/src/GUI/sliderinfoitem.cpp b/src/GUI/sliderinfoitem.cpp index 53f19d4c..db1ff275 100644 --- a/src/GUI/sliderinfoitem.cpp +++ b/src/GUI/sliderinfoitem.cpp @@ -49,7 +49,9 @@ void SliderInfoItem::paint(QPainter *painter, const QStyleOptionGraphicsItem } painter->setPen(Qt::NoPen); - painter->setBrush(QBrush(QColor(255, 255, 255, 196))); + QColor bc(painter->background().color()); + bc.setAlpha(196); + painter->setBrush(QBrush(bc)); painter->drawRect(ry); painter->drawRect(rx); painter->setBrush(Qt::NoBrush);