summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Soriano <csoriano@gnome.org>2016-03-07 21:03:19 +0100
committerCarlos Soriano <csoriano@gnome.org>2016-03-07 21:04:28 +0100
commit510df65843192f42630b3a6113ebd6cc2dee1147 (patch)
treed9091200245d670d4113da3839f9e34e49e27554
parent66c859eed80d316b20e1457ba16f219e175ee90c (diff)
downloadnautilus-510df65843192f42630b3a6113ebd6cc2dee1147.tar.gz
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
-rw-r--r--src/nautilus-floating-bar.c15
-rw-r--r--src/resources/css/Adwaita.css4
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 {