[Xfce4-commits] [xfce/xfce4-panel] 01/01: Fix applicationmenu button with Adwaita

noreply at xfce.org noreply at xfce.org
Thu Mar 2 00:36:17 CET 2017


This is an automated email from the git hooks/post-receive script.

ochosi pushed a commit to branch master
in repository xfce/xfce4-panel.

commit 1cd8238f431cb41e21c34d39bcc5443a72b07f97
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Thu Mar 2 00:36:10 2017 +0100

    Fix applicationmenu button with Adwaita
    
    Again prevent the excessive padding from some
    themes to prevent proper rendering of the button.
---
 plugins/applicationsmenu/applicationsmenu.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/plugins/applicationsmenu/applicationsmenu.c b/plugins/applicationsmenu/applicationsmenu.c
index ccd976c..295fdec 100644
--- a/plugins/applicationsmenu/applicationsmenu.c
+++ b/plugins/applicationsmenu/applicationsmenu.c
@@ -199,6 +199,9 @@ applications_menu_plugin_class_init (ApplicationsMenuPluginClass *klass)
 static void
 applications_menu_plugin_init (ApplicationsMenuPlugin *plugin)
 {
+  GtkStyleContext *context;
+  GtkCssProvider *provider;
+
   /* init garcon environment */
   garcon_set_environment_xdg (GARCON_ENVIRONMENT_XFCE);
 
@@ -234,6 +237,15 @@ applications_menu_plugin_init (ApplicationsMenuPlugin *plugin)
                                                    G_CALLBACK (applications_menu_button_theme_changed), plugin);
   plugin->screen_changed_id = g_signal_connect_swapped (G_OBJECT (plugin->button), "screen-changed",
                                                         G_CALLBACK (applications_menu_button_theme_changed), plugin);
+
+  /* Make sure themes like Adwaita, which set excessive padding, don't cause the
+     launcher buttons to overlap when panels have a fairly normal size */
+  context = gtk_widget_get_style_context (GTK_WIDGET (plugin->button));
+  provider = gtk_css_provider_new ();
+  gtk_css_provider_load_from_data (provider, ".xfce4-panel button { padding: 0; }", -1, NULL);
+  gtk_style_context_add_provider (context,
+                                  GTK_STYLE_PROVIDER (provider),
+                                  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 }
 
 
@@ -833,4 +845,3 @@ applications_menu_button_theme_changed (ApplicationsMenuPlugin *plugin)
   applications_menu_plugin_size_changed (panel_plugin,
       xfce_panel_plugin_get_size (panel_plugin));
 }
-

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list