xfprint patch

Jasper Huijsmans jasper at moongroup.com
Sun Mar 30 15:37:38 CEST 2003


Benedikt,

I made a small patch for xfprint (for starters ;):
* add some space around main dialog objects
* change Save button to 'Save settings' (I didn't understand what it did
  when I first saw it).
* Don't make copies spinbutton fill complete line.

Screenshot attached. What do you think?

I think all notebook pages also need some extra spacing. If you want I
can have a look at it.

	Jasper

Index: printdlg.c
===================================================================
RCS file: /cvsroot/xfce/xfce-devel/xfprint/xfprint/printdlg.c,v
retrieving revision 1.2
diff -u -r1.2 printdlg.c
--- printdlg.c	10 Mar 2003 21:07:39 -0000	1.2
+++ printdlg.c	30 Mar 2003 13:28:36 -0000
@@ -30,6 +30,7 @@
 
 #include <gtk/gtk.h>
 #include <libxfce4util/util.h>
+#include <libxfcegui4/dialogs.h>
 #include <xfprinterlist.h>
 #include <xfprintsettings.h>
 
@@ -97,10 +98,16 @@
 	GtkWidget *label;
 	GtkWidget *table;
 
-	dlg->save = gtk_dialog_add_button(GTK_DIALOG(dlg),
-		GTK_STOCK_SAVE, GTK_RESPONSE_APPLY);
+	dlg->save = mixed_button_new(GTK_STOCK_SAVE, "Save settings");
+	gtk_widget_show(dlg->save);
 	g_signal_connect(G_OBJECT(dlg->save), "clicked",
 		G_CALLBACK(clicked_cb), dlg);
+	gtk_dialog_add_action_widget(GTK_DIALOG(dlg),
+		dlg->save, GTK_RESPONSE_APPLY);
+	gtk_button_box_set_child_secondary(
+		GTK_BUTTON_BOX(GTK_DIALOG(dlg)->action_area), 
+		dlg->save,
+		TRUE);
 
 	gtk_dialog_add_buttons(GTK_DIALOG(dlg),
 		GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
@@ -114,10 +121,12 @@
 	/* "Printer"-Frame: */
 	frame = gtk_frame_new("Printer");
 	gtk_widget_show(frame);
+	gtk_container_set_border_width(GTK_CONTAINER(frame), 5);
 	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), frame, FALSE,
-		TRUE, 2);
+		TRUE, 0);
 
 	table = gtk_table_new(2, 3, FALSE);
+	gtk_container_set_border_width(GTK_CONTAINER(table), 5);
 	gtk_widget_show(table);
 	gtk_container_add(GTK_CONTAINER(frame), table);
 
@@ -171,6 +180,7 @@
 	/* Notebook */
 	dlg->notebook = gtk_notebook_new();
 	gtk_widget_show(dlg->notebook);
+	gtk_container_set_border_width(GTK_CONTAINER(dlg->notebook), 5);
 	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox),
dlg->notebook, 		TRUE, TRUE, 0);
 
@@ -209,18 +219,20 @@
 	gtk_notebook_append_page(GTK_NOTEBOOK(dlg->notebook), dlg->head,
 		label);
 
+	/* number of copies */
 	hbox = gtk_hbox_new(FALSE, 4);
+	gtk_container_set_border_width(GTK_CONTAINER(hbox), 6);
 	gtk_widget_show(hbox);
 	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dlg)->vbox), hbox,
 		FALSE, TRUE, 0);
 
 	label = gtk_label_new("Copies:");
 	gtk_widget_show(label);
-	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, TRUE, 0);
+	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
 
 	dlg->copies = gtk_spin_button_new_with_range(1.0, 1000.0, 1.0);
 	gtk_widget_show(dlg->copies);
-	gtk_box_pack_start(GTK_BOX(hbox), dlg->copies, TRUE, TRUE, 0);
+	gtk_box_pack_start(GTK_BOX(hbox), dlg->copies, FALSE, FALSE, 0);
 
 	/* defaults to no printer selected */
 	dlg->pr = NULL;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xfprint.png
Type: image/png
Size: 41569 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce4-dev/attachments/20030330/bbbb56f5/attachment.png>


More information about the Xfce4-dev mailing list