From 57d01156ed9170959e93b157b9e076ed48dc4121 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Sun, 3 Apr 2016 20:23:11 +0200 Subject: [PATCH] ProgressBar: Conditional highlight and HighDPI fix This change makes drawing of the highlight above each progress bar depend on the current Theme::DrawToolBarHighlights flag. Also some off-by-ones issues in HighDPI are fixed. Change-Id: I80bb21d001784a8622fff795f3751d7b1697ddf1 Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/progressmanager/progressbar.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/coreplugin/progressmanager/progressbar.cpp b/src/plugins/coreplugin/progressmanager/progressbar.cpp index a1c3fcbd919..13481968939 100644 --- a/src/plugins/coreplugin/progressmanager/progressbar.cpp +++ b/src/plugins/coreplugin/progressmanager/progressbar.cpp @@ -244,11 +244,14 @@ void ProgressBar::paintEvent(QPaintEvent *) // Draw separator int separatorHeight = m_separatorVisible ? SEPARATOR_HEIGHT : 0; if (m_separatorVisible) { + QRectF innerRect = QRectF(this->rect()).adjusted(0.5, 0.5, -0.5, -0.5); p.setPen(StyleHelper::sidebarShadow()); - p.drawLine(0,0, size().width(), 0); + p.drawLine(innerRect.topLeft(), innerRect.topRight()); - p.setPen(StyleHelper::sidebarHighlight()); - p.drawLine(1, 1, size().width(), 1); + if (creatorTheme()->flag(Theme::DrawToolBarHighlights)) { + p.setPen(StyleHelper::sidebarHighlight()); + p.drawLine(innerRect.topLeft() + QPointF(1, 1), innerRect.topRight() + QPointF(0, 1)); + } } if (m_titleVisible) {