1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 16:40:07 +02:00

Give track name overlay a background.

- Also changed over from using the yellow color.
This commit is contained in:
James Crook 2018-03-02 19:27:42 +00:00
parent 3f358a39b6
commit 3e8dec452c

View File

@ -487,10 +487,16 @@ void TrackArtist::DrawTrack(TrackPanelDrawingContext &context,
if (mbShowTrackNameInWaveform &&
// Exclude right channel of stereo track
!(!wt->GetLinked() && wt->GetLink())) {
wxBrush Brush;
long x,y;
wxFont labelFont(12, wxSWISS, wxNORMAL, wxNORMAL);
dc.SetFont(labelFont);
dc.SetTextForeground(theTheme.Colour( clrTrackNameText ));
dc.DrawText (wt->GetName(), rect.x+10, rect.y); // move right 10 pixels to avoid overwriting <- symbol
dc.GetTextExtent( wt->GetName(), &x, &y );
dc.SetTextForeground(theTheme.Colour( clrTrackPanelText ));
// A nice improvement would be to draw the shield / background translucently.
AColor::UseThemeColour( &dc, clrTrackInfoSelected, clrTrackPanelText );
dc.DrawRoundedRectangle( wxPoint( rect.x+7, rect.y+1 ), wxSize( x+16, y+4), 8.0 );
dc.DrawText (wt->GetName(), rect.x+15, rect.y+3); // move right 15 pixels to avoid overwriting <- symbol
}
break; // case Wave
}