Adding a trail (gradient) behind the position bar (#5543)
* src/gui/editors/SongEditor.cpp * Gradient can be toggled and color can be changed. * Made playback line (and tail) transparent to mouse clicks * Gradient disappears when paused/stopped; tail length depends on zoom * Fixes bug where gradient appears when a pattern is played; style corrections * Cleaned up code * Rename m_zoomLevels to s_zoomLevels * Finalising code * Make positionLine class independent of parent zooming model * Edit a bug fix to make it more efficient * Rename m_x and finalise positionLine code * Rename m_x and finalise positionLine changes * Rename X to playHeadPos
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#define SONG_EDITOR_H
|
||||
|
||||
#include <QVector>
|
||||
#include <QLinearGradient>
|
||||
|
||||
#include "ActionGroup.h"
|
||||
#include "Editor.h"
|
||||
@@ -47,13 +48,28 @@ class TimeLineWidget;
|
||||
|
||||
class positionLine : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY ( bool tailGradient READ hasTailGradient WRITE setHasTailGradient )
|
||||
Q_PROPERTY ( QColor lineColor READ lineColor WRITE setLineColor )
|
||||
public:
|
||||
positionLine( QWidget * parent );
|
||||
positionLine ( QWidget* parent );
|
||||
|
||||
// qproperty access functions
|
||||
bool hasTailGradient () const;
|
||||
void setHasTailGradient ( const bool g );
|
||||
QColor lineColor () const;
|
||||
void setLineColor ( const QColor & c );
|
||||
|
||||
public slots:
|
||||
void zoomChange (double zoom);
|
||||
|
||||
private:
|
||||
void paintEvent( QPaintEvent * pe ) override;
|
||||
void paintEvent( QPaintEvent* pe ) override;
|
||||
|
||||
bool m_hasTailGradient;
|
||||
QColor m_lineColor;
|
||||
|
||||
} ;
|
||||
};
|
||||
|
||||
|
||||
class SongEditor : public TrackContainerView
|
||||
@@ -164,6 +180,9 @@ private:
|
||||
bool m_selectRegion;
|
||||
|
||||
friend class SongEditorWindow;
|
||||
|
||||
signals:
|
||||
void zoomingValueChanged( double );
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user