diff options
author | infirit <infirit@gmail.com> | 2014-11-22 16:03:11 +0100 |
---|---|---|
committer | infirit <infirit@gmail.com> | 2014-11-22 16:03:11 +0100 |
commit | d977f7517405934e4083ec62a838fff2f41da8af (patch) | |
tree | 2f1d03dd533cd5f591702f08e34a80bdfe0a28f7 | |
parent | cbff26a9c43c7d8722670aee04715a9edfb2e904 (diff) | |
download | mate-panel-d977f7517405934e4083ec62a838fff2f41da8af.tar.bz2 mate-panel-d977f7517405934e4083ec62a838fff2f41da8af.tar.xz |
Gtk3: Remove frame of window-menu applet
Based on gnome-panel commit: 1f086d72760569bc466de082e99a55a82ac06014
From: Carlos Garcia Campos <carlosgc@gnome.org>
-rw-r--r-- | applets/wncklet/window-menu.c | 41 |
1 files changed, 41 insertions, 0 deletions
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)); |