Skip to content

Commit

Permalink
Note borders with a constant value / slimmer and shorter note handles
Browse files Browse the repository at this point in the history
The note borders are not tones down in relation to the volume anymore.
The handles on the right side of each note have been made slimmer and
shorter.
  • Loading branch information
michaelgregorius committed Aug 30, 2015
1 parent d30bc43 commit 6e05a6d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/gui/editors/PianoRoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -728,15 +728,13 @@ inline void PianoRoll::drawNoteRect(QPainter & p, int x, int y,
volVal * leftPercent );
QColor rcol = QColor::fromHsv( col.hue(), col.saturation(),
volVal * rightPercent );
col = QColor::fromHsv( col.hue(), col.saturation(), volVal );

QLinearGradient gradient( x, y, x+width,
y+KEY_LINE_HEIGHT );
QLinearGradient gradient( x, y, x+width, y+KEY_LINE_HEIGHT );
gradient.setColorAt( 0, lcol );
gradient.setColorAt( 1, rcol );
p.setBrush( gradient );
p.setPen( QColor::fromHsv( col.hue(), col.saturation(),
qMin<float>( 255, volVal*1.7f ) ) );

p.setPen( col );
p.setRenderHint(QPainter::Antialiasing);
p.drawRoundedRect( x, y, width, KEY_LINE_HEIGHT-1, 5, 2 );

Expand All @@ -745,13 +743,9 @@ inline void PianoRoll::drawNoteRect(QPainter & p, int x, int y,
p.setPen( noteCol.lighter( 200 ) );
if( width > 2 )
{
p.drawLine( x + width - 3, y + 2, x + width - 3,
y + KEY_LINE_HEIGHT - 4 );
p.drawLine( x + width - 3, y + 3, x + width - 3,
y + KEY_LINE_HEIGHT - 5 );
}
p.drawLine( x + width - 1, y + 2, x + width - 1,
y + KEY_LINE_HEIGHT - 4 );
p.drawLine( x + width - 2, y + 2, x + width - 2,
y + KEY_LINE_HEIGHT - 4 );
}


Expand Down

0 comments on commit 6e05a6d

Please sign in to comment.