From 03860755061548c445d75306b021f14a70fbdfcd Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 25 Sep 2015 10:38:38 +0200 Subject: [PATCH] Second try to get source map working. --- src/files.h | 2 +- src/notebook.cc | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/files.h b/src/files.h index dd14d1a..317c84e 100644 --- a/src/files.h +++ b/src/files.h @@ -15,7 +15,7 @@ const std::string configjson = " \"variant\": \"\" //Use \"\" for default variant, and \"dark\" for dark theme variant\n" " },\n" " \"source\": {\n" -" \"style\": \"juci-light\", //Use \"\" for default style, and for instance juci-dark together with dark gtk_theme variant. Styles from normal gtksourceview install: classic, cobalt, kate, oblivion, solarized-dark, solarized-light, tango\n" +" \"style\": \"juci-light\", //Use \"\" for default style, and for instance juci-dark or juci-dark-blue together with dark gtk_theme variant. Styles from normal gtksourceview install: classic, cobalt, kate, oblivion, solarized-dark, solarized-light, tango\n" #ifdef __APPLE__ " \"font\": \"Menlo 11\", " #else diff --git a/src/notebook.cc b/src/notebook.cc index ba6e255..0b01cfe 100644 --- a/src/notebook.cc +++ b/src/notebook.cc @@ -6,6 +6,10 @@ #include #include "cmake.h" +#if GTK_VERSION_GE(3, 18) +#include "gtksourceview-3.0/gtksourceview/gtksourcemap.h" +#endif + #include //TODO: remove using namespace std; //TODO: remove @@ -103,10 +107,12 @@ void Notebook::open(const boost::filesystem::path &file_path) { #if GTK_VERSION_GE(3, 18) source_maps.emplace_back(Glib::wrap(gtk_source_map_new())); - gtk_source_map_set_view(GTK_SOURCE_MAP(source_maps.back()->gobj()), source_views.back()->gobj()); + auto font_desc=Pango::FontDescription(Singleton::Config::source()->font); + font_desc.set_size(1); + source_maps.back()->override_font(font_desc); hboxes.back()->pack_end(*source_maps.back(), Gtk::PACK_SHRINK); + gtk_source_map_set_view(GTK_SOURCE_MAP(source_maps.back()->gobj()), source_views.back()->gobj()); #endif - std::string title=file_path.filename().string(); append_page(*hboxes.back(), title);