mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-19 06:07:42 +02:00
Bug 1699 - Selected keyboard prefs line unreadable in 3 of 4 themes on Mac
The focus rect in key prefs is not very helpful. It was setting the background colour too, but that is now using system colours again.
This commit is contained in:
parent
904ddbf2a3
commit
de0cc3ecff
@ -178,22 +178,8 @@ void AColor::DrawFocus(wxDC & dc, wxRect & rect)
|
||||
x2 = rect.GetRight(),
|
||||
y2 = rect.GetBottom();
|
||||
|
||||
#ifdef __WXMAC__
|
||||
// Why must this be different?
|
||||
// Otherwise nothing is visible if you do as for the
|
||||
// other platforms.
|
||||
UseThemeColour( &dc, clrTrackPanelText );
|
||||
|
||||
//dc.SetPen(wxPen(wxT("MEDIUM GREY"), 1, wxSOLID));
|
||||
//dc.SetLogicalFunction(wxCOPY);
|
||||
#else
|
||||
UseThemeColour( &dc, clrTrackPanelText );
|
||||
|
||||
//dc.SetPen(wxPen(wxT("MEDIUM GREY"), 0, wxSOLID));
|
||||
// this seems to be closer than what Windows does than wxINVERT although
|
||||
// I'm still not sure if it's correct
|
||||
//dc.SetLogicalFunction(wxAND_REVERSE);
|
||||
#endif
|
||||
// -1 for brush, so it just sets the pen colour, and does not change the brush.
|
||||
UseThemeColour( &dc, -1, clrTrackPanelText );
|
||||
|
||||
wxCoord z;
|
||||
for ( z = x1 + 1; z < x2; z += 2 )
|
||||
@ -211,7 +197,6 @@ void AColor::DrawFocus(wxDC & dc, wxRect & rect)
|
||||
for ( z = y2 - shift; z > y1; z -= 2 )
|
||||
dc.DrawPoint(x1, z);
|
||||
|
||||
dc.SetLogicalFunction(wxCOPY);
|
||||
}
|
||||
|
||||
void AColor::Bevel(wxDC & dc, bool up, const wxRect & r)
|
||||
@ -298,15 +283,24 @@ void AColor::BevelTrackInfo(wxDC & dc, bool up, const wxRect & r, bool highlight
|
||||
#endif
|
||||
}
|
||||
|
||||
void AColor::UseThemeColour( wxDC * dc, int iIndex, int index2 )
|
||||
// Set colour of and select brush and pen.
|
||||
// Use -1 to omit brush or pen.
|
||||
// If pen omitted, then the same colour as the brush will be used.
|
||||
void AColor::UseThemeColour( wxDC * dc, int iBrush, int iPen )
|
||||
{
|
||||
if (!inited)
|
||||
Init();
|
||||
wxColour col = theTheme.Colour( iIndex );
|
||||
spareBrush.SetColour( col );
|
||||
dc->SetBrush( spareBrush );
|
||||
if( index2 != -1)
|
||||
col = theTheme.Colour( index2 );
|
||||
// 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 );
|
||||
spareBrush.SetColour( col );
|
||||
dc->SetBrush( spareBrush );
|
||||
}
|
||||
if( iPen != -1)
|
||||
col = theTheme.Colour( iPen );
|
||||
sparePen.SetColour( col );
|
||||
dc->SetPen( sparePen );
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ class AColor {
|
||||
static void BevelTrackInfo(wxDC & dc, bool up, const wxRect & r, bool highlight = false);
|
||||
static wxColour Blend(const wxColour & c1, const wxColour & c2);
|
||||
|
||||
static void UseThemeColour( wxDC * dc, int iIndex, int index2 =-1 );
|
||||
static void UseThemeColour( wxDC * dc, int iBrush, int iPen=-1 );
|
||||
static void TrackPanelBackground(wxDC * dc, bool selected);
|
||||
|
||||
static void Light(wxDC * dc, bool selected, bool highlight = false);
|
||||
|
@ -1080,15 +1080,22 @@ KeyView::OnDrawBackground(wxDC & dc, const wxRect & rect, size_t line) const
|
||||
if (FindFocus() == this)
|
||||
{
|
||||
// Focused lines get highlighted background
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)));
|
||||
AColor::DrawFocus(dc, r);
|
||||
dc.DrawRectangle(r);
|
||||
|
||||
// and they also get a dotted focus rect. This could just be left out.
|
||||
// The focus rect does very little for us, as it is the same size as the
|
||||
// rectangle itself. Consequently for themes that have black text it
|
||||
// disappears. But on HiContrast you do get a dotted green border which
|
||||
// may have some utility.
|
||||
AColor::DrawFocus(dc, r);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Non focused lines get a light background
|
||||
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
|
||||
dc.SetPen(*wxTRANSPARENT_PEN);
|
||||
dc.SetBrush(wxBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)));
|
||||
dc.DrawRectangle(r);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user