Browse Source

Space between lines cleanup

pipelines/1486128344
eidheim 1 year ago
parent
commit
efc98b5b13
  1. 2
      CMakeLists.txt
  2. 4
      src/config.cpp
  3. 2
      src/config.hpp
  4. 2
      src/source.cpp
  5. 2
      src/source_base.cpp
  6. 5
      src/window.cpp

2
CMakeLists.txt

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
project(juci) project(juci)
set(JUCI_VERSION "1.8.0.1") set(JUCI_VERSION "1.8.0.2")
set(CPACK_PACKAGE_NAME "jucipp") set(CPACK_PACKAGE_NAME "jucipp")
set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim <eidheim@gmail.com>") set(CPACK_PACKAGE_CONTACT "Ole Christian Eidheim <eidheim@gmail.com>")

4
src/config.cpp

@ -134,11 +134,11 @@ void Config::read(const JSON &cfg) {
source.smart_brackets = true; source.smart_brackets = true;
source.show_map = source_json.boolean("show_map", JSON::ParseOptions::accept_string); source.show_map = source_json.boolean("show_map", JSON::ParseOptions::accept_string);
source.map_font_size = source_json.integer("map_font_size", JSON::ParseOptions::accept_string); source.map_font_size = source_json.integer("map_font_size", JSON::ParseOptions::accept_string);
source.space_between_lines = source_json.integer("space_between_lines", JSON::ParseOptions::accept_string);
source.show_git_diff = source_json.boolean("show_git_diff", JSON::ParseOptions::accept_string); source.show_git_diff = source_json.boolean("show_git_diff", JSON::ParseOptions::accept_string);
source.show_background_pattern = source_json.boolean("show_background_pattern", JSON::ParseOptions::accept_string); source.show_background_pattern = source_json.boolean("show_background_pattern", JSON::ParseOptions::accept_string);
source.show_right_margin = source_json.boolean("show_right_margin", JSON::ParseOptions::accept_string); source.show_right_margin = source_json.boolean("show_right_margin", JSON::ParseOptions::accept_string);
source.right_margin_position = source_json.integer("right_margin_position", JSON::ParseOptions::accept_string); source.right_margin_position = source_json.integer("right_margin_position", JSON::ParseOptions::accept_string);
source.pixels_between_lines = source_json.integer("pixels_between_lines", JSON::ParseOptions::accept_string);
source.spellcheck_language = source_json.string("spellcheck_language"); source.spellcheck_language = source_json.string("spellcheck_language");
auto default_tab_char_str = source_json.string("default_tab_char"); auto default_tab_char_str = source_json.string("default_tab_char");
if(default_tab_char_str.size() == 1) if(default_tab_char_str.size() == 1)
@ -280,11 +280,11 @@ std::string Config::default_config() {
"smart_inserts": true, "smart_inserts": true,
"show_map": true, "show_map": true,
"map_font_size": 1, "map_font_size": 1,
"space_between_lines": 1,
"show_git_diff": true, "show_git_diff": true,
"show_background_pattern": true, "show_background_pattern": true,
"show_right_margin": false, "show_right_margin": false,
"right_margin_position": 80, "right_margin_position": 80,
"pixels_between_lines": 0,
"spellcheck_language_comment": "Use \"\" to set language from your locale settings", "spellcheck_language_comment": "Use \"\" to set language from your locale settings",
"spellcheck_language": "en_US", "spellcheck_language": "en_US",
"auto_tab_char_and_size_comment": "Use false to always use default tab char and size", "auto_tab_char_and_size_comment": "Use false to always use default tab char and size",

2
src/config.hpp

@ -80,12 +80,12 @@ public:
bool smart_inserts; bool smart_inserts;
bool show_map; bool show_map;
float space_between_lines;
unsigned map_font_size; unsigned map_font_size;
bool show_git_diff; bool show_git_diff;
bool show_background_pattern; bool show_background_pattern;
bool show_right_margin; bool show_right_margin;
unsigned right_margin_position; unsigned right_margin_position;
unsigned pixels_between_lines;
bool auto_tab_char_and_size; bool auto_tab_char_and_size;
char default_tab_char; char default_tab_char;

2
src/source.cpp

@ -497,6 +497,8 @@ void Source::View::configure() {
gtk_source_view_set_background_pattern(this->gobj(), GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE); gtk_source_view_set_background_pattern(this->gobj(), GTK_SOURCE_BACKGROUND_PATTERN_TYPE_NONE);
if((property_show_right_margin() = Config::get().source.show_right_margin)) if((property_show_right_margin() = Config::get().source.show_right_margin))
property_right_margin_position() = Config::get().source.right_margin_position; property_right_margin_position() = Config::get().source.right_margin_position;
set_pixels_above_lines(Config::get().source.pixels_between_lines / 2);
set_pixels_below_lines(Config::get().source.pixels_between_lines / 2 + Config::get().source.pixels_between_lines % 2);
// Create tags for diagnostic warnings and errors: // Create tags for diagnostic warnings and errors:
auto scheme = get_source_buffer()->get_style_scheme(); auto scheme = get_source_buffer()->get_style_scheme();

2
src/source_base.cpp

@ -383,8 +383,6 @@ Source::BaseView::BaseView(const boost::filesystem::path &file_path, const Glib:
extra_cursor_selection = get_buffer()->create_tag(); extra_cursor_selection = get_buffer()->create_tag();
this->set_pixels_below_lines(Config::get().source.space_between_lines);
get_buffer()->signal_mark_set().connect([this](const Gtk::TextIter &iter, const Glib::RefPtr<Gtk::TextBuffer::Mark> &mark) { get_buffer()->signal_mark_set().connect([this](const Gtk::TextIter &iter, const Glib::RefPtr<Gtk::TextBuffer::Mark> &mark) {
if(mark->get_name() == "insert") { if(mark->get_name() == "insert") {
keep_clipboard = false; keep_clipboard = false;

5
src/window.cpp

@ -282,11 +282,8 @@ void Window::configure() {
Menu::get().set_keys(); Menu::get().set_keys();
Terminal::get().configure(); Terminal::get().configure();
Directories::get().update(); Directories::get().update();
if(auto view = Notebook::get().get_current_view()) { if(auto view = Notebook::get().get_current_view())
// Special call since this property is not part of CSS
view->set_pixels_below_lines(Config::get().source.space_between_lines);
Notebook::get().update_status(view); Notebook::get().update_status(view);
}
} }
void Window::set_menu_actions() { void Window::set_menu_actions() {

Loading…
Cancel
Save