Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Customizing colors into dark
neurocore:
Hi all! I use Code::Blocks a few years, and decided to change editor style to reduce eye fatigue. Just tried to customize IDE by settings -> editor -> syntax highlighting & margins and caret. But there are 3 problems:
1. I found no way to change the color of the line numbers. It still whitish.
2. Can editor interpret preprocessor commands separately from their arguments? Monolith color is annoying.
3. How to customize Logs & others?
There are 2 screenshots: what i want to achieve, and what i get with Code::Blocks.
[attachment deleted by admin]
oBFusCATed:
--- Quote from: neurocore on September 20, 2013, 05:22:24 am ---1. I found no way to change the color of the line numbers. It still whitish.
3. How to customize Logs & others?
--- End quote ---
For both of these you'll have to install a darker windows theme. Unfortunately wxWidgets tries to look as native as possible.
eranif:
--- Quote ---For both of these you'll have to install a darker windows theme
--- End quote ---
This is not entirely correct...
The colour of the line numbers and folding margin can be customized using wxSctinilla API calls
--- Code: ---// 33 is the line number style
wxScintilla::StyleSetBackground(33, "RED");
wxScintilla::StyleSetForeground(33, "YELLOW");
--- End code ---
// Fold margin:
--- Code: ---wxScintilla::SetFoldMarginColour
wxScintilla::SetFoldMarginHiColour
--- End code ---
Ofc, someone needs to step up and implement it ;)
Eran
oBFusCATed:
--- Quote from: eranif on September 20, 2013, 09:48:24 am ---Ofc, someone needs to step up and implement it ;)
--- End quote ---
This is quite easy with our new colours system :)
Thanks for letting us know about these apis, Eranif.
oBFusCATed:
Hm, it seems that setting the background for line numbers doesn't work on wxGTK.
All the other calls seems to work. Can someone test this on windows:
--- Code: ---Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp (revision 9361)
+++ src/sdk/cbeditor.cpp (working copy)
@@ -1293,6 +1293,11 @@ void cbEditor::InternalSetEditorStyleBeforeFileOpen(cbStyledTextCtrl* control)
control->SetCaretLineVisible(mgr->ReadBool(_T("/highlight_caret_line"), false));
control->SetCaretLineBackground(GetOptionColour(_T("/highlight_caret_line_colour"), wxColour(0xFF, 0xFF, 0x00)));
+ control->StyleSetBackground(wxSCI_STYLE_LINENUMBER, *wxRED);
+ control->StyleSetForeground(wxSCI_STYLE_LINENUMBER, *wxBLACK);
+ control->SetFoldMarginColour(true, *wxRED);
+ control->SetFoldMarginHiColour(true, *wxBLACK);
+
// setup for "CamelCase selection"
if (mgr->ReadBool(_T("/camel_case"), false))
{
Index: src/sdk/editorcolourset.cpp
===================================================================
--- src/sdk/editorcolourset.cpp (revision 9361)
+++ src/sdk/editorcolourset.cpp (working copy)
@@ -479,6 +479,8 @@ wxString EditorColourSet::GetLanguageName(HighlightLanguage lang)
void EditorColourSet::DoApplyStyle(cbStyledTextCtrl* control, int value, OptionColour* option)
{
+ if (value==33)
+ std::terminate();
// option->value is ignored here...
// value is used instead
if (option->fore != wxNullColour)
@@ -534,10 +536,10 @@ 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));
+// // 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));
for (unsigned int i = 0; i < mset.m_Colours.GetCount(); ++i)
{
--- End code ---
Navigation
[0] Message Index
[#] Next page
Go to full version