From 81ef309e09bef03beba5e04c525a2e8563530eb3 Mon Sep 17 00:00:00 2001 From: karliss Date: Wed, 4 Nov 2020 18:39:12 +0200 Subject: [PATCH] Remove duplicate aplication of scaling factor. (#2461) --- src/widgets/ColorThemeListView.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/widgets/ColorThemeListView.cpp b/src/widgets/ColorThemeListView.cpp index 6013fa4d..23499123 100644 --- a/src/widgets/ColorThemeListView.cpp +++ b/src/widgets/ColorThemeListView.cpp @@ -41,7 +41,7 @@ void ColorOptionDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const { - int margin = this->margin * qhelpers::devicePixelRatio(painter->device()); + int margin = this->margin; painter->save(); painter->setFont(option.font); painter->setRenderHint(QPainter::Antialiasing); @@ -140,7 +140,7 @@ void ColorOptionDelegate::paint(QPainter *painter, // Create chess-like pattern of black and white squares // and fill background of roundedColorRect with it if (currCO.color.alpha() < 255) { - const int c1 = static_cast(8 * qhelpers::devicePixelRatio(painter->device())); + const int c1 = static_cast(8); const int c2 = c1 / 2; QPixmap p(c1, c1); QPainter paint(&p); @@ -167,7 +167,7 @@ void ColorOptionDelegate::paint(QPainter *painter, QSize ColorOptionDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const { - qreal margin = this->margin * qhelpers::devicePixelRatio(option.widget); + qreal margin = this->margin; qreal fontHeight = option.fontMetrics.height(); qreal h = QPen().width(); h += fontHeight; // option name