From 5f48bd2e6dc6140db21ef6f583dff8faf3c6bcc3 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 25 Sep 2015 12:04:18 +0200 Subject: [PATCH] Minor fixes to sourcemap. --- src/config.cc | 2 +- src/files.h | 2 +- src/notebook.cc | 8 ++++---- src/source.h | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/config.cc b/src/config.cc index eefce89..13cc842 100644 --- a/src/config.cc +++ b/src/config.cc @@ -119,7 +119,7 @@ void MainConfig::GenerateSource() { source_cfg->font=source_json.get("font"); source_cfg->show_map = source_json.get("show_map"); - source_cfg->map_font_size = source_json.get("map_font_size"); + source_cfg->map_font_size = source_json.get("map_font_size"); source_cfg->spellcheck_language = source_json.get("spellcheck_language"); diff --git a/src/files.h b/src/files.h index 12de49e..5c9b436 100644 --- a/src/files.h +++ b/src/files.h @@ -27,7 +27,7 @@ const std::string configjson = #endif "//Use \"\" for default font, and for instance \"Monospace 12\" to also set size.\n" " \"show_map\": true,\n" -" \"map_font_size\": 1,\n" +" \"map_font_size\": \"1\",\n" " \"spellcheck_language\": \"en_US\", //Use \"\" to set language from your locale settings\n" " \"clang_types\": {\n" " \"8\": \"def:function\",\n" diff --git a/src/notebook.cc b/src/notebook.cc index ab7cc4c..053e1c7 100644 --- a/src/notebook.cc +++ b/src/notebook.cc @@ -143,7 +143,7 @@ void Notebook::open(const boost::filesystem::path &file_path) { void Notebook::configure(int view_nr) { #if GTK_VERSION_GE(3, 18) - auto font_desc=Pango::FontDescription("Monospace "+std::to_string(Singleton::Config::source()->map_font_size)); //Seems to only work with Monospace + auto font_desc=Pango::FontDescription("Monospace "+Singleton::Config::source()->map_font_size); //Seems to only work with Monospace source_maps.at(view_nr)->override_font(font_desc); if(Singleton::Config::source()->show_map) source_maps.at(view_nr)->show(); @@ -218,15 +218,15 @@ bool Notebook::close_current_page() { int page = get_current_page(); int index=get_index(page); remove_page(page); +#if GTK_VERSION_GE(3, 18) + source_maps.erase(source_maps.begin()+index); +#endif auto source_view=source_views.at(index); if(auto source_clang_view=dynamic_cast(source_view)) source_clang_view->async_delete(); else delete source_view; source_views.erase(source_views.begin()+index); -#if GTK_VERSION_GE(3, 18) - source_maps.erase(source_maps.begin()+index); -#endif scrolled_windows.erase(scrolled_windows.begin()+index); hboxes.erase(hboxes.begin()+index); } diff --git a/src/source.h b/src/source.h index cae4539..88c3735 100644 --- a/src/source.h +++ b/src/source.h @@ -28,7 +28,7 @@ namespace Source { std::string spellcheck_language; bool show_map; - unsigned map_font_size; + std::string map_font_size; bool auto_tab_char_and_size; char default_tab_char;