Re: [PATCH] Hig-ify copying/moving progress dialog



Hi,

Hm, there was one more incorrect gtk_container_set_border_width which I
forgot to take out, and a few other details. New patch attached, should
be better.

About the label alignment.. I don't know, the same right alignment is
used in many other places.

Jorn

On T, 2005-02-01 at 08:49 -0800, Dennis Cranston wrote:
> Hi Jorn,
> 
> I missed that your patch used the style_set callback of the widget.  So the border spacing is
> correct (12 pixels), but I am counting 39 pixels between the vbox and action area of the dialog
> instead of 24 -- although this isn't really a big deal.  While your fixing the dialog, I believe
> the "Copying", "From", and "To" labels alignment is wrong.  Shouldn't they be left aligned?
> 
> Dennis
> 
> 
> --- Jorn Baayen <jbaayen gnome org> wrote:
> 
> > Hi,
> > 
> > Well, AFAIK, my patch achieves exactly this:
> > 
> > http://developer.gnome.org/projects/gup/hig/1.0/images/alert-spacing.png
> > 
> > This is also the code Gtk itself uses to make the file chooser HIG
> > compliant.
> > 
> > CHeers,
> > Jorn
> > 
> > On E, 2005-01-31 at 16:09 -0800, Dennis Cranston wrote:
> > > Hi Jorn,
> > > 
> > > Your patch will not make the dialog HIG compliant.  The dialog spacing would need to be
> > adjusted
> > > to the following values:
> > > 
> > > gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
> > > gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 5);
> > > gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
> > > 
> > > For an explanation please see bugzilla report #163850, "Gtk+ dialogs should use HIG spacing by
> > > default".
> > > 
> > > Thanks,
> > > Dennis
> > > 
> > > --- Jorn Baayen <jbaayen gnome org> wrote:
> > > 
> > > > Hi,
> > > > 
> > > > Attaching a patch to HIG-ify the copying/moving progress dialog. 
> > > > 
> > > > Another thing that would be nice here is a responsive "cancel" button.
> > > > It can take up to half a minute for the "cancel" button to respond to
> > > > canceling copying a bigger file to a webdav location, for example. The
> > > > dialog will just sit there, cancel still clickable, like nothing
> > > > happened- very annoying. Maybe at least make the dialog say "canceling"
> > > > and de-sensitivify the cancel button, or something ..
> > > > 
> > > > Cheers,
> > > > 
> > > > Jorn
> > > > > Index: libnautilus-private/nautilus-file-operations-progress.c
> > > > ===================================================================
> > > > RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-operations-progress.c,v
> > > > retrieving revision 1.44
> > > > diff -u -r1.44 nautilus-file-operations-progress.c
> > > > --- libnautilus-private/nautilus-file-operations-progress.c	18 Aug 2004 23:03:08 -0000	1.44
> > > > +++ libnautilus-private/nautilus-file-operations-progress.c	31 Jan 2005 21:54:54 -0000
> > > > @@ -271,6 +271,29 @@
> > > >  }
> > > >  
> > > >  static void
> > > > +style_set_callback (GtkWidget *widget,
> > > > +                    GtkStyle  *previous_style)
> > > > +{
> > > > +	GtkDialog *dialog;
> > > > +
> > > > +	if (GTK_WIDGET_CLASS (parent_class)->style_set)
> > > > +		GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style);
> > > > +
> > > > +	dialog = GTK_DIALOG (widget);
> > > > +
> > > > +	/* Override the style properties with HIG-compliant spacings.  Ugh.
> > > > +	 * http://developer.gnome.org/projects/gup/hig/1.0/layout.html#layout-dialogs
> > > > +	 * http://developer.gnome.org/projects/gup/hig/1.0/windows.html#alert-spacing
> > > > +	 */
> > > > +
> > > > +	gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), 12);
> > > > +	gtk_box_set_spacing (GTK_BOX (dialog->vbox), 24);
> > > > +
> > > > +	gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 0);
> > > > +	gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
> > > > +}
> > > > +
> > > > +static void
> > > >  nautilus_file_operations_progress_init (NautilusFileOperationsProgress *progress)
> > > >  {
> > > >  	GtkWidget *hbox, *vbox;
> > > > @@ -278,6 +301,8 @@
> > > >  
> > > >  	progress->details = g_new0 (NautilusFileOperationsProgressDetails, 1);
> > > >  
> > > > +	gtk_dialog_set_has_separator (GTK_DIALOG (progress), FALSE);
> > > > +
> > > >  	vbox = gtk_vbox_new (FALSE, VERTICAL_SPACING);
> > > >  	gtk_container_set_border_width (GTK_CONTAINER (vbox), OUTER_BORDER);
> > > >  	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (progress)->vbox), vbox, TRUE, TRUE,
> > > > VERTICAL_SPACING);
> > > > @@ -357,6 +382,7 @@
> > > >  	 */
> > > >  	widget_class->delete_event = delete_event_callback;
> > > >  	widget_class->map = map_callback;
> > > > +	widget_class->style_set = style_set_callback;
> > > >  
> > > >  	dialog_class->close = close_callback;
> > > >  
> > > > > -- 
> > > > nautilus-list mailing list
> > > > nautilus-list gnome org
> > > > http://mail.gnome.org/mailman/listinfo/nautilus-list
> > > > 
> > > 
> > > 
> > > =====
> > > 
> > 
> > -- 
> > nautilus-list mailing list
> > nautilus-list gnome org
> > http://mail.gnome.org/mailman/listinfo/nautilus-list
> > 
Index: libnautilus-private/nautilus-file-operations-progress.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-file-operations-progress.c,v
retrieving revision 1.44
diff -u -r1.44 nautilus-file-operations-progress.c
--- libnautilus-private/nautilus-file-operations-progress.c	18 Aug 2004 23:03:08 -0000	1.44
+++ libnautilus-private/nautilus-file-operations-progress.c	1 Feb 2005 18:41:11 -0000
@@ -50,10 +50,6 @@
  */
 #define PROGRESS_DIALOG_WIDTH 400
 
