Improve tuning status popup colours.
This commit is contained in:
parent
f629898c8b
commit
9c4bb464ac
|
@ -135,3 +135,10 @@ void STATUS_TEXT_POPUP::SetTextColor( const wxColour& aColor )
|
||||||
{
|
{
|
||||||
m_statusLine->SetForegroundColour( aColor );
|
m_statusLine->SetForegroundColour( aColor );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void STATUS_TEXT_POPUP::SetBgColour( const wxColour& aColor )
|
||||||
|
{
|
||||||
|
m_panel->SetBackgroundColour( aColor );
|
||||||
|
SetBackgroundColour( aColor );
|
||||||
|
}
|
||||||
|
|
|
@ -88,17 +88,24 @@ public:
|
||||||
/**
|
/**
|
||||||
* Display a text.
|
* Display a text.
|
||||||
*
|
*
|
||||||
* @param aText is the text to be displayed.
|
* @param aText text to be displayed.
|
||||||
*/
|
*/
|
||||||
void SetText( const wxString& aText );
|
void SetText( const wxString& aText );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change text color.
|
* Change text color.
|
||||||
*
|
*
|
||||||
* @param aColor is the new text color.
|
* @param aColor new text color.
|
||||||
*/
|
*/
|
||||||
void SetTextColor( const wxColour& aColor );
|
void SetTextColor( const wxColour& aColor );
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change background color.
|
||||||
|
*
|
||||||
|
* @param aColor new background color.
|
||||||
|
*/
|
||||||
|
void SetBgColour( const wxColour& aColor );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
wxStaticText* m_statusLine;
|
wxStaticText* m_statusLine;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1100,9 +1100,6 @@ void PCB_GENERATOR_MEANDERS::EditPush( GENERATOR_TOOL* aTool, BOARD* aBoard,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store isNew as BOARD_COMMIT::Push() is going to clear it.
|
|
||||||
bool isNew = IsNew();
|
|
||||||
|
|
||||||
if( aCommitMsg.IsEmpty() )
|
if( aCommitMsg.IsEmpty() )
|
||||||
aCommit->Push( _( "Edit Tuning Pattern" ), aCommitFlags );
|
aCommit->Push( _( "Edit Tuning Pattern" ), aCommitFlags );
|
||||||
else
|
else
|
||||||
|
@ -1476,35 +1473,22 @@ void PCB_GENERATOR_MEANDERS::UpdateStatus( GENERATOR_TOOL* aTool, PCB_BASE_EDIT_
|
||||||
|
|
||||||
// Determine the background color first and choose a contrasting value
|
// Determine the background color first and choose a contrasting value
|
||||||
COLOR4D bg( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
|
COLOR4D bg( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
|
||||||
|
COLOR4D fg;
|
||||||
double h, s, l;
|
double h, s, l;
|
||||||
bg.ToHSL( h, s, l );
|
bg.ToHSL( h, s, l );
|
||||||
|
|
||||||
|
bg.FromHSL( h, s, l < 0.5 ? 0.1 : 0.9 );
|
||||||
|
aPopup->SetBgColour( bg.ToColour() );
|
||||||
|
|
||||||
switch( placer->TuningStatus() )
|
switch( placer->TuningStatus() )
|
||||||
{
|
{
|
||||||
case PNS::MEANDER_PLACER_BASE::TUNED:
|
case PNS::MEANDER_PLACER_BASE::TUNED: h = 120.0; break; // Green
|
||||||
if( l < 0.5 )
|
case PNS::MEANDER_PLACER_BASE::TOO_SHORT: h = 0; break; // Red
|
||||||
aPopup->SetTextColor( wxColor( 127, 200, 127 ) );
|
case PNS::MEANDER_PLACER_BASE::TOO_LONG: h = 240.0; break; // Blue
|
||||||
else
|
|
||||||
aPopup->SetTextColor( wxColor( 0, 92, 0 ) );
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PNS::MEANDER_PLACER_BASE::TOO_SHORT:
|
|
||||||
if( l < 0.5 )
|
|
||||||
aPopup->SetTextColor( wxColor( 242, 100, 126 ) );
|
|
||||||
else
|
|
||||||
aPopup->SetTextColor( wxColor( 122, 0, 0 ) );
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case PNS::MEANDER_PLACER_BASE::TOO_LONG:
|
|
||||||
if( l < 0.5 )
|
|
||||||
aPopup->SetTextColor( wxColor( 66, 184, 235 ) );
|
|
||||||
else
|
|
||||||
aPopup->SetTextColor( wxColor( 19, 19, 195 ) );
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fg.FromHSL( h, 1.0, l < 0.5 ? 0.8 : 0.2 );
|
||||||
|
aPopup->SetTextColor( fg.ToColour() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue