From 510df65843192f42630b3a6113ebd6cc2dee1147 Mon Sep 17 00:00:00 2001 From: Carlos Soriano Date: Mon, 7 Mar 2016 21:03:19 +0100 Subject: floating-bar: make the stop smaller than normal buttons With the latest changes on gtk+ the button sizing changed and made the button in the floating bar taller. To fix it, remove the padding from the button. Also improve how the button is created using the "new" gtk+ functions. https://bugzilla.gnome.org/show_bug.cgi?id=763249 --- src/nautilus-floating-bar.c | 15 ++++++++------- src/resources/css/Adwaita.css | 4 ++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/nautilus-floating-bar.c b/src/nautilus-floating-bar.c index da1bde0d1..7345f7187 100644 --- a/src/nautilus-floating-bar.c +++ b/src/nautilus-floating-bar.c @@ -478,14 +478,15 @@ nautilus_floating_bar_add_action (NautilusFloatingBar *self, const gchar *icon_name, gint action_id) { - GtkWidget *w, *button; - - w = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); - gtk_widget_show (w); + GtkWidget *button; + GtkStyleContext *context; - button = gtk_button_new (); - gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE); - gtk_button_set_image (GTK_BUTTON (button), w); + button = gtk_button_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); + context = gtk_widget_get_style_context (button); + gtk_button_set_relief (button, GTK_RELIEF_NONE); + gtk_style_context_add_class (context, "circular"); + gtk_style_context_add_class (context, "flat"); + gtk_widget_set_valign (button, GTK_ALIGN_CENTER); gtk_box_pack_end (GTK_BOX (self), button, FALSE, FALSE, 0); gtk_widget_show (button); diff --git a/src/resources/css/Adwaita.css b/src/resources/css/Adwaita.css index 8c7967799..0d20f2147 100644 --- a/src/resources/css/Adwaita.css +++ b/src/resources/css/Adwaita.css @@ -63,7 +63,7 @@ /* Floating status bar */ .floating-bar { - padding: 2px; + padding: 1px; background-color: @theme_base_color; border-width: 1px; border-style: solid solid none; @@ -86,7 +86,7 @@ } .floating-bar button { - padding: 4px; + padding: 0px; } .search-bar { -- cgit v1.2.1