[PATCH] GtkFileChooserDefault: Add/Remove bookmark button tweaking



This patch does the following:
- use GtkHButtonBox instead of GtkHBox for add/remove bookmark buttons,
layout: end => don't expand add/remove
- swap add/remove order. HIG suggests to move most obvious action to the
rightmost, which is adding a bookmark. Plus, this position is nearer to
the right pane side, which it refers to role-wise.

regs,
 Chris 
Index: gtk/gtkfilechooserdefault.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkfilechooserdefault.c,v
retrieving revision 1.166
diff -u -r1.166 gtkfilechooserdefault.c
--- gtk/gtkfilechooserdefault.c	2 Apr 2004 00:35:07 -0000	1.166
+++ gtk/gtkfilechooserdefault.c	4 Apr 2004 13:21:25 -0000
@@ -39,6 +39,7 @@
 #include "gtkfilesystemmodel.h"
 #include "gtkframe.h"
 #include "gtkhbox.h"
+#include "gtkhbbox.h"
 #include "gtkhpaned.h"
 #include "gtkiconfactory.h"
 #include "gtkicontheme.h"
@@ -2509,7 +2510,7 @@
 		       GtkSizeGroup          *size_group)
 {
   GtkWidget *vbox;
-  GtkWidget *hbox;
+  GtkWidget *hbbox;
   GtkWidget *widget;
 
   vbox = gtk_vbox_new (FALSE, 6);
@@ -2522,20 +2523,12 @@
 
   /* Box for buttons */
 
-  hbox = gtk_hbox_new (TRUE, 6);
-  gtk_size_group_add_widget (size_group, hbox);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-  gtk_widget_show (hbox);
-
-  /* Add bookmark button */
-
-  impl->browse_shortcuts_add_button = button_new (impl,
-						  _("_Add"),
-						  GTK_STOCK_ADD,
-						  FALSE,
-						  TRUE,
-						  G_CALLBACK (add_bookmark_button_clicked_cb));
-  gtk_box_pack_start (GTK_BOX (hbox), impl->browse_shortcuts_add_button, TRUE, TRUE, 0);
+  hbbox = gtk_hbutton_box_new ();
+  gtk_button_box_set_layout (GTK_BUTTON_BOX (hbbox), GTK_BUTTONBOX_END);
+  gtk_box_set_spacing (GTK_BOX (hbbox), 6);
+  gtk_size_group_add_widget (size_group, hbbox);
+  gtk_box_pack_start (GTK_BOX (vbox), hbbox, FALSE, FALSE, 0);
+  gtk_widget_show (hbbox);
 
   /* Remove bookmark button */
 
@@ -2545,7 +2538,17 @@
 						     FALSE,
 						     TRUE,
 						     G_CALLBACK (remove_bookmark_button_clicked_cb));
-  gtk_box_pack_start (GTK_BOX (hbox), impl->browse_shortcuts_remove_button, TRUE, TRUE, 0);
+  gtk_container_add (GTK_CONTAINER (hbbox), impl->browse_shortcuts_remove_button);
+
+  /* Add bookmark button */
+
+  impl->browse_shortcuts_add_button = button_new (impl,
+						  _("_Add"),
+						  GTK_STOCK_ADD,
+						  FALSE,
+						  TRUE,
+						  G_CALLBACK (add_bookmark_button_clicked_cb));
+  gtk_container_add (GTK_CONTAINER (hbbox), impl->browse_shortcuts_add_button);
 
   return vbox;
 }


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