← Back to team overview

kicad-developers team mailing list archive

Re: New log widged - bacground trouble

 

On 26.06.2015 16:38, LordBlick wrote:
> In response to a message written on 26.06.2015, 14:24, from Tomasz
> Wlostowski:
>> On 26.06.2015 14:05, LordBlick wrote:
>>> Can I find out who carried out the attack on my eyes with the white
>>> background? 😜
>> Dawid,
>>
>> I did. Feel free to send us a patch which changes the colors the way you
>> like. We'll accept it as long as I'm still able to work with white
>> background.
> In the past when log was not colorized it was nice white in my system,

Given the number of Linux flavors out there, and the way people
customize their systems, it's next to impossible to make things render
correctly under every single Linux distro/setup... Maybe this is the
reason why there's been no The Year Of The Linux On Desktop yet (I use
Linux everyday, I'm far from trolling Linux users).

Same with OpenGL support - there are still people who say that a 10-year
old standard (OGL 2.1) is too new and it won't work on their, usually
heavily customized, machines.

> as in
> entry widget above. No offense, only indicates a problem.
I don't feel offended and I hope I didn't offend you (sorry if I did, it
was not deliberate). Orson made a quick patch (attached), you might want
to give it a try...

> Can you write about which file is responsible for log class? I'll try fix.

common/dialogs/wx_html_report_panel.cpp

Thank for your contribution,
Tom

diff --git a/common/dialogs/wx_html_report_panel.cpp b/common/dialogs/wx_html_report_panel.cpp
index c2eb05b..846a524 100644
--- a/common/dialogs/wx_html_report_panel.cpp
+++ b/common/dialogs/wx_html_report_panel.cpp
@@ -35,6 +35,7 @@ WX_HTML_REPORT_PANEL::WX_HTML_REPORT_PANEL( wxWindow*      parent,
     m_showAll( true )
 {
     syncCheckboxes();
+    m_htmlView->SetPage( addHeader( "" ) );
 }
 
 
@@ -79,10 +80,20 @@ void WX_HTML_REPORT_PANEL::refreshView()
         html += generateHtml( l );
     }
 
-    m_htmlView->SetPage( html );
+    m_htmlView->SetPage( addHeader( html ) );
     scrollToBottom();
 }
 
+wxString WX_HTML_REPORT_PANEL::addHeader( const wxString& aBody )
+{
+    wxColour bgcolor = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
+    wxString s = "<html><body bgcolor=\"" + bgcolor.GetAsString(wxC2S_HTML_SYNTAX) + "\">";
+    s += aBody;
+    s += "</body></html>";
+
+    return s;
+}
+
 
 wxString WX_HTML_REPORT_PANEL::generateHtml( const REPORT_LINE& aLine )
 {
diff --git a/common/dialogs/wx_html_report_panel.h b/common/dialogs/wx_html_report_panel.h
index 9fe23fb..953a49b 100644
--- a/common/dialogs/wx_html_report_panel.h
+++ b/common/dialogs/wx_html_report_panel.h
@@ -64,6 +64,7 @@ private:
 
     typedef std::vector<REPORT_LINE> REPORT_LINES;
 
+    wxString addHeader( const wxString& aBody );
     wxString generateHtml( const REPORT_LINE& aLine );
     wxString generatePlainText( const REPORT_LINE& aLine );
 

Follow ups

References