Make sure ERC and DRC item lists respect color themes.
Fixes: lp:1492953 * https://bugs.launchpad.net/kicad/+bug/1492953
This commit is contained in:
parent
fa41026f36
commit
3d12a6889b
|
@ -207,12 +207,11 @@ wxString WX_HTML_REPORT_PANEL::addHeader( const wxString& aBody )
|
|||
{
|
||||
wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
|
||||
wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
|
||||
wxString s = "<html><body bgcolor=\"" + bgcolor.GetAsString( wxC2S_HTML_SYNTAX ) +
|
||||
"\" text=\"" + fgcolor.GetAsString( wxC2S_HTML_SYNTAX ) + "\">";
|
||||
s += aBody;
|
||||
s += "</body></html>";
|
||||
|
||||
return s;
|
||||
return wxString::Format( wxT( "<html><body bgcolor='%s' text='%s'>%s</body></html>" ),
|
||||
bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
|
||||
fgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
|
||||
aBody );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -71,7 +71,9 @@ public:
|
|||
void DisplayList()
|
||||
{
|
||||
wxString htmlpage;
|
||||
|
||||
wxColour bgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
|
||||
wxColour lncolor = wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT );
|
||||
wxColour fgcolor = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
|
||||
// for each marker, build a link like:
|
||||
// <A HREF="marker_index">text to click</A>
|
||||
// The "text to click" is the error name (first line of the full error text).
|
||||
|
@ -79,13 +81,18 @@ public:
|
|||
|
||||
for( unsigned ii = 0; ii < m_MarkerListReferences.size(); ii++ )
|
||||
{
|
||||
marker_text.Printf( wxT( "<A HREF=\"%d\">" ), ii );
|
||||
marker_text << m_MarkerListReferences[ii]->GetReporter().ShowHtml();
|
||||
marker_text.Replace( wxT( "<ul>" ), wxT( "</A><ul>" ), false );
|
||||
marker_text.Printf( wxT( "<font color='%s'><a href='%d'>%s</font>" ),
|
||||
lncolor.GetAsString( wxC2S_HTML_SYNTAX ),
|
||||
ii,
|
||||
m_MarkerListReferences[ii]->GetReporter().ShowHtml() );
|
||||
marker_text.Replace( wxT( "<ul>" ), wxT( "</a><ul>" ), false );
|
||||
htmlpage += marker_text;
|
||||
}
|
||||
|
||||
SetPage( htmlpage );
|
||||
SetPage( wxString::Format( wxT( "<html><body bgcolor='%s' text='%s'>%s</body></html>" ),
|
||||
bgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
|
||||
fgcolor.GetAsString( wxC2S_HTML_SYNTAX ),
|
||||
htmlpage ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -249,7 +249,13 @@ public:
|
|||
{
|
||||
const DRC_ITEM* item = m_list->GetItem( (int) n );
|
||||
if( item )
|
||||
return item->ShowHtml();
|
||||
{
|
||||
wxColour color = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT );
|
||||
|
||||
return wxString::Format( wxT( "<font color='%s'>%s</font>" ),
|
||||
color.GetAsString( wxC2S_HTML_SYNTAX ),
|
||||
item->ShowHtml() );
|
||||
}
|
||||
}
|
||||
return wxString();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue