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 <alessandro.portale@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-04-03 20:23:11 +02:00
parent 3e1c7f6fd5
commit 57d01156ed

View File

@@ -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) {