Merge pull request #104 from diizy/stable-0.4

Lots of UI stuff again
This commit is contained in:
Tobias Doerffel
2014-01-22 13:09:20 -08:00
70 changed files with 152 additions and 54 deletions

View File

@@ -280,7 +280,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
}
else
{
p.setPen( QColor( 0, 64, 255 ) );
p.setPen( QColor( 0, 180, 60 ) );
}
p.drawText( 2, p.fontMetrics().height() - 1, m_pat->name() );

View File

@@ -232,7 +232,7 @@ QPalette LmmsStyle::standardPalette( void ) const
{
QPalette pal = QPlastiqueStyle::standardPalette();
/* sane defaults in case fetching from stylesheet fails*/
pal.setColor( QPalette::Background, QColor( 91, 101, 113 ) );
@@ -245,17 +245,17 @@ QPalette LmmsStyle::standardPalette( void ) const
pal.setColor( QPalette::BrightText, QColor( 74, 253, 133 ) );
pal.setColor( QPalette::Highlight, QColor( 100, 100, 100 ) );
pal.setColor( QPalette::HighlightedText, QColor( 255, 255, 255 ) );
/* fetch from stylesheet using regexp */
QStringList paletteData = qApp->styleSheet().split( '\n' ).filter( QRegExp( "^palette:*" ) );
foreach( QString s, paletteData )
{
if (s.contains(":background")) { pal.setColor( QPalette::Background, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
if (s.contains(":background")) { pal.setColor( QPalette::Background, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
else if (s.contains(":windowtext")) { pal.setColor( QPalette::WindowText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
else if (s.contains(":base")) { pal.setColor( QPalette::Base, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
else if (s.contains(":buttontext")) { pal.setColor( QPalette::ButtonText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
else if (s.contains(":brighttext")) { pal.setColor( QPalette::BrightText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
else if (s.contains(":buttontext")) { pal.setColor( QPalette::ButtonText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
else if (s.contains(":brighttext")) { pal.setColor( QPalette::BrightText, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
else if (s.contains(":text")) { pal.setColor( QPalette::Text, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
else if (s.contains(":button")) { pal.setColor( QPalette::Button, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
else if (s.contains(":shadow")) { pal.setColor( QPalette::Shadow, QColor( s.mid( s.indexOf("#"), 7 ) ) ); }
@@ -268,7 +268,7 @@ QPalette LmmsStyle::standardPalette( void ) const
/*
void LmmsStyle::drawControl( ControlElement element, const QStyleOption* option, QPainter* painter, const QWidget* widget ) const
{
@@ -294,7 +294,7 @@ void LmmsStyle::drawControl( ControlElement element, const QStyleOption* option,
cache.fill( QColor( 48, 48, 48 ) );
QColor sliderColor;
QColor blurColor;
hoverColors(sunken, hover,
hoverColors(sunken, hover,
scrollBar->activeSubControls & SC_ScrollBarAddLine && isEnabled,
sliderColor, blurColor);
@@ -455,7 +455,7 @@ void LmmsStyle::drawControl( ControlElement element, const QStyleOption* option,
}
}
*/
void LmmsStyle::drawComplexControl( ComplexControl control,
const QStyleOptionComplex * option,
@@ -482,12 +482,12 @@ void LmmsStyle::drawComplexControl( ComplexControl control,
return;
}
}
else if( control == CC_ScrollBar )
/* else if( control == CC_ScrollBar )
{
QColor background = QColor( 48, 48, 48 );
painter->fillRect( option->rect, background );
painter->fillRect( option->rect, QApplication::palette().color( QPalette::Active,
QPalette::Background ) );
}
}*/
QPlastiqueStyle::drawComplexControl( control, option, painter, widget );
}
@@ -633,7 +633,7 @@ int LmmsStyle::pixelMetric( PixelMetric _metric, const QStyleOption * _option,
}
// QStyle::SH_TitleBar_NoBorder
/*
QSize LmmsStyle::sizeFromContents( ContentsType type, const QStyleOption* option, const QSize& size, const QWidget* widget ) const
{
if( type == CT_ScrollBar )
@@ -655,8 +655,8 @@ QSize LmmsStyle::sizeFromContents( ContentsType type, const QStyleOption* option
return QPlastiqueStyle::sizeFromContents( type, option, size, widget );
}
*/
/*
QRect LmmsStyle::subControlRect( ComplexControl control, const QStyleOptionComplex* option, SubControl subControl, const QWidget* widget ) const
{
QRect rect = QPlastiqueStyle::subControlRect( control, option, subControl, widget );
@@ -797,7 +797,7 @@ QRect LmmsStyle::subControlRect( ComplexControl control, const QStyleOptionCompl
return rect;
}
*/

View File

@@ -844,7 +844,7 @@ inline void pianoRoll::drawNoteRect( QPainter & _p, int _x, int _y,
( (float)( PanningRight - _n->getPanning() ) ) /
( (float)( PanningRight - PanningLeft ) ) * 2.0f );
const QColor defaultNoteColor( 0x4A, 0xFD, 0x85 );
const QColor defaultNoteColor( 0x77, 0xC7, 0xD8 );
QColor col = defaultNoteColor;
if( _n->length() < 0 )
@@ -2680,7 +2680,7 @@ static void printNoteHeights(QPainter& p, int bottom, int width, int startKey)
};
p.setFont( pointSize<KEY_LINE_HEIGHT-4>( p.font() ) );
p.setPen( QColor( 255, 255, 0 ) );
p.setPen( QColor( 255, 255, 255 ) );
for( int y = bottom, key = startKey; y > PR_TOP_MARGIN;
y -= KEY_LINE_HEIGHT, key++)
{
@@ -2924,7 +2924,7 @@ void pianoRoll::paintEvent( QPaintEvent * _pe )
QFont f = p.font();
f.setBold( false );
p.setFont( pointSize<10>( f ) );
p.setPen( QColor( 255, 255, 0 ) );
p.setPen( QColor( 255, 255, 255) );
p.drawText( QRect( 0, keyAreaBottom(),
WHITE_KEY_WIDTH, noteEditBottom() - keyAreaBottom() ),
Qt::AlignCenter | Qt::TextWordWrap,
@@ -3072,7 +3072,7 @@ void pianoRoll::paintEvent( QPaintEvent * _pe )
int editHandleTop = 0;
if( m_noteEditMode == NoteEditVolume )
{
QColor color = QColor::fromHsv( 120, 221,
QColor color = QColor::fromHsv( 140, 221,
qMin(255, 60 + ( *it )->getVolume() ) );
if( ( *it )->selected() )
{
@@ -3091,7 +3091,7 @@ void pianoRoll::paintEvent( QPaintEvent * _pe )
}
else if( m_noteEditMode == NoteEditPanning )
{
QColor color( 0xFF, 0xB0, 0x00 );
QColor color( 0x99, 0xAF, 0xFF );
if( ( *it )->selected() )
{
color.setRgb( 0x00, 0x40, 0xC0 );
@@ -3119,7 +3119,7 @@ void pianoRoll::paintEvent( QPaintEvent * _pe )
}
}
p.setPen( QPen( QColor( 0xEA, 0xA1, 0x00 ),
p.setPen( QPen( QColor( 0x99, 0xAF, 0xFF ),
NE_LINE_WIDTH+2 ) );
p.drawPoints( editHandles );

View File

@@ -1271,7 +1271,7 @@ void patternView::paintEvent( QPaintEvent * )
}
else
{
p.setPen( QColor( 32, 240, 32 ) );
p.setPen( QColor( 32, 240, 101 ) );
}
if( m_pat->name() != m_pat->instrumentTrack()->name() )