From d977f7517405934e4083ec62a838fff2f41da8af Mon Sep 17 00:00:00 2001 From: infirit Date: Sat, 22 Nov 2014 16:03:11 +0100 Subject: Gtk3: Remove frame of window-menu applet Based on gnome-panel commit: 1f086d72760569bc466de082e99a55a82ac06014 From: Carlos Garcia Campos --- applets/wncklet/window-menu.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/applets/wncklet/window-menu.c b/applets/wncklet/window-menu.c index 76dfdc58..46e63d18 100644 --- a/applets/wncklet/window-menu.c +++ b/applets/wncklet/window-menu.c @@ -155,6 +155,21 @@ static gboolean window_menu_on_expose(GtkWidget* widget, GdkEventExpose* event, static inline void force_no_focus_padding(GtkWidget* widget) { +#if GTK_CHECK_VERSION (3, 0, 0) + GtkCssProvider *provider; + + provider = gtk_css_provider_new (); + gtk_css_provider_load_from_data (provider, + "#window-menu-applet-button {\n" + " border-width: 0px;\n" + " -GtkWidget-focus-line-width: 0px;\n" + " -GtkWidget-focus-padding: 0px; }", + -1, NULL); + gtk_style_context_add_provider (gtk_widget_get_style_context (widget), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref (provider); +#else gboolean first_time = TRUE; if (first_time) @@ -170,10 +185,33 @@ static inline void force_no_focus_padding(GtkWidget* widget) "\n"); first_time = FALSE; } +#endif gtk_widget_set_name(widget, "PanelApplet-window-menu-applet-button"); } +#if GTK_CHECK_VERSION (3, 0, 0) +static inline void +force_no_shadow_and_padding (GtkWidget *widget) +{ + GtkCssProvider *provider; + + provider = gtk_css_provider_new (); + gtk_css_provider_load_from_data (provider, + "#window-menu-applet-selector {\n" + " border-width: 0px;\n" + " -GtkMenuBar-internal-padding: 0px;\n" + " -GtkMenuBar-shadow-type: none; }", + -1, NULL); + gtk_style_context_add_provider (gtk_widget_get_style_context (widget), + GTK_STYLE_PROVIDER (provider), + GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); + g_object_unref (provider); + + gtk_widget_set_name (widget, "window-menu-applet-selector"); +} +#endif + static void window_menu_size_allocate(MatePanelApplet* applet, GtkAllocation* allocation, WindowMenu* window_menu) { MatePanelAppletOrient orient; @@ -282,6 +320,9 @@ gboolean window_menu_applet_fill(MatePanelApplet* applet) g_object_unref(action_group); window_menu->selector = wnck_selector_new(); +#if GTK_CHECK_VERSION (3, 0, 0) + force_no_shadow_and_padding (window_menu->selector); +#endif gtk_container_add(GTK_CONTAINER(window_menu->applet), window_menu->selector); mate_panel_applet_set_background_widget(MATE_PANEL_APPLET(window_menu->applet), GTK_WIDGET(window_menu->selector)); -- cgit v1.2.1