summaryrefslogtreecommitdiff
path: root/applets/wncklet/showdesktop.c
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-11-23 10:08:46 +0100
committerinfirit <[email protected]>2014-11-23 10:08:46 +0100
commit782655a3d3d0626b8ae8717a02f60d56fe0a8fea (patch)
tree007a04f7878890f492bdb2b449553f68701a5ce8 /applets/wncklet/showdesktop.c
parentaefcd8adde437f4cfbcb6ce69ed54a696da22527 (diff)
downloadmate-panel-782655a3d3d0626b8ae8717a02f60d56fe0a8fea.tar.bz2
mate-panel-782655a3d3d0626b8ae8717a02f60d56fe0a8fea.tar.xz
Gtk3: showdesktop: Port to GtkStyleContext
Based on gnome-panel commit: fb1fa7ef2087b68fc7e7a01050e4c6747e8771e8 From: Carlos Garcia Campos <[email protected]>
Diffstat (limited to 'applets/wncklet/showdesktop.c')
-rw-r--r--applets/wncklet/showdesktop.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/applets/wncklet/showdesktop.c b/applets/wncklet/showdesktop.c
index efe19ab2..ae4afc43 100644
--- a/applets/wncklet/showdesktop.c
+++ b/applets/wncklet/showdesktop.c
@@ -377,6 +377,9 @@ gboolean show_desktop_applet_fill(MatePanelApplet* applet)
GtkActionGroup* action_group;
gchar* ui_path;
AtkObject* atk_obj;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GtkCssProvider *provider;
+#endif
mate_panel_applet_set_flags(applet, MATE_PANEL_APPLET_EXPAND_MINOR);
@@ -406,6 +409,19 @@ gboolean show_desktop_applet_fill(MatePanelApplet* applet)
sdd->button = gtk_toggle_button_new ();
gtk_widget_set_name (sdd->button, "showdesktop-button");
+#if GTK_CHECK_VERSION (3, 0, 0)
+ provider = gtk_css_provider_new ();
+ gtk_css_provider_load_from_data (provider,
+ "#showdesktop-button {\n"
+ " -GtkWidget-focus-line-width: 0px;\n"
+ " -GtkWidget-focus-padding: 0px; }",
+ -1, NULL);
+
+ gtk_style_context_add_provider (gtk_widget_get_style_context (sdd->button),
+ GTK_STYLE_PROVIDER (provider),
+ GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
+ g_object_unref (provider);
+#else
gtk_rc_parse_string ("\n"
" style \"showdesktop-button-style\"\n"
" {\n"
@@ -415,6 +431,7 @@ gboolean show_desktop_applet_fill(MatePanelApplet* applet)
"\n"
" widget \"*.showdesktop-button\" style \"showdesktop-button-style\"\n"
"\n");
+#endif
atk_obj = gtk_widget_get_accessible(sdd->button);
atk_object_set_name (atk_obj, _("Show Desktop Button"));