Browse Source

Add custom background color

merge-requests/365/head
es 11 years ago
parent
commit
d57b18c144
  1. 2
      juci/config.json
  2. 3
      juci/source.cc

2
juci/config.json

@ -1,7 +1,7 @@
{ {
"source": { "source": {
"colors": { "colors": {
"text_color": "#333333", "text_color": "black",
"string": "#CC0000", "string": "#CC0000",
"namespace_ref": "#990099", "namespace_ref": "#990099",
"type": "#0066FF", "type": "#0066FF",

3
juci/source.cc

@ -49,12 +49,13 @@ string Source::View::GetLineBeforeInsert() {
return line; return line;
} }
// Source::View::ApplyTheme() // Source::View::ApplyConfig
// Applies theme in textview // Applies theme in textview
void Source::View::ApplyConfig(const Source::Config &config) { void Source::View::ApplyConfig(const Source::Config &config) {
override_font(Pango::FontDescription(config.font)); override_font(Pango::FontDescription(config.font));
set_show_line_numbers(config.show_line_numbers); set_show_line_numbers(config.show_line_numbers);
set_highlight_current_line(config.highlight_current_line); set_highlight_current_line(config.highlight_current_line);
this->override_background_color(Gdk::RGBA(config.background));
for (auto &item : config.tagtable()) { for (auto &item : config.tagtable()) {
get_buffer()->create_tag(item.first)->property_foreground() = item.second; get_buffer()->create_tag(item.first)->property_foreground() = item.second;
} }

Loading…
Cancel
Save