From b3a577167cf36d93c60c26c83661429a5dfa6aca Mon Sep 17 00:00:00 2001 From: eidheim Date: Thu, 23 Jun 2016 16:43:31 +0200 Subject: [PATCH] Added option to turn off source background pattern --- src/config.cc | 2 ++ src/config.h | 1 + src/files.h | 3 ++- src/source.cc | 5 ++++- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/config.cc b/src/config.cc index 2d7157b..53dbab9 100644 --- a/src/config.cc +++ b/src/config.cc @@ -195,6 +195,8 @@ void Config::get_source() { source.map_font_size = source_json.get("map_font_size"); source.show_git_diff = source_json.get("show_git_diff"); + + source.show_background_pattern = source_json.get("show_background_pattern"); source.spellcheck_language = source_json.get("spellcheck_language"); diff --git a/src/config.h b/src/config.h index d537c6a..031c564 100644 --- a/src/config.h +++ b/src/config.h @@ -61,6 +61,7 @@ public: bool show_map; std::string map_font_size; bool show_git_diff; + bool show_background_pattern; bool auto_tab_char_and_size; char default_tab_char; diff --git a/src/files.h b/src/files.h index ac1d96c..c51ff4d 100644 --- a/src/files.h +++ b/src/files.h @@ -2,7 +2,7 @@ #define JUCI_FILES_H_ #include -#define JUCI_VERSION "1.2.0-rc3" +#define JUCI_VERSION "1.2.0-rc4" const std::string default_config_file = R"RAW({ "version": ")RAW"+std::string(JUCI_VERSION)+R"RAW(", @@ -45,6 +45,7 @@ R"RAW( "show_map": true, "map_font_size": "1", "show_git_diff": true, + "show_background_pattern": true, "spellcheck_language_comment": "Use \"\" to set language from your locale settings", "spellcheck_language": "en_US", "auto_tab_char_and_size_comment": "Use false to always use default tab char and size", diff --git a/src/source.cc b/src/source.cc index 85decd6..0f8bf3b 100644 --- a/src/source.cc +++ b/src/source.cc @@ -331,7 +331,10 @@ void Source::View::configure() { if(Config::get().source.font.size()>0) override_font(Pango::FontDescription(Config::get().source.font)); #if GTKSOURCEVIEWMM_MAJOR_VERSION > 2 & GTKSOURCEVIEWMM_MINOR_VERSION > 15 - gtk_source_view_set_background_pattern(this->gobj(), GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID); + if(Config::get().source.show_background_pattern) + gtk_source_view_set_background_pattern(this->gobj(), GTK_SOURCE_BACKGROUND_PATTERN_TYPE_GRID); + else + gtk_source_view_set_background_pattern(this->gobj(), GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE); #endif //Create tags for diagnostic warnings and errors: