1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-25 07:43:54 +02:00

Back to a dark colour for cursor on Light and Classic.

This could also have been achieved by tweaking the colours in each of the themes.
This commit is contained in:
James Crook
2017-07-09 14:33:24 +01:00
parent e3a822c34d
commit 7d968586af

View File

@@ -430,6 +430,23 @@ wxColour InvertOfColour( const wxColour & c )
return wxColour( 255-c.Red(), 255-c.Green(), 255-c.Blue() ); return wxColour( 255-c.Red(), 255-c.Green(), 255-c.Blue() );
} }
// Fix up the cursor colour, if it is 'unacceptable'.
// Unacceptable if it is too close to the background colour.
wxColour CursorColour( )
{
wxColour cCursor = theTheme.Colour( clrCursorPen );
wxColour cBack = theTheme.Colour( clrMedium );
int d = theTheme.ColourDistance( cCursor, cBack );
// Pen colour is fine, if there is plenty of contrast.
if( d > 200 )
return clrCursorPen;
// otherwise return same colour as a selection.
return theTheme.Colour( clrSelected );
}
void AColor::Init() void AColor::Init()
{ {
if (inited) if (inited)
@@ -471,8 +488,7 @@ void AColor::Init()
theTheme.SetBrushColour( muteBrush[1], clrMuteButtonVetoed); theTheme.SetBrushColour( muteBrush[1], clrMuteButtonVetoed);
theTheme.SetBrushColour( soloBrush, clrMuteButtonActive); theTheme.SetBrushColour( soloBrush, clrMuteButtonActive);
theTheme.SetPenColour( cursorPen, clrCursorPen); cursorPen.SetColour( CursorColour() );
cursorPen.SetColour( InvertOfColour( cursorPen.GetColour()) );
theTheme.SetPenColour( indicatorPen[0], clrRecordingPen); theTheme.SetPenColour( indicatorPen[0], clrRecordingPen);
theTheme.SetPenColour( indicatorPen[1], clrPlaybackPen); theTheme.SetPenColour( indicatorPen[1], clrPlaybackPen);
theTheme.SetBrushColour( indicatorBrush[0], clrRecordingBrush); theTheme.SetBrushColour( indicatorBrush[0], clrRecordingBrush);