From 27eaa4d512ad5a62d1a0f41fd6132105571da628 Mon Sep 17 00:00:00 2001 From: Umcaruje Date: Fri, 3 Jun 2016 12:21:27 +0200 Subject: [PATCH] Make scrollbars consistent over the software; Add padding to the scrollbars; Make the PianoView background themeable (#2807) * Make scrollbars consistent over the software; Add padding to the scrollbars; Make the PianoView background themeable * Make the scrollbar hover color brighter --- data/themes/default/style.css | 28 +++++++++++++++++++++------- include/AutomationEditor.h | 2 +- src/gui/PianoView.cpp | 23 ++++++++--------------- src/gui/editors/PianoRoll.cpp | 2 +- src/tracks/InstrumentTrack.cpp | 2 +- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/data/themes/default/style.css b/data/themes/default/style.css index cceb08557..6c0b9fca6 100755 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -140,15 +140,15 @@ CPULoadWidget { /* scrollbar: trough */ QScrollBar:horizontal { - border: none; + border-top: 3px solid #262b30; background: #262b30; - height: 9px; + height: 12px; margin: 0px 12px; } QScrollBar:vertical { - border: none; + border-left: 3px solid #262b30; background: #262b30; - width: 9px; + width: 12px; margin: 12px 0px; } @@ -174,7 +174,7 @@ QScrollBar::handle:horizontal { } QScrollBar::handle:horizontal:hover { - background: #49535d; + background: #525e69; } QScrollBar::handle:horizontal:pressed { @@ -189,7 +189,7 @@ QScrollBar::handle:vertical { } QScrollBar::handle:vertical:hover { - background: #49535d; + background: #525e69; } QScrollBar::handle:vertical:pressed { @@ -238,6 +238,14 @@ QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical { height: 5px; } +QScrollBar::left-arrow:horizontal, QScrollBar::right-arrow:horizontal { + margin-top: 3px; +} + +QScrollBar::up-arrow:vertical, QScrollBar::down-arrow:vertical { + margin-left: 3px; +} + QScrollBar::left-arrow:horizontal { background-image: url(resources:sbarrow_left.png);} QScrollBar::right-arrow:horizontal { background-image: url(resources:sbarrow_right.png);} QScrollBar::up-arrow:vertical { background-image: url(resources:sbarrow_up.png);} @@ -500,6 +508,12 @@ PluginDescWidget:hover { color: #d1d8e4; } +/* piano widget */ + +PianoView { + background-color: #14171a; +} + /* font sizes for text buttons */ FxMixerView QPushButton, EffectRackView QPushButton, ControllerRackView QPushButton { @@ -550,7 +564,7 @@ TrackContentObjectView { /* instrument pattern */ PatternView { background-color: #21A14F; - color: rgba(255,255,255,220) + color: rgba(255,255,255,220); } /* sample track pattern */ diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index 8d4f8726b..c85ca55be 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -163,7 +163,7 @@ private: } ; // some constants... - static const int SCROLLBAR_SIZE = 14; + static const int SCROLLBAR_SIZE = 12; static const int TOP_MARGIN = 16; static const int DEFAULT_Y_DELTA = 6; diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index 82f70c9ce..e33c417c5 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -779,15 +779,11 @@ void PianoView::paintEvent( QPaintEvent * ) p.setFont( pointSize( p.font() ) ); - // draw blue bar above the actual keyboard (there will be the labels + // draw bar above the keyboard (there will be the labels // for all C's) - QLinearGradient g( 0, 0, 0, PIANO_BASE-3 ); - g.setColorAt( 0, Qt::black ); - g.setColorAt( 0.1, QColor( 96, 96, 96 ) ); - g.setColorAt( 1, Qt::black ); - p.fillRect( QRect( 0, 1, width(), PIANO_BASE-2 ), g ); + p.fillRect( QRect( 0, 1, width(), PIANO_BASE-2 ), p.background() ); - // draw stuff above the actual keyboard + // draw the line above the keyboard p.setPen( Qt::black ); p.drawLine( 0, 0, width(), 0 ); p.drawLine( 0, PIANO_BASE-1, width(), PIANO_BASE-1 ); @@ -796,21 +792,18 @@ void PianoView::paintEvent( QPaintEvent * ) const int base_key = ( m_piano != NULL ) ? m_piano->instrumentTrack()->baseNoteModel()->value() : 0; - g.setColorAt( 0, QApplication::palette().color( QPalette::Active, - QPalette::BrightText ).darker(220) ); - g.setColorAt( 0.1, QApplication::palette().color( QPalette::Active, - QPalette::BrightText ) ); - g.setColorAt( 1, QApplication::palette().color( QPalette::Active, - QPalette::BrightText ) ); + + QColor baseKeyColor = QApplication::palette().color( QPalette::Active, + QPalette::BrightText ); if( Piano::isWhiteKey( base_key ) ) { p.fillRect( QRect( getKeyX( base_key ), 1, PW_WHITE_KEY_WIDTH-1, - PIANO_BASE-2 ), g ); + PIANO_BASE-2 ), baseKeyColor ); } else { p.fillRect( QRect( getKeyX( base_key ) + 1, 1, - PW_BLACK_KEY_WIDTH - 1, PIANO_BASE - 2 ), g ); + PW_BLACK_KEY_WIDTH - 1, PIANO_BASE - 2 ), baseKeyColor); } diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index fab230887..c570c8cab 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -83,7 +83,7 @@ typedef AutomationPattern::timeMap timeMap; // some constants... const int INITIAL_PIANOROLL_HEIGHT = 480; -const int SCROLLBAR_SIZE = 14; +const int SCROLLBAR_SIZE = 12; const int PIANO_X = 0; const int WHITE_KEY_WIDTH = 64; diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 711fe1bd9..17262fd9c 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -93,7 +93,7 @@ const char * volume_help = QT_TRANSLATE_NOOP( "InstrumentTrack", const int INSTRUMENT_WIDTH = 254; const int INSTRUMENT_HEIGHT = INSTRUMENT_WIDTH; -const int PIANO_HEIGHT = 82; +const int PIANO_HEIGHT = 80; const int INSTRUMENT_WINDOW_CACHE_SIZE = 8;