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:
Kumar
2020-07-02 19:56:41 +05:30
committed by GitHub
parent 5d7e6720e1
commit 984fd3a935
4 changed files with 114 additions and 15 deletions

View File

@@ -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 );
} ;