diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2016-05-08 10:19:13 +0000 |
|---|---|---|
| committer | jabiertxof <info@marker.es> | 2016-05-08 10:19:13 +0000 |
| commit | 1556c1a3619c415b3a7abacfdabd89398e411a91 (patch) | |
| tree | d7718e5873db4b2c25cb3bed94fcc4c3ba87fea4 /src/main.cpp | |
| parent | remove a waring on compile (diff) | |
| parent | add missing POTFILES.in line in mirror symmetry LPE (diff) | |
| download | inkscape-1556c1a3619c415b3a7abacfdabd89398e411a91.tar.gz inkscape-1556c1a3619c415b3a7abacfdabd89398e411a91.zip | |
update to trunk
(bzr r13645.1.127)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index 840643a90..99e3ccfe6 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -52,6 +52,11 @@ #include <glib-object.h> #include <gtk/gtk.h> +#if GTK_CHECK_VERSION(3,0,0) +#include <gtkmm/cssprovider.h> +#include <gdkmm/screen.h> +#endif + #include "inkgc/gc-core.h" #ifdef AND @@ -1051,6 +1056,35 @@ sp_main_gui(int argc, char const **argv) #endif g_free(usericondir); + +#if GTK_CHECK_VERSION(3,0,0) + // Add style sheet (GTK3) + Glib::RefPtr<Gdk::Screen> screen = Gdk::Screen::get_default(); + + Glib::ustring inkscape_style = INKSCAPE_UIDIR; + inkscape_style += "/style.css"; + // std::cout << "CSS Stylesheet Inkscape: " << inkscape_style << std::endl; + Glib::RefPtr<Gtk::CssProvider> provider = Gtk::CssProvider::create(); + try { + provider->load_from_path (inkscape_style); + } + catch (const Gtk::CssProviderError& ex) + { + std::cerr << "CSSProviderError::load_from_path(): failed to load: " << inkscape_style << "\n (" << ex.what() << ")" << std::endl; + } + Gtk::StyleContext::add_provider_for_screen (screen, provider, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + + Glib::ustring user_style = Inkscape::Application::profile_path("ui/style.css"); + // std::cout << "CSS Stylesheet User: " << user_style << std::endl; + Glib::RefPtr<Gtk::CssProvider> provider2 = Gtk::CssProvider::create(); + try { + provider2->load_from_path (user_style); + } + catch (const Gtk::CssProviderError& ex) + {} + Gtk::StyleContext::add_provider_for_screen (screen, provider2, GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); +#endif + gdk_event_handler_set((GdkEventFunc)snooper, NULL, NULL); Inkscape::Debug::log_display_config(); |