-#define OUTER_BORDER       5
-#define VERTICAL_SPACING   8
-#define HORIZONTAL_SPACING 3
-
 #define MINIMUM_TIME_UP    1000
 
 #define SHOW_TIMEOUT	   1200
@@ -271,6 +267,29 @@
 }
 
 static void
+style_set_callback (GtkWidget *widget,
+                    GtkStyle  *previous_style)
+{
+	GtkDialog *dialog;
+
+	if (GTK_WIDGET_CLASS (parent_class)->style_set)
+		GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style);
+
+	dialog = GTK_DIALOG (widget);
+
+	/* Override the style properties with HIG-compliant spacings.  Ugh.
+	 * http://developer.gnome.org/projects/gup/hig/1.0/layout.html#layout-dialogs
+	 * http://developer.gnome.org/projects/gup/hig/1.0/windows.html#alert-spacing
+	 */
+
+	gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), 12);
+	gtk_box_set_spacing (GTK_BOX (dialog->vbox), 24);
+
+	gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 0);
+	gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
+}
+
+static void
 nautilus_file_operations_progress_init (NautilusFileOperationsProgress *progress)
 {
 	GtkWidget *hbox, *vbox;
@@ -278,12 +297,13 @@
 
 	progress->details = g_new0 (NautilusFileOperationsProgressDetails, 1);
 
-	vbox = gtk_vbox_new (FALSE, VERTICAL_SPACING);
-	gtk_container_set_border_width (GTK_CONTAINER (vbox), OUTER_BORDER);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (progress)->vbox), vbox, TRUE, TRUE, VERTICAL_SPACING);
+	gtk_dialog_set_has_separator (GTK_DIALOG (progress), FALSE);
+
+	vbox = gtk_vbox_new (FALSE, 6);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (progress)->vbox), vbox, TRUE, TRUE, 0);
 
-	hbox = gtk_hbox_new (FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, HORIZONTAL_SPACING);
+	hbox = gtk_hbox_new (FALSE, 6);
+	gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
 
 	/* label- */
 	/* Files remaining to be copied: */
@@ -308,8 +328,8 @@
 	gtk_progress_bar_set_text (GTK_PROGRESS_BAR (progress->details->progress_bar), " ");
 
 	titled_label_table = GTK_TABLE (gtk_table_new (3, 2, FALSE));
-	gtk_table_set_row_spacings (titled_label_table, 4);
-	gtk_table_set_col_spacings (titled_label_table, 4);
+	gtk_table_set_row_spacings (titled_label_table, 6);
+	gtk_table_set_col_spacings (titled_label_table, 6);
 
 	create_titled_label (titled_label_table, 0,
 			     &progress->details->operation_name_label, 
@@ -321,7 +341,7 @@
 			     &progress->details->to_label, 
 			     &progress->details->to_path_label);
 
-	gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (titled_label_table), FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (titled_label_table), FALSE, FALSE, 6);
 
 	/* Set window icon */
 	gtk_window_set_icon (GTK_WINDOW (progress), empty_jar_pixbuf);
@@ -357,6 +377,7 @@
 	 */
 	widget_class->delete_event = delete_event_callback;
 	widget_class->map = map_callback;
+	widget_class->style_set = style_set_callback;
 
 	dialog_class->close = close_callback;
 


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