Here is a patch that allows the user to change the colours of line numbers and the margin.
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp (revision 9363)
+++ src/sdk/cbeditor.cpp (working copy)
@@ -1288,11 +1288,17 @@ void cbEditor::InternalSetEditorStyleBeforeFileOpen(cbStyledTextCtrl* control)
control->SetCaretWidth(mgr->ReadInt(_T("/caret/width"), 1));
else
control->SetCaretWidth(1);
- control->SetCaretForeground(Manager::Get()->GetColourManager()->GetColour(wxT("editor_caret")));
+
+ ColourManager *colours = Manager::Get()->GetColourManager();
+
+ control->SetCaretForeground(colours->GetColour(wxT("editor_caret")));
control->SetCaretPeriod(mgr->ReadInt(_T("/caret/period"), 500));
control->SetCaretLineVisible(mgr->ReadBool(_T("/highlight_caret_line"), false));
control->SetCaretLineBackground(GetOptionColour(_T("/highlight_caret_line_colour"), wxColour(0xFF, 0xFF, 0x00)));
+ control->SetFoldMarginColour(true, colours->GetColour(wxT("editor_margin_chrome")));
+ control->SetFoldMarginHiColour(true, colours->GetColour(wxT("editor_margin_chrome_highlight")));
+
// setup for "CamelCase selection"
if (mgr->ReadBool(_T("/camel_case"), false))
{
Index: src/sdk/editorcolourset.cpp
===================================================================
--- src/sdk/editorcolourset.cpp (revision 9363)
+++ src/sdk/editorcolourset.cpp (working copy)
@@ -25,6 +25,7 @@
#include <wx/txtstrm.h> // wxTextInputStream
#include <wx/wfstream.h> // wxFileInputStream
+#include "cbcolourmanager.h"
#include "cbstyledtextctrl.h"
#include "editorcolourset.h"
@@ -534,10 +535,11 @@ void EditorColourSet::Apply(HighlightLanguage lang, cbStyledTextCtrl* control, b
DoApplyStyle(control, i, defaults);
}
}
- // for some strange reason, when switching styles, the line numbering changes colour
- // too, though we didn't ask it to...
- // this makes sure it stays the correct colour
- control->StyleSetForeground(wxSCI_STYLE_LINENUMBER, wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
+
+ // Calling StyleClearAll above clears the style for the line numbers, so we have to re-apply it.
+ ColourManager *colours = Manager::Get()->GetColourManager();
+ control->StyleSetForeground(wxSCI_STYLE_LINENUMBER, colours->GetColour(wxT("editor_linenumbers_fg")));
+ control->StyleSetBackground(wxSCI_STYLE_LINENUMBER, colours->GetColour(wxT("editor_linenumbers_bg")));
for (unsigned int i = 0; i < mset.m_Colours.GetCount(); ++i)
{
Index: src/sdk/editormanager.cpp
===================================================================
--- src/sdk/editormanager.cpp (revision 9363)
+++ src/sdk/editormanager.cpp (working copy)
@@ -166,6 +166,16 @@ EditorManager::EditorManager()
ColourManager *colours = Manager::Get()->GetColourManager();
colours->RegisterColour(_("Editor"), _("Caret"), wxT("editor_caret"), *wxBLACK);
colours->RegisterColour(_("Editor"), _("Right margin"), wxT("editor_gutter"), *wxLIGHT_GREY);
+ colours->RegisterColour(_("Editor"), _("Line numbers foreground colour"), wxT("editor_linenumbers_fg"),
+ wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
+ colours->RegisterColour(_("Editor"), _("Line numbers background colour"), wxT("editor_linenumbers_bg"),
+ wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
+
+ // These two are taken from Platform::Chrome() and Platform::ChromeHightlight()
+ colours->RegisterColour(_("Editor"), _("Margin chrome colour"), wxT("editor_margin_chrome"),
+ wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
+ colours->RegisterColour(_("Editor"), _("Margin chrome highlight colour"), wxT("editor_margin_chrome_highlight"),
+ wxSystemSettings::GetColour(wxSYS_COLOUR_3DHIGHLIGHT));
}
EditorManager::~EditorManager()