Browse Source

Merge pull request #3 from cppit/master

Pull cppit/jucipp
merge-requests/365/head
Ole Christian Eidheim 11 years ago
parent
commit
798280c418
  1. 3
      juci/config.cc
  2. 2
      juci/config.json
  3. 3
      juci/source.cc

3
juci/config.cc

@ -26,15 +26,12 @@ void MainConfig::GenerateSource() {
}
if (i.first == "show_line_numbers") {
source_cfg.show_line_numbers = i.second.get_value<std::string>() == "1" ? true : false;
std::cout << source_cfg.show_line_numbers << std::endl;
}
if (i.first == "highlight_current_line") {
source_cfg.highlight_current_line = i.second.get_value<std::string>() == "1" ? true : false;
std::cout << source_cfg.highlight_current_line << std::endl;
}
if (i.first == "font") {
source_cfg.font = i.second.get_value<std::string>();
std::cout << source_cfg.font << std::endl;
}
}
source_cfg.tab_size = source_json.get<unsigned>("tab_size");

2
juci/config.json

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

3
juci/source.cc

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

Loading…
Cancel
Save