TCOView: Make patternviews foreground elements stylable with qproperties

This commit is contained in:
Vesa
2014-04-05 17:22:45 +03:00
parent 3bcffcdf5b
commit 994dcd3964
9 changed files with 79 additions and 15 deletions

View File

@@ -33,11 +33,15 @@ class AutomationPattern;
class AutomationPatternView : public trackContentObjectView
{
Q_OBJECT
// theming qproperties
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
public:
AutomationPatternView( AutomationPattern * _pat, trackView * _parent );
virtual ~AutomationPatternView();
public slots:
virtual void update();
@@ -67,7 +71,6 @@ private:
bool m_needsUpdate;
void scaleTimemapToFit( float oldMin, float oldMax );
} ;

View File

@@ -88,6 +88,11 @@ signals:
class SampleTCOView : public trackContentObjectView
{
Q_OBJECT
// theming qproperties
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
public:
SampleTCOView( SampleTCO * _tco, trackView * _tv );
virtual ~SampleTCOView();
@@ -108,7 +113,6 @@ protected:
private:
SampleTCO * m_tco;
} ;

View File

@@ -147,6 +147,10 @@ private:
class patternView : public trackContentObjectView
{
Q_OBJECT
// theming qproperties
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
public:
patternView( pattern * _pattern, trackView * _parent );
virtual ~patternView();
@@ -185,7 +189,6 @@ private:
pattern * m_pat;
QPixmap m_paintPixmap;
bool m_needsUpdate;
} ;

View File

@@ -163,6 +163,11 @@ private:
class trackContentObjectView : public selectableObject, public ModelView
{
Q_OBJECT
// theming qproperties
Q_PROPERTY( QColor fgColor READ fgColor WRITE setFgColor )
Q_PROPERTY( QColor textColor READ textColor WRITE setTextColor )
public:
trackContentObjectView( trackContentObject * _tco, trackView * _tv );
virtual ~trackContentObjectView();
@@ -173,7 +178,11 @@ public:
{
return m_tco;
}
// qproperty access func
QColor fgColor() const;
QColor textColor() const;
void setFgColor( const QColor & _c );
void setTextColor( const QColor & _c );
public slots:
virtual bool close();
@@ -228,6 +237,9 @@ private:
MidiTime m_oldTime;// used for undo/redo while mouse-button is pressed
// qproperty fields
QColor * m_fgColor;
QColor * m_textColor;
} ;