Patch #3426 2013-03-01 12:35

mgimenez

Allow modify "start here page" background colour
Download
3426-Allow_modify_s.patch (1.9 KB)
Category
Application::Refinement
Status
Accepted
Close date
2013-09-20 10:13
Assigned to
mortenmacfly
Index: src/src/startherepage.cpp
===================================================================
--- src/src/startherepage.cpp    (revisiĆ³n: 8890)
+++ src/src/startherepage.cpp    (copia de trabajo)
@@ -217,9 +217,6 @@
     buf.Replace(_T("CB_VAR_VERSION"), appglobals::AppActualVersion);
     buf.Replace(_T("CB_SAFE_MODE"), PluginManager::GetSafeMode() ? _("SAFE MODE") : _T(""));
 
-    wxColour bgColour = wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND);
-    buf.Replace(wxT("CB_BODY_BGCOLOUR"), bgColour.GetAsString(wxC2S_HTML_SYNTAX));
-
     m_OriginalPageContent = buf; // keep a copy of original for Reload()
     Reload();
 
@@ -241,6 +238,7 @@
         return;
     inited = true;
     ColourManager *colours = Manager::Get()->GetColourManager();
+    colours->RegisterColour(_("Start here page"), _("Background colour"), wxT("start_here_background"), wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND));
     colours->RegisterColour(_("Start here page"), _("Link colour"), wxT("start_here_link"), *wxBLUE);
     colours->RegisterColour(_("Start here page"), _("Text colour"), wxT("start_here_text"), *wxBLACK);
 }
@@ -250,10 +248,13 @@
     // Called every time something in the history changes.
     wxString buf = m_OriginalPageContent;
     ColourManager *colours = Manager::Get()->GetColourManager();
+
+    const wxString &backgroundColour = colours->GetColour(wxT("start_here_background")).GetAsString(wxC2S_HTML_SYNTAX);
     const wxString &linkColour = colours->GetColour(wxT("start_here_link")).GetAsString(wxC2S_HTML_SYNTAX);
     const wxString &textColour = colours->GetColour(wxT("start_here_text")).GetAsString(wxC2S_HTML_SYNTAX);
     ReplaceRecentProjectFiles(buf, *m_projects, *m_files, linkColour, textColour);
 
+    buf.Replace(wxT("CB_BODY_BGCOLOUR"), backgroundColour);
     buf.Replace(wxT("CB_LINK_COLOUR"), linkColour);
     buf.Replace(wxT("CB_TEXT_COLOUR"), textColour);
 
mgimenez 2013-03-01 13:36

In 8875 tpetrov hard-linked the start here page background to the desktop colour. This (at least for me) is annoying, so I propose making it user-selectable like link/text colours are.