1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 23:29:41 +02:00

Hiding the affordance on the right channel of the WaveTrack

(cherry picked from audacity commit f1638da631e9965f1e1c0922dca2e565c51fefd6)

Signed-off-by: akleja <storspov@gmail.com>
This commit is contained in:
Vitaly Sverchinsky 2021-08-19 20:51:45 +03:00 committed by akleja
parent 62fe78b0ef
commit cc49ceec3d
3 changed files with 19 additions and 1 deletions

View File

@ -1313,3 +1313,13 @@ Track::LinkType Track::GetLinkType() const noexcept
{
return mLinkType;
}
bool Track::IsAlignedWithLeader() const
{
if (auto owner = GetOwner())
{
auto leader = *owner->FindLeader(this);
return leader != this && leader->GetLinkType() == Track::LinkType::Aligned;
}
return false;
}

View File

@ -376,6 +376,9 @@ public:
std::shared_ptr<TrackList> GetOwner() const { return mList.lock(); }
LinkType GetLinkType() const noexcept;
//! Returns true if the leader track has link type LinkType::Aligned
bool IsAlignedWithLeader() const;
protected:
void SetLinkType(LinkType linkType);

View File

@ -1087,7 +1087,12 @@ WaveTrackView::GetAllSubViews()
std::shared_ptr<CommonTrackCell> WaveTrackView::GetAffordanceControls()
{
return DoGetAffordance(FindTrack());
auto track = FindTrack();
if (!track->IsAlignedWithLeader())
{
return DoGetAffordance(track);
}
return {};
}
void WaveTrackView::DoSetMinimized( bool minimized )