diff options
author | lukefromdc <[email protected]> | 2018-04-18 23:50:46 -0400 |
---|---|---|
committer | monsta <[email protected]> | 2018-04-25 17:19:52 +0300 |
commit | 4437af31ff82629c18f53f6f4c38430547378af9 (patch) | |
tree | a868ecdac5ba9f23c4f95b001608cc38db1b0c52 /mate-panel/main.c | |
parent | 3a8b1f66d2393a35f40dbcc211d3bf045d563a92 (diff) | |
download | mate-panel-4437af31ff82629c18f53f6f4c38430547378af9.tar.bz2 mate-panel-4437af31ff82629c18f53f6f4c38430547378af9.tar.xz |
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
(port of 45b25410cddde852554b3153e81ad59a5e6722ad to 1.18 branch, limiting it to GTK+ 3.20/22)
Diffstat (limited to 'mate-panel/main.c')
-rw-r--r-- | mate-panel/main.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mate-panel/main.c b/mate-panel/main.c index 8355a227..a0820df0 100644 --- a/mate-panel/main.c +++ b/mate-panel/main.c @@ -60,6 +60,9 @@ main (int argc, char **argv) char *desktopfile; GOptionContext *context; GError *error; +#if GTK_CHECK_VERSION (3, 20, 0) + GtkCssProvider *provider; +#endif bindtextdomain (GETTEXT_PACKAGE, MATELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); @@ -165,6 +168,25 @@ main (int argc, char **argv) * connecting to the session manager */ panel_session_init (); +#if GTK_CHECK_VERSION (3, 20, 0) + /*Load a css file from a path so the drag handle image can be loaded*/ + error = NULL; + provider = gtk_css_provider_new (); + gtk_css_provider_load_from_path (provider, + DATADIR "/mate-panel/" "mate-panel.css", &error); + + if (error != NULL) { + g_warning ("Can't parse mate-panel CSS custom description: %s\n", error->message); + g_error_free (error); + } + 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); +#endif + gtk_main (); panel_lockdown_finalize (); |