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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user