[nautilus] Center tab labels
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Center tab labels
- Date: Tue, 29 Oct 2013 18:36:39 +0000 (UTC)
commit 4fcfb8dd5acf4033433533ab9212c4b853710a0d
Author: William Jon McCann <william jon mccann gmail com>
Date: Fri Oct 4 14:48:53 2013 -0400
Center tab labels
https://bugzilla.gnome.org/show_bug.cgi?id=709446
src/nautilus-notebook.c | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
---
diff --git a/src/nautilus-notebook.c b/src/nautilus-notebook.c
index 1542ac6..3bec6a2 100644
--- a/src/nautilus-notebook.c
+++ b/src/nautilus-notebook.c
@@ -341,11 +341,17 @@ static GtkWidget *
build_tab_label (NautilusNotebook *nb, NautilusWindowSlot *slot)
{
GtkWidget *hbox, *label, *close_button, *image, *spinner, *icon;
+ GtkWidget *box;
+
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
+ gtk_widget_show (box);
/* set hbox spacing and label padding (see below) so that there's an
* equal amount of space around the label */
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_widget_show (hbox);
+ gtk_widget_set_halign (hbox, GTK_ALIGN_CENTER);
+ gtk_box_pack_start (GTK_BOX (box), hbox, TRUE, TRUE, 0);
/* setup load feedback */
spinner = gtk_spinner_new ();
@@ -360,9 +366,8 @@ build_tab_label (NautilusNotebook *nb, NautilusWindowSlot *slot)
label = gtk_label_new (NULL);
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_misc_set_padding (GTK_MISC (label), 0, 0);
- gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+ gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
gtk_widget_show (label);
/* setup close button */
@@ -382,18 +387,18 @@ build_tab_label (NautilusNotebook *nb, NautilusWindowSlot *slot)
gtk_container_add (GTK_CONTAINER (close_button), image);
gtk_widget_show (image);
- gtk_box_pack_start (GTK_BOX (hbox), close_button, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (box), close_button, FALSE, FALSE, 0);
gtk_widget_show (close_button);
- g_object_set_data (G_OBJECT (hbox), "nautilus-notebook-tab", GINT_TO_POINTER (1));
- nautilus_drag_slot_proxy_init (hbox, NULL, slot);
+ g_object_set_data (G_OBJECT (box), "nautilus-notebook-tab", GINT_TO_POINTER (1));
+ nautilus_drag_slot_proxy_init (box, NULL, slot);
- g_object_set_data (G_OBJECT (hbox), "label", label);
- g_object_set_data (G_OBJECT (hbox), "spinner", spinner);
- g_object_set_data (G_OBJECT (hbox), "icon", icon);
- g_object_set_data (G_OBJECT (hbox), "close-button", close_button);
+ g_object_set_data (G_OBJECT (box), "label", label);
+ g_object_set_data (G_OBJECT (box), "spinner", spinner);
+ g_object_set_data (G_OBJECT (box), "icon", icon);
+ g_object_set_data (G_OBJECT (box), "close-button", close_button);
- return hbox;
+ return box;
}
static int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]