From 45b25410cddde852554b3153e81ad59a5e6722ad Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Wed, 18 Apr 2018 23:50:46 -0400 Subject: Theme: consistant theming for applet drag handles in all themes * applet drag-handle: use a symbolic image for the default drag handle image * Use an .svg image with --gtk-recolor (like a symbolic icon), load it from the same directory as the css file so the css parser can find it, and use the theme fg color on it for good contrast * load a css file to use the recolorable image globally for the panel, not for each applet to ensure only one cssprovider is loaded --- mate-panel/main.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'mate-panel/main.c') diff --git a/mate-panel/main.c b/mate-panel/main.c index 4289c158..dc136cda 100644 --- a/mate-panel/main.c +++ b/mate-panel/main.c @@ -60,7 +60,8 @@ main (int argc, char **argv) { char *desktopfile; GOptionContext *context; - GError *error; + GError *error, *error2; + GtkCssProvider *provider; bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); @@ -166,6 +167,23 @@ main (int argc, char **argv) * connecting to the session manager */ panel_session_init (); + /*Load a css file from a path so the drag handle image can be loaded*/ + error2 = NULL; + provider = gtk_css_provider_new (); + gtk_css_provider_load_from_path (provider, + DATADIR "/mate-panel/" "mate-panel.css", &error2); + + if (error2 != NULL) { + g_warning ("Can't parse mate-panel CSS custom description: %s\n", error2->message); + g_error_free (error2); + } + else { + gtk_style_context_add_provider_for_screen (gdk_screen_get_default(), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_FALLBACK); + } + g_object_unref (provider); + gtk_main (); panel_lockdown_finalize (); -- cgit v1.2.1