From cb075d06c282920c97abf3e65ad4d479b70bf16b Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Tue, 13 Oct 2020 17:55:14 -0400 Subject: [PATCH] Apply system colors to HTML panel in symbol chooser Fixes https://gitlab.com/kicad/code/kicad/-/issues/6000 --- common/widgets/lib_tree.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/common/widgets/lib_tree.cpp b/common/widgets/lib_tree.cpp index 3281873bda..031897f672 100644 --- a/common/widgets/lib_tree.cpp +++ b/common/widgets/lib_tree.cpp @@ -411,10 +411,20 @@ void LIB_TREE::onPreselect( wxCommandEvent& aEvent ) int unit = 0; LIB_ID id = GetSelectedLibId( &unit ); + wxString htmlColor = GetBackgroundColour().GetAsString( wxC2S_HTML_SYNTAX ); + wxString textColor = GetForegroundColour().GetAsString( wxC2S_HTML_SYNTAX ); + wxString linkColor = wxSystemSettings::GetColour( wxSYS_COLOUR_HOTLIGHT ) + .GetAsString( wxC2S_HTML_SYNTAX ); + + wxString html = wxString::Format( wxT( "" ), + htmlColor, textColor, linkColor ); + if( id.IsValid() ) - m_details_ctrl->SetPage( m_adapter->GenerateInfo( id, unit ) ); - else - m_details_ctrl->SetPage( wxEmptyString ); + html.Append( m_adapter->GenerateInfo( id, unit ) ); + + html.Append( wxT( "" ) ); + + m_details_ctrl->SetPage( html ); } aEvent.Skip();