[network-manager-netbook] Some cosmetic changes to the "Delete this network" button.



commit 63b2e6c0091901c2cfc6b05f4fc2c12618cf1eb5
Author: Tambet Ingo <tambet gmail com>
Date:   Thu Sep 3 14:39:55 2009 +0300

    Some cosmetic changes to the "Delete this network" button.
    
    Align it better and replace the GTK_STOCK_DELETE with GTK_STOCK_REMOVE, it looks
    much better. bnc #536439.

 src/nmn-item.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/src/nmn-item.c b/src/nmn-item.c
index 1c1e425..7b9c0bc 100644
--- a/src/nmn-item.c
+++ b/src/nmn-item.c
@@ -80,7 +80,7 @@ nmn_item_get_name (NmnItem *item)
 {
     g_return_val_if_fail (NMN_IS_ITEM (item), NULL);
 
-    gtk_label_get_text (GTK_LABEL (NMN_ITEM_GET_PRIVATE (item)->name));
+    return gtk_label_get_text (GTK_LABEL (NMN_ITEM_GET_PRIVATE (item)->name));
 }
 
 void
@@ -196,14 +196,21 @@ nmn_item_set_delete_visible (NmnItem *item,
     g_return_if_fail (NMN_IS_ITEM (item));
 
     if (visible && !priv->remove) {
-        priv->remove = gtk_button_new ();
-        gtk_widget_set_tooltip_text (priv->remove, "Remove connection");
-        gtk_container_add (GTK_CONTAINER (priv->remove),
-                           gtk_image_new_from_stock (GTK_STOCK_DELETE, GTK_ICON_SIZE_BUTTON));
+        GtkWidget *button;
 
+        priv->remove = gtk_vbox_new (FALSE, 0);
         gtk_box_pack_end (priv->hbox, priv->remove, FALSE, FALSE, 0);
+
+        button = gtk_button_new ();
+        gtk_button_set_image (GTK_BUTTON (button),
+                              gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_BUTTON));
+
+        gtk_button_set_image_position (GTK_BUTTON (button), GTK_POS_RIGHT);
+        gtk_widget_set_tooltip_text (button, "Remove connection");
+        gtk_box_pack_start (GTK_BOX (priv->remove), button, TRUE, FALSE, 0);
+
         gtk_widget_show_all (priv->remove);
-        g_signal_connect_swapped (priv->remove, "clicked",
+        g_signal_connect_swapped (button, "clicked",
                                   G_CALLBACK (nmn_item_delete),
                                   item);
     } else if (!visible && priv->remove) {
@@ -354,13 +361,13 @@ nmn_item_init (NmnItem *item)
 
     priv->hbox = GTK_BOX (gtk_hbox_new (FALSE, 6));
     gtk_container_set_border_width (GTK_CONTAINER (priv->hbox), 6);
-    gtk_box_pack_start (priv->vbox, GTK_WIDGET (priv->hbox), TRUE, TRUE, 0);
+    gtk_box_pack_start (priv->vbox, GTK_WIDGET (priv->hbox), FALSE, FALSE, 0);
 
     priv->icon = gtk_image_new ();
     gtk_box_pack_start (priv->hbox, priv->icon, FALSE, FALSE, 0);
 
     vbox = gtk_vbox_new (FALSE, 0);
-    gtk_box_pack_start (priv->hbox, vbox, TRUE, TRUE, 0);
+    gtk_box_pack_start (priv->hbox, vbox, FALSE, FALSE, 0);
 
     hbox = gtk_hbox_new (FALSE, 12);
     gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]