Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change the order in which the elements of the loop rectangle are drawn
Draw the inner fill first, then lines and bar numbers and finally draw the
outlines (inner and outer).
  • Loading branch information
michaelgregorius committed Jun 4, 2016
commit 20eb51c014f58c0aa1c78819a06d3563558d9a7a
23 changes: 13 additions & 10 deletions src/gui/TimeLineWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,9 @@ void TimeLineWidget::paintEvent( QPaintEvent * )

bool const loopPointsActive = loopPointsEnabled();

// Draw the main rectangle (outer border with inner fill)
p.setPen( loopPointsActive ? getActiveLoopColor() : getInactiveLoopColor() );
p.setBrush( loopPointsActive ? getActiveLoopBrush() : getInactiveLoopBrush() );
// Draw the main rectangle (inner fill only)
QRect outerRectangle( loopStart, loopRectMargin, loopRectWidth - 1, loopRectHeight - 1 );
p.drawRect( outerRectangle );

// Draw the inner border outline (no fill)
QRect innerRectangle = outerRectangle.adjusted( 1, 1, -1, -1 );
p.setPen( loopPointsActive ? getActiveLoopInnerColor() : getInactiveLoopInnerColor() );
p.setBrush(Qt::NoBrush);
p.drawRect( innerRectangle );
p.fillRect( outerRectangle, loopPointsActive ? getActiveLoopBrush() : getInactiveLoopBrush());

// Draw the bar lines and numbers
// Activate hinting on the font
Expand Down Expand Up @@ -273,6 +265,17 @@ void TimeLineWidget::paintEvent( QPaintEvent * )
p.drawText( cx + 5, ((height() - fontHeight) / 2) + fontAscent, s );
}
}

// Draw the main rectangle (outer border)
p.setPen( loopPointsActive ? getActiveLoopColor() : getInactiveLoopColor() );
p.setBrush( Qt::NoBrush );
p.drawRect( outerRectangle );

// Draw the inner border outline (no fill)
QRect innerRectangle = outerRectangle.adjusted( 1, 1, -1, -1 );
p.setPen( loopPointsActive ? getActiveLoopInnerColor() : getInactiveLoopInnerColor() );
p.setBrush(Qt::NoBrush);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add spaces in the parentheses here, so its consistent with the rest of the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with commit 83fffcc.

p.drawRect( innerRectangle );
}


Expand Down