From 3e8dec452cba9e6a10d89c0086626fb03c0b92b3 Mon Sep 17 00:00:00 2001 From: James Crook Date: Fri, 2 Mar 2018 19:27:42 +0000 Subject: [PATCH] Give track name overlay a background. - Also changed over from using the yellow color. --- src/TrackArtist.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index f1bd513af..fac7e5efd 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -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 }