Browse Source

Minor fixes to sourcemap.

merge-requests/365/head
eidheim 10 years ago
parent
commit
5f48bd2e6d
  1. 2
      src/config.cc
  2. 2
      src/files.h
  3. 8
      src/notebook.cc
  4. 2
      src/source.h

2
src/config.cc

@ -119,7 +119,7 @@ void MainConfig::GenerateSource() {
source_cfg->font=source_json.get<std::string>("font"); source_cfg->font=source_json.get<std::string>("font");
source_cfg->show_map = source_json.get<bool>("show_map"); source_cfg->show_map = source_json.get<bool>("show_map");
source_cfg->map_font_size = source_json.get<unsigned>("map_font_size"); source_cfg->map_font_size = source_json.get<std::string>("map_font_size");
source_cfg->spellcheck_language = source_json.get<std::string>("spellcheck_language"); source_cfg->spellcheck_language = source_json.get<std::string>("spellcheck_language");

2
src/files.h

@ -27,7 +27,7 @@ const std::string configjson =
#endif #endif
"//Use \"\" for default font, and for instance \"Monospace 12\" to also set size.\n" "//Use \"\" for default font, and for instance \"Monospace 12\" to also set size.\n"
" \"show_map\": true,\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" " \"spellcheck_language\": \"en_US\", //Use \"\" to set language from your locale settings\n"
" \"clang_types\": {\n" " \"clang_types\": {\n"
" \"8\": \"def:function\",\n" " \"8\": \"def:function\",\n"

8
src/notebook.cc

@ -143,7 +143,7 @@ void Notebook::open(const boost::filesystem::path &file_path) {
void Notebook::configure(int view_nr) { void Notebook::configure(int view_nr) {
#if GTK_VERSION_GE(3, 18) #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); source_maps.at(view_nr)->override_font(font_desc);
if(Singleton::Config::source()->show_map) if(Singleton::Config::source()->show_map)
source_maps.at(view_nr)->show(); source_maps.at(view_nr)->show();
@ -218,15 +218,15 @@ bool Notebook::close_current_page() {
int page = get_current_page(); int page = get_current_page();
int index=get_index(page); int index=get_index(page);
remove_page(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); auto source_view=source_views.at(index);
if(auto source_clang_view=dynamic_cast<Source::ClangView*>(source_view)) if(auto source_clang_view=dynamic_cast<Source::ClangView*>(source_view))
source_clang_view->async_delete(); source_clang_view->async_delete();
else else
delete source_view; delete source_view;
source_views.erase(source_views.begin()+index); 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); scrolled_windows.erase(scrolled_windows.begin()+index);
hboxes.erase(hboxes.begin()+index); hboxes.erase(hboxes.begin()+index);
} }

2
src/source.h

@ -28,7 +28,7 @@ namespace Source {
std::string spellcheck_language; std::string spellcheck_language;
bool show_map; bool show_map;
unsigned map_font_size; std::string map_font_size;
bool auto_tab_char_and_size; bool auto_tab_char_and_size;
char default_tab_char; char default_tab_char;

Loading…
Cancel
Save