forked from qt-creator/qt-creator
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:
@@ -244,11 +244,14 @@ void ProgressBar::paintEvent(QPaintEvent *)
|
|||||||
// Draw separator
|
// Draw separator
|
||||||
int separatorHeight = m_separatorVisible ? SEPARATOR_HEIGHT : 0;
|
int separatorHeight = m_separatorVisible ? SEPARATOR_HEIGHT : 0;
|
||||||
if (m_separatorVisible) {
|
if (m_separatorVisible) {
|
||||||
|
QRectF innerRect = QRectF(this->rect()).adjusted(0.5, 0.5, -0.5, -0.5);
|
||||||
p.setPen(StyleHelper::sidebarShadow());
|
p.setPen(StyleHelper::sidebarShadow());
|
||||||
p.drawLine(0,0, size().width(), 0);
|
p.drawLine(innerRect.topLeft(), innerRect.topRight());
|
||||||
|
|
||||||
p.setPen(StyleHelper::sidebarHighlight());
|
if (creatorTheme()->flag(Theme::DrawToolBarHighlights)) {
|
||||||
p.drawLine(1, 1, size().width(), 1);
|
p.setPen(StyleHelper::sidebarHighlight());
|
||||||
|
p.drawLine(innerRect.topLeft() + QPointF(1, 1), innerRect.topRight() + QPointF(0, 1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_titleVisible) {
|
if (m_titleVisible) {
|
||||||
|
Reference in New Issue
Block a user