Commit 592bb59c authored by Victor Ananjevsky's avatar Victor Ananjevsky

fix load custom css for gtk3

parent 30a7c2fc
......@@ -38,10 +38,6 @@ static GtkWidget *dialog = NULL;
static gint ret = YAD_RESPONSE_ESC;
#if GTK_CHECK_VERSION(3,0,0)
static GtkCssProvider *css = NULL;
#endif
YadNTabs *tabs;
gint t_sem;
......@@ -657,11 +653,6 @@ create_dialog (void)
}
#endif
#if GTK_CHECK_VERSION(3,0,0)
if (css)
gtk_style_context_add_provider (gtk_widget_get_style_context (dlg), css, GTK_STYLE_PROVIDER_PRIORITY_USER);
#endif
return dlg;
}
......@@ -687,11 +678,6 @@ create_plug (void)
if (box)
gtk_container_add (GTK_CONTAINER (win), box);
#if GTK_CHECK_VERSION(3,0,0)
if (css)
gtk_style_context_add_provider (gtk_widget_get_style_context (win), css, GTK_STYLE_PROVIDER_PRIORITY_USER);
#endif
gtk_widget_show_all (win);
/* add plug data */
......@@ -812,8 +798,11 @@ main (gint argc, gchar ** argv)
#if !GTK_CHECK_VERSION(3,0,0)
gtk_rc_parse (options.gtkrc_file);
#else
css = gtk_css_provider_new ();
GtkCssProvider *css = gtk_css_provider_new ();
gtk_css_provider_load_from_path (css, options.gtkrc_file, NULL);
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (), GTK_STYLE_PROVIDER (css),
GTK_STYLE_PROVIDER_PRIORITY_USER);
g_object_unref (css);
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment