1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-24 23:33:50 +02:00

Translucent background to track name (all platforms)

wxDC can draw translucently, if given a bitmap.  So we now create a suitable bitmap, using a wxGraphicsContext.
This commit is contained in:
James Crook
2019-04-06 16:34:47 +01:00
parent 2463a6683b
commit 81dd2befab
3 changed files with 47 additions and 4 deletions

View File

@@ -314,6 +314,27 @@ void AColor::UseThemeColour( wxDC * dc, int iBrush, int iPen, int alpha )
dc->SetPen( sparePen );
}
void AColor::UseThemeColour( wxGraphicsContext * gc, int iBrush, int iPen, int alpha )
{
if (!inited)
Init();
// do nothing if no colours set.
if( (iBrush == -1) && ( iPen ==-1))
return;
wxColour col = wxColour(0,0,0);
if( iBrush !=-1 ){
col = theTheme.Colour( iBrush );
col.Set( col.Red(), col.Green(), col.Blue(), alpha);
spareBrush.SetColour( col );
gc->SetBrush( spareBrush );
}
if( iPen != -1)
col = theTheme.Colour( iPen );
sparePen.SetColour( col );
gc->SetPen( sparePen );
}
void AColor::Light(wxDC * dc, bool selected, bool highlight)
{
if (!inited)