From 14a748c87c6a0942733f2f5eaec1a8c860e74b8f Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Mon, 12 Mar 2018 18:50:27 +0100 Subject: [PATCH 1/5] Fix marked semitones in the piano roll --- data/themes/default/style.css | 2 +- src/gui/editors/PianoRoll.cpp | 32 +++++++++++++++----------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/data/themes/default/style.css b/data/themes/default/style.css index 8da7522fd91..4d6f40cce5d 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -146,7 +146,7 @@ PianoRoll { qproperty-noteBorders: false; /* boolean property, set false to have borderless notes */ qproperty-selectedNoteColor: #006b65; qproperty-barColor: #078f3a; - qproperty-markedSemitoneColor: #06170E; + qproperty-markedSemitoneColor: rgba(255, 255, 255, 20); /* Grid colors */ qproperty-lineColor: #292929; qproperty-beatLineColor: #2d6b45; diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 13b1dd4a704..089031c5f99 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -2633,23 +2633,6 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) int key = m_startKey; - // display note marks before drawing other lines - for( int i = 0; i < m_markedSemiTones.size(); i++ ) - { - const int key_num = m_markedSemiTones.at( i ); - const int y = keyAreaBottom() + 5 - - KEY_LINE_HEIGHT * ( key_num - m_startKey + 1 ); - - if( y > keyAreaBottom() ) - { - break; - } - - p.fillRect( WHITE_KEY_WIDTH + 1, y - KEY_LINE_HEIGHT / 2, width() - 10, KEY_LINE_HEIGHT, - markedSemitoneColor() ); - } - - // draw all white keys... for( int y = key_line_y + 1 + y_offset; y > PR_TOP_MARGIN; key_line_y -= KEY_LINE_HEIGHT, ++keys_processed ) @@ -2936,6 +2919,21 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) } } + // draw marked semitones after the grid + for( int i = 0; i < m_markedSemiTones.size(); i++ ) + { + const int key_num = m_markedSemiTones.at( i ); + const int y = keyAreaBottom() + 5 + - KEY_LINE_HEIGHT * ( key_num - m_startKey + 1 ); + + if( y > keyAreaBottom() ) + { + break; + } + + p.fillRect( WHITE_KEY_WIDTH + 1, y - KEY_LINE_HEIGHT / 2, width() - 10, KEY_LINE_HEIGHT + 1, + markedSemitoneColor() ); + } // following code draws all notes in visible area // and the note editing stuff (volume, panning, etc) From c4091609a6576eebcf744ed92283a15e99d16ea7 Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Mon, 12 Mar 2018 18:55:42 +0100 Subject: [PATCH 2/5] Don't draw in invalid patterns --- src/gui/editors/PianoRoll.cpp | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 089031c5f99..56b01588104 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -2896,7 +2896,6 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) } } - // Draw the vertical beat lines int ticksPerBeat = DefaultTicksPerTact / Engine::getSong()->getTimeSigModel().getDenominator(); @@ -2917,22 +2916,22 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) p.setPen( barLineColor() ); p.drawLine( x, PR_TOP_MARGIN, x, height() - PR_BOTTOM_MARGIN ); } - } - - // draw marked semitones after the grid - for( int i = 0; i < m_markedSemiTones.size(); i++ ) - { - const int key_num = m_markedSemiTones.at( i ); - const int y = keyAreaBottom() + 5 - - KEY_LINE_HEIGHT * ( key_num - m_startKey + 1 ); - if( y > keyAreaBottom() ) + // draw marked semitones after the grid + for( int i = 0; i < m_markedSemiTones.size(); i++ ) { - break; - } + const int key_num = m_markedSemiTones.at( i ); + const int y = keyAreaBottom() + 5 + - KEY_LINE_HEIGHT * ( key_num - m_startKey + 1 ); - p.fillRect( WHITE_KEY_WIDTH + 1, y - KEY_LINE_HEIGHT / 2, width() - 10, KEY_LINE_HEIGHT + 1, - markedSemitoneColor() ); + if( y > keyAreaBottom() ) + { + break; + } + + p.fillRect( WHITE_KEY_WIDTH + 1, y - KEY_LINE_HEIGHT / 2, width() - 10, KEY_LINE_HEIGHT + 1, + markedSemitoneColor() ); + } } // following code draws all notes in visible area From f5731ec3b7b437203bfe0f71acf109da7610723f Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Mon, 12 Mar 2018 20:53:33 +0100 Subject: [PATCH 3/5] update classic theme --- data/themes/classic/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index 21a3b15515e..faca633dee2 100644 --- a/data/themes/classic/style.css +++ b/data/themes/classic/style.css @@ -127,7 +127,7 @@ PianoRoll { qproperty-noteBorders: true; /* boolean property, set false to have borderless notes */ qproperty-selectedNoteColor: rgb( 0, 125, 255 ); qproperty-barColor: #4afd85; - qproperty-markedSemitoneColor: rgba( 40, 40, 40, 200 ); + qproperty-markedSemitoneColor: rgba( 255, 255, 255, 30 ); /* Grid colors */ qproperty-lineColor: rgba( 128, 128, 128, 80 ); qproperty-beatLineColor: rgba( 128, 128, 128, 160 ); From 54522cb7a59cbc75e1a11aee98915d0a0cf3ee35 Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Thu, 29 Mar 2018 14:58:33 +0200 Subject: [PATCH 4/5] Fix contrast --- data/themes/classic/style.css | 2 +- data/themes/default/style.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index faca633dee2..e4973610ddd 100644 --- a/data/themes/classic/style.css +++ b/data/themes/classic/style.css @@ -127,7 +127,7 @@ PianoRoll { qproperty-noteBorders: true; /* boolean property, set false to have borderless notes */ qproperty-selectedNoteColor: rgb( 0, 125, 255 ); qproperty-barColor: #4afd85; - qproperty-markedSemitoneColor: rgba( 255, 255, 255, 30 ); + qproperty-markedSemitoneColor: rgba( 0, 200, 160, 50 ); /* Grid colors */ qproperty-lineColor: rgba( 128, 128, 128, 80 ); qproperty-beatLineColor: rgba( 128, 128, 128, 160 ); diff --git a/data/themes/default/style.css b/data/themes/default/style.css index 4d6f40cce5d..b9abe0f3eae 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -146,7 +146,7 @@ PianoRoll { qproperty-noteBorders: false; /* boolean property, set false to have borderless notes */ qproperty-selectedNoteColor: #006b65; qproperty-barColor: #078f3a; - qproperty-markedSemitoneColor: rgba(255, 255, 255, 20); + qproperty-markedSemitoneColor: rgba(255, 255, 255, 30); /* Grid colors */ qproperty-lineColor: #292929; qproperty-beatLineColor: #2d6b45; From 2d83f6d45e176f49c3532e10ae6963bbfbe2fa9e Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Mon, 2 Apr 2018 18:07:01 +0200 Subject: [PATCH 5/5] update classic theme --- data/themes/classic/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index e4973610ddd..55f82e4b3a2 100644 --- a/data/themes/classic/style.css +++ b/data/themes/classic/style.css @@ -127,7 +127,7 @@ PianoRoll { qproperty-noteBorders: true; /* boolean property, set false to have borderless notes */ qproperty-selectedNoteColor: rgb( 0, 125, 255 ); qproperty-barColor: #4afd85; - qproperty-markedSemitoneColor: rgba( 0, 200, 160, 50 ); + qproperty-markedSemitoneColor: rgba( 0, 255, 200, 60 ); /* Grid colors */ qproperty-lineColor: rgba( 128, 128, 128, 80 ); qproperty-beatLineColor: rgba( 128, 128, 128, 160 );