diff options
author | raveit65 <[email protected]> | 2015-09-01 16:48:22 +0200 |
---|---|---|
committer | infirit <[email protected]> | 2015-09-06 13:08:31 +0200 |
commit | a3ea605d8d2834a1842d2417dfc98c3a2ccc9177 (patch) | |
tree | 34a0867a7ddda40935b8c3be5427211670791a2f /src/main.c | |
parent | 2788b437751963cb933eadbcbc0dd5ff33fa7338 (diff) | |
download | eom-a3ea605d8d2834a1842d2417dfc98c3a2ccc9177.tar.bz2 eom-a3ea605d8d2834a1842d2417dfc98c3a2ccc9177.tar.xz |
Gtk3 thumbview: Replace deprecated GtkRCStyle usage with a GtkCssProvider
Makes EomThumbNav's scrollbar style similar to gtk2 version
inspired from:
https://git.gnome.org/browse/eog/commit/?id=4c93c41
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -50,6 +50,10 @@ #include <exempi/xmp.h> #endif +#if GTK_CHECK_VERSION (3, 0, 0) +#define EOM_CSS_FILE_PATH EOM_DATA_DIR G_DIR_SEPARATOR_S "eom.css" +#endif + static EomStartupFlags flags; static gboolean fullscreen = FALSE; @@ -187,12 +191,17 @@ main (int argc, char **argv) { GError *error = NULL; GOptionContext *ctx; +#if GTK_CHECK_VERSION (3, 0, 0) + GtkCssProvider *provider; +#endif bindtextdomain (GETTEXT_PACKAGE, EOM_LOCALE_DIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); +#if !GTK_CHECK_VERSION (3, 0, 0) gtk_rc_parse (EOM_DATA_DIR G_DIR_SEPARATOR_S "gtkrc"); +#endif ctx = g_option_context_new (NULL); g_option_context_add_main_entries (ctx, goption_options, PACKAGE); @@ -238,6 +247,25 @@ main (int argc, char **argv) eom_job_queue_init (); gdk_threads_init (); eom_thumbnail_init (); + +#if GTK_CHECK_VERSION (3, 0, 0) + /* Load special style properties for EomThumbView's scrollbar */ + provider = gtk_css_provider_new (); + if (G_UNLIKELY (!gtk_css_provider_load_from_path(provider, + EOM_CSS_FILE_PATH, + &error))) + { + g_critical ("Could not load CSS data: %s", error->message); + g_clear_error (&error); + } else { + gtk_style_context_add_provider_for_screen ( + gdk_screen_get_default(), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + } + g_object_unref (provider); +#endif + eom_plugin_engine_init (); /* Add application specific icons to search path */ |