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:
Michael Gregorius
2018-07-09 17:16:40 +02:00
parent 0dc28436fa
commit 8dab817e13
3 changed files with 4 additions and 3 deletions

View File

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

View File

@@ -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;

View File

@@ -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);
}