Simplify TrackLabelButton

Remove the dependency to `Instrument` and `InstrumentTrack` from `TrackLabelButton`. The icon of an `InstrumentTrackView` is now determined in the class `InstrumentTrackView` itself using the new method `determinePixmap`. This enables the removal of the overridden `paintEvent` method from `TrackLabelButton`.
This commit is contained in:
Michael Gregorius
2023-12-24 22:49:39 +01:00
parent 3aefe7b3d3
commit 88e0e94dcd
4 changed files with 27 additions and 33 deletions

View File

@@ -93,6 +93,8 @@ private slots:
void handleConfigChange(QString cls, QString attr, QString value);
private:
QPixmap determinePixmap(InstrumentTrack * instrumentTrack);
private:
InstrumentTrackWindow * m_window;

View File

@@ -55,7 +55,6 @@ protected:
void mousePressEvent( QMouseEvent * _me ) override;
void mouseDoubleClickEvent( QMouseEvent * _me ) override;
void mouseReleaseEvent( QMouseEvent * _me ) override;
void paintEvent( QPaintEvent * _pe ) override;
void resizeEvent( QResizeEvent * _re ) override;