Browse Source

Second try to get source map working.

merge-requests/365/head
eidheim 10 years ago
parent
commit
0386075506
  1. 2
      src/files.h
  2. 10
      src/notebook.cc

2
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

10
src/notebook.cc

@ -6,6 +6,10 @@
#include <regex>
#include "cmake.h"
#if GTK_VERSION_GE(3, 18)
#include "gtksourceview-3.0/gtksourceview/gtksourcemap.h"
#endif
#include <iostream> //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);

Loading…
Cancel
Save