nautilus r15128 - in trunk: . libnautilus-private



Author: alexl
Date: Tue Mar 17 09:32:10 2009
New Revision: 15128
URL: http://svn.gnome.org/viewvc/nautilus?rev=15128&view=rev

Log:
2009-03-17  Alexander Larsson  <alexl redhat com>

        * libnautilus-private/nautilus-progress-info.c:
	Center cancel button over progress bar, makes dialog
	much nicer for long filenames.
	Patch from anthony <dreadyman16 gmail com>



Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-progress-info.c

Modified: trunk/libnautilus-private/nautilus-progress-info.c
==============================================================================
--- trunk/libnautilus-private/nautilus-progress-info.c	(original)
+++ trunk/libnautilus-private/nautilus-progress-info.c	Tue Mar 17 09:32:10 2009
@@ -217,7 +217,8 @@
 	progress_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 	gtk_window_set_resizable (GTK_WINDOW (progress_window),
 				  FALSE);
-
+	gtk_container_set_border_width (GTK_CONTAINER (progress_window), 10);
+ 
 	gtk_window_set_title (GTK_WINDOW (progress_window),
 			      _("File Operations"));
 	gtk_window_set_wmclass (GTK_WINDOW (progress_window),
@@ -228,13 +229,16 @@
 				"system-file-manager");
 	
 	vbox = gtk_vbox_new (FALSE, 0);
-	gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
-	gtk_widget_show (vbox);
-	
+	gtk_box_set_spacing (GTK_BOX (vbox), 5);
+		
 	gtk_container_add (GTK_CONTAINER (progress_window),
 			   vbox);
 
-	g_signal_connect (progress_window, "delete_event", (GCallback)delete_event, NULL);
+	gtk_widget_show_all (progress_window);
+
+	g_signal_connect (progress_window,
+			  "delete_event",
+			  (GCallback)delete_event, NULL);
 
 	status_icon = gtk_status_icon_new_from_icon_name ("system-file-manager");
 	g_signal_connect (status_icon, "activate",
@@ -334,87 +338,85 @@
 progress_widget_new (NautilusProgressInfo *info)
 {
 	ProgressWidgetData *data;
-	GtkWidget *label, *bar, *hbox, *vbox, *button, *image;
+	GtkWidget *label, *progress_bar, *hbox, *vbox, *box, *button, *image;
 
 	data = g_new0 (ProgressWidgetData, 1);
 	data->info = g_object_ref (info);
 	
-	hbox = gtk_hbox_new (FALSE, 0);
-	data->widget = hbox;
-	g_object_set_data_full (G_OBJECT (data->widget),
-				"data", data, (GDestroyNotify)progress_widget_data_free);
-
 	vbox = gtk_vbox_new (FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (hbox),
-			    vbox,
-			    FALSE, FALSE,
-			    2);
-	gtk_widget_show (vbox);
+	gtk_box_set_spacing (GTK_BOX (vbox), 5);
+
+	     
+	data->widget = vbox;
+	g_object_set_data_full (G_OBJECT (data->widget),
+				"data", data, 
+				(GDestroyNotify)progress_widget_data_free);
 	
-	label = gtk_label_new ("details");
-	gtk_widget_set_size_request (label,
-				     400, -1);
-	data->status = GTK_LABEL (label);
+	label = gtk_label_new ("status");
+	gtk_widget_set_size_request (label, 500, -1);
 	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+	gtk_label_set_line_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD_CHAR);
 	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-	gtk_widget_show (label);
 	gtk_box_pack_start (GTK_BOX (vbox),
 			    label,
-			    FALSE, FALSE,
-			    2);
+			    TRUE, FALSE,
+			    0);
+	data->status = GTK_LABEL (label);			   
 	
-	bar = gtk_progress_bar_new ();
-	data->progress_bar = GTK_PROGRESS_BAR (bar);
+	hbox = gtk_hbox_new (FALSE,10);
+
+	progress_bar = gtk_progress_bar_new ();
+	data->progress_bar = GTK_PROGRESS_BAR (progress_bar);
 	gtk_progress_bar_set_pulse_step (data->progress_bar, 0.05);
+	box = gtk_vbox_new (FALSE,0);
+	gtk_box_pack_start(GTK_BOX (box),
+			   progress_bar,
+			   TRUE,FALSE,
+			   0);
+	gtk_box_pack_start(GTK_BOX (hbox),
+			   box,
+			   TRUE,TRUE,
+			   0);
 	
-	gtk_widget_show (bar);
-	gtk_box_pack_start (GTK_BOX (vbox),
-			    bar,
-			    FALSE, FALSE,
-			    2);
+	image = gtk_image_new_from_stock (GTK_STOCK_CANCEL,
+					  GTK_ICON_SIZE_BUTTON);
+	button = gtk_button_new ();
+	gtk_container_add (GTK_CONTAINER (button), image);
+	gtk_box_pack_start (GTK_BOX (hbox),
+			    button,
+			    FALSE,FALSE,
+			    0);
+	g_signal_connect (button, "clicked", (GCallback)cancel_clicked, data);
 	
-	label = gtk_label_new ("status");
-	gtk_widget_set_size_request (label,
-				     400, -1);
-	data->details = GTK_LABEL (label);
-	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
-	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-	gtk_widget_show (label);
 	gtk_box_pack_start (GTK_BOX (vbox),
-			    label,
-			    FALSE, FALSE,
+			    hbox,
+			    FALSE,FALSE,
 			    0);
 
-
-	vbox = gtk_vbox_new (FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (hbox),
-			    vbox,
-			    FALSE, FALSE,
-			    0);
-	gtk_widget_show (vbox);
-
-	image = gtk_image_new_from_stock (GTK_STOCK_CANCEL, GTK_ICON_SIZE_BUTTON);
-	gtk_widget_show (image);
-	button = gtk_button_new ();
-	gtk_container_add (GTK_CONTAINER (button), image);
-	gtk_widget_show (button);
+	label = gtk_label_new ("details");
+	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
+	gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
 	gtk_box_pack_start (GTK_BOX (vbox),
-			    button,
+			    label,
 			    TRUE, FALSE,
 			    0);
-
-	g_signal_connect (button, "clicked", (GCallback)cancel_clicked, data);
-
+	data->details = GTK_LABEL (label);
+	
+	gtk_widget_show_all (data->widget);
 	
 	update_data (data);
 	update_progress (data);
 
-	g_signal_connect_swapped (data->info, "changed", (GCallback)update_data, data);
-	g_signal_connect_swapped (data->info, "progress_changed", (GCallback)update_progress, data);
-	g_signal_connect_swapped (data->info, "finished", (GCallback)op_finished, data);
+	g_signal_connect_swapped (data->info,
+				  "changed",
+				  (GCallback)update_data, data);
+	g_signal_connect_swapped (data->info,
+				  "progress_changed",
+				  (GCallback)update_progress, data);
+	g_signal_connect_swapped (data->info,
+				  "finished",
+				  (GCallback)op_finished, data);
 	
-	gtk_widget_show (data->widget);
-
 	return data->widget;
 }
 



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