Implement changes from a code review
Use tabs in the style sheets. Make the calculation of the Y offset more concise.
This commit is contained in:
@@ -123,7 +123,7 @@ PianoRoll {
|
||||
qproperty-backgroundShade: rgba( 255, 255, 255, 10 );
|
||||
qproperty-noteModeColor: rgb( 255, 255, 255 );
|
||||
qproperty-noteColor: rgb( 119, 199, 216 );
|
||||
qproperty-noteTextColor: rgb( 255, 255, 255 );
|
||||
qproperty-noteTextColor: rgb( 255, 255, 255 );
|
||||
qproperty-noteOpacity: 128;
|
||||
qproperty-noteBorders: true; /* boolean property, set false to have borderless notes */
|
||||
qproperty-selectedNoteColor: rgb( 0, 125, 255 );
|
||||
|
||||
@@ -142,7 +142,7 @@ PianoRoll {
|
||||
qproperty-backgroundShade: rgba(255, 255, 255, 10);
|
||||
qproperty-noteModeColor: #0bd556;
|
||||
qproperty-noteColor: #0bd556;
|
||||
qproperty-noteTextColor: #ffffff;
|
||||
qproperty-noteTextColor: #ffffff;
|
||||
qproperty-noteOpacity: 165;
|
||||
qproperty-noteBorders: false; /* boolean property, set false to have borderless notes */
|
||||
qproperty-selectedNoteColor: #064d79;
|
||||
|
||||
@@ -894,12 +894,13 @@ void PianoRoll::drawNoteRect( QPainter & p, int x, int y,
|
||||
|
||||
int const distanceToBorder = 2;
|
||||
int const xOffset = borderWidth + distanceToBorder;
|
||||
int const yOffset = (noteHeight + noteTextHeight) / 2;
|
||||
|
||||
if (textSize.width() < noteWidth - xOffset)
|
||||
{
|
||||
p.setPen(noteTextColor);
|
||||
p.setFont(noteFont);
|
||||
QPoint textStart(x + xOffset, y + (noteTextHeight + (noteHeight - noteTextHeight) / 2));
|
||||
QPoint textStart(x + xOffset, y + yOffset);
|
||||
|
||||
p.drawText(textStart, noteKeyString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user