Define all pattern colours in CSS and make them stylable
also coding style improvements (remove leading underscores from header guards)
This commit is contained in:
@@ -467,6 +467,23 @@ TrackContainerView QLabel
|
||||
background: none;
|
||||
}
|
||||
|
||||
/* Patterns */
|
||||
|
||||
/* instrument pattern */
|
||||
patternView {
|
||||
color: rgb( 119, 199, 216 );
|
||||
}
|
||||
|
||||
/* sample track pattern */
|
||||
SampleTCOView {
|
||||
color: rgb( 74, 253, 133 );
|
||||
}
|
||||
|
||||
/* automation pattern */
|
||||
AutomationPatternView {
|
||||
color: #99afff;
|
||||
}
|
||||
|
||||
/* Plugins */
|
||||
|
||||
TripleOscillatorView knob {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* Copyright (c) 2008-2013 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2008 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -24,8 +24,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AUTOMATION_PATTERN_H
|
||||
#define _AUTOMATION_PATTERN_H
|
||||
#ifndef AUTOMATION_PATTERN_H
|
||||
#define AUTOMATION_PATTERN_H
|
||||
|
||||
#include <QtCore/QPointer>
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AUTOMATION_PATTERN_VIEW_H
|
||||
#define _AUTOMATION_PATTERN_VIEW_H
|
||||
#ifndef AUTOMATION_PATTERN_VIEW_H
|
||||
#define AUTOMATION_PATTERN_VIEW_H
|
||||
|
||||
#include "track.h"
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AUTOMATION_TRACK_H
|
||||
#define _AUTOMATION_TRACK_H
|
||||
#ifndef AUTOMATION_TRACK_H
|
||||
#define AUTOMATION_TRACK_H
|
||||
|
||||
#include "track.h"
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _SAMPLE_TRACK_H
|
||||
#define _SAMPLE_TRACK_H
|
||||
#ifndef SAMPLE_TRACK_H
|
||||
#define SAMPLE_TRACK_H
|
||||
|
||||
#include <QtGui/QDialog>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* (which is a singleton-class) as track
|
||||
*
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
@@ -24,8 +24,8 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BB_TRACK_H
|
||||
#define _BB_TRACK_H
|
||||
#ifndef BB_TRACK_H
|
||||
#define BB_TRACK_H
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QMap>
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PATTERN_H
|
||||
#define _PATTERN_H
|
||||
#ifndef PATTERN_H
|
||||
#define PATTERN_H
|
||||
|
||||
#include <QtCore/QVector>
|
||||
#include <QtGui/QWidget>
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _TRACK_H
|
||||
#define _TRACK_H
|
||||
#ifndef TRACK_H
|
||||
#define TRACK_H
|
||||
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QList>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* like Song-Editor, BB-Editor...
|
||||
*
|
||||
* Copyright (c) 2004-2014 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
|
||||
@@ -913,7 +913,7 @@ void trackContentWidget::updateBackground()
|
||||
pmp.setPen( QPen( QColor( 0, 0, 0, 160 ), 1 ) );
|
||||
// horizontal line
|
||||
pmp.drawLine( 0, 0, w*2, 0 );
|
||||
|
||||
|
||||
// vertical lines
|
||||
for( float x = 0; x < w * 2; x += ppt )
|
||||
{
|
||||
@@ -1850,7 +1850,7 @@ trackContentObject * track::getTCO( int _tco_num )
|
||||
printf( "called track::getTCO( %d ), "
|
||||
"but TCO %d doesn't exist\n", _tco_num, _tco_num );
|
||||
return createTCO( _tco_num * MidiTime::ticksPerTact() );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2220,7 +2220,7 @@ void trackView::modelChanged()
|
||||
connect( m_track, SIGNAL( destroyedTrack() ), this, SLOT( close() ) );
|
||||
m_trackOperationsWidget.m_muteBtn->setModel( &m_track->m_mutedModel );
|
||||
m_trackOperationsWidget.m_soloBtn->setModel( &m_track->m_soloModel );
|
||||
ModelView::modelChanged();
|
||||
ModelView::modelChanged();
|
||||
setFixedHeight( m_track->getHeight() );
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ AutomationPatternView::AutomationPatternView( AutomationPattern * _pattern,
|
||||
|
||||
toolTip::add( this, tr( "double-click to open this pattern in "
|
||||
"automation editor" ) );
|
||||
setStyle( QApplication::style() );
|
||||
}
|
||||
|
||||
|
||||
@@ -203,6 +204,9 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
return;
|
||||
}
|
||||
|
||||
QPainter _p( this );
|
||||
const QColor styleColor = _p.pen().brush().color();
|
||||
|
||||
m_needsUpdate = false;
|
||||
|
||||
if( m_paintPixmap.isNull() == true || m_paintPixmap.size() != size() )
|
||||
@@ -216,7 +220,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
QColor c;
|
||||
if( !( m_pat->getTrack()->isMuted() || m_pat->isMuted() ) )
|
||||
c = isSelected() ? QColor( 0, 0, 224 )
|
||||
: QColor( 0x99, 0xAF, 0xFF );
|
||||
: styleColor; //QColor( 0x99, 0xAF, 0xFF );
|
||||
else
|
||||
c = QColor( 80,80,80 );
|
||||
|
||||
@@ -274,7 +278,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
MidiTime::ticksPerTact();
|
||||
const float x2 = (float)( width() - TCO_BORDER_WIDTH );
|
||||
if( x1 > ( width() - TCO_BORDER_WIDTH ) ) break;
|
||||
|
||||
|
||||
p.fillRect( QRectF( x1, 0.0f, x2-x1, it.value() ),
|
||||
lin2grad );
|
||||
break;
|
||||
@@ -317,8 +321,7 @@ void AutomationPatternView::paintEvent( QPaintEvent * )
|
||||
|
||||
p.end();
|
||||
|
||||
p.begin( this );
|
||||
p.drawPixmap( 0, 0, m_paintPixmap );
|
||||
_p.drawPixmap( 0, 0, m_paintPixmap );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -328,11 +328,12 @@ void SampleTCOView::mouseDoubleClickEvent( QMouseEvent * )
|
||||
void SampleTCOView::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
QPainter p( this );
|
||||
const QColor styleColor = p.pen().brush().color();
|
||||
|
||||
QColor c;
|
||||
if( !( m_tco->getTrack()->isMuted() || m_tco->isMuted() ) )
|
||||
c = isSelected() ? QColor( 0, 0, 224 )
|
||||
: QColor( 74, 253, 133 );
|
||||
: styleColor; //QColor( 74, 253, 133 );
|
||||
else c = QColor( 80, 80, 80 );
|
||||
|
||||
QLinearGradient grad( 0, 0, 0, height() );
|
||||
|
||||
@@ -819,6 +819,9 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
return;
|
||||
}
|
||||
|
||||
QPainter _p( this );
|
||||
const QColor styleColor = _p.pen().brush().color();
|
||||
|
||||
m_pat->changeLength( m_pat->length() );
|
||||
|
||||
m_needsUpdate = false;
|
||||
@@ -837,7 +840,7 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
if(( m_pat->m_patternType != pattern::BeatPattern ) &&
|
||||
!( m_pat->getTrack()->isMuted() || m_pat->isMuted() ))
|
||||
c = isSelected() ? QColor( 0, 0, 224 )
|
||||
: QColor( 119, 199, 216 );
|
||||
: styleColor;//QColor( 119, 199, 216 );
|
||||
else
|
||||
c = QColor( 80, 80, 80 );
|
||||
|
||||
@@ -851,7 +854,7 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
lingrad.setColorAt( 0, c.darker( 300 ) );
|
||||
lingrad.setColorAt( 1, c );
|
||||
}
|
||||
|
||||
|
||||
p.setBrush( lingrad );
|
||||
p.setPen( c.darker( 300 ) );
|
||||
p.drawRect( QRect( 0, 0, width() - 1, height() - 1 ) );
|
||||
@@ -1025,8 +1028,8 @@ void patternView::paintEvent( QPaintEvent * )
|
||||
|
||||
p.end();
|
||||
|
||||
p.begin( this );
|
||||
p.drawPixmap( 0, 0, m_paintPixmap );
|
||||
// p.begin( this );
|
||||
_p.drawPixmap( 0, 0, m_paintPixmap );
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user