Refactor palette update on un/mute

This commit is contained in:
Spekular
2020-05-01 20:03:27 +02:00
parent aaf94ef69d
commit 9ed5f80fe0
2 changed files with 14 additions and 17 deletions

View File

@@ -745,12 +745,14 @@ private:
return nullptr;
}
void setIndicatorMute(FadeButton* indicator, bool muted);
friend class TrackLabelButton;
private slots:
void createTCOView( TrackContentObject * tco );
void muteChanged ();
void muteChanged();
} ;

View File

@@ -3060,20 +3060,15 @@ void TrackView::createTCOView( TrackContentObject * tco )
void TrackView::muteChanged()
{
FadeButton * actind = getActivityIndicator();
if (actind)
{
if (m_track->m_mutedModel.value())
{
actind->setActiveColor(QApplication::palette().color(
QPalette::Active, QPalette::Highlight
));
}
else
{
actind->setActiveColor(QApplication::palette().color(
QPalette::Active, QPalette::BrightText
));
}
}
FadeButton * indicator = getActivityIndicator();
if (indicator) { setIndicatorMute(indicator, m_track->m_mutedModel.value()); }
}
void TrackView::setIndicatorMute(FadeButton* indicator, bool muted)
{
QPalette::ColorRole role = muted ? QPalette::Highlight : QPalette::BrightText;
indicator->setActiveColor(QApplication::palette().color(QPalette::Active, role));
}