[evolution-patches] Prettify folder property dialog
- From: Christian Neumair <chris gnome-de org>
- To: evolution-patches lists ximian com
- Subject: [evolution-patches] Prettify folder property dialog
- Date: Wed, 02 Jun 2004 12:55:36 +0200
The attached patch pretifies the folder property dialog and moves it
towards HIG compliance.
Any comments/suggestions?
regs,
Chris
Index: mail/em-folder-properties.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-properties.c,v
retrieving revision 1.2
diff -u -r1.2 em-folder-properties.c
--- mail/em-folder-properties.c 6 Feb 2004 06:35:47 -0000 1.2
+++ mail/em-folder-properties.c 2 Jun 2004 10:54:24 -0000
@@ -56,7 +56,7 @@
CamelArgV *argv = prop_data->argv;
int i;
- if (response != GTK_RESPONSE_OK) {
+ if (response != GTK_RESPONSE_CLOSE) {
gtk_widget_destroy (dialog);
return;
}
@@ -107,7 +107,7 @@
CamelArgV *argv;
GSList *list, *l;
gint32 count, i;
- char *name;
+ char *name, *title;
char countstr[16];
int row = 0, total=0, unread=0;
@@ -117,54 +117,58 @@
camel_object_get (folder, NULL, CAMEL_FOLDER_PROPERTIES, &list, CAMEL_FOLDER_NAME, &name,
CAMEL_FOLDER_TOTAL, &total, CAMEL_FOLDER_UNREAD, &unread, NULL);
- dialog = gtk_dialog_new_with_buttons (_("Folder properties"), NULL,
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
+ title = g_strdup_printf ("Properties of %s", name);
+ dialog = gtk_dialog_new_with_buttons (title, NULL,
+ GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
NULL);
-
+ gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
+ gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
+ gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 2);
+ g_free (title);
+
/* TODO: maybe we want some basic properties here, like message counts/approximate size/etc */
- w = gtk_frame_new (_("Properties"));
- gtk_widget_show (w);
- gtk_box_pack_start ((GtkBox *) ((GtkDialog *) dialog)->vbox, w, TRUE, TRUE, 6);
-
table = gtk_table_new (g_slist_length (list) + 3, 2, FALSE);
+ gtk_table_set_row_spacings (GTK_TABLE (table), 6);
+ gtk_table_set_col_spacings (GTK_TABLE (table), 12);
+ gtk_container_set_border_width (GTK_CONTAINER (table), 5);
gtk_widget_show (table);
- gtk_container_add ((GtkContainer *) w, table);
+ gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
/* TODO: can this be done in a loop? */
- label = gtk_label_new (_("Folder Name"));
+ label = gtk_label_new (_("Folder name:"));
gtk_widget_show (label);
- gtk_misc_set_alignment ((GtkMisc *) label, 1.0, 0.5);
- gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
+ gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0);
label = gtk_label_new (name);
gtk_widget_show (label);
gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
- gtk_table_attach ((GtkTable *) table, label, 1, 2, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ gtk_table_attach ((GtkTable *) table, label, 1, 2, row, row+1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
row++;
- label = gtk_label_new (_("Total messages"));
+ label = gtk_label_new (_("Total messages:"));
gtk_widget_show (label);
- gtk_misc_set_alignment ((GtkMisc *) label, 1.0, 0.5);
- gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
+ gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0);
sprintf(countstr, "%d", total);
label = gtk_label_new (countstr);
gtk_widget_show (label);
gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
- gtk_table_attach ((GtkTable *) table, label, 1, 2, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ gtk_table_attach ((GtkTable *) table, label, 1, 2, row, row+1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
row++;
- label = gtk_label_new (_("Unread messages"));
+ label = gtk_label_new (_("Unread messages:"));
gtk_widget_show (label);
- gtk_misc_set_alignment ((GtkMisc *) label, 1.0, 0.5);
- gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
+ gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0);
sprintf(countstr, "%d", unread);
label = gtk_label_new (countstr);
gtk_widget_show (label);
gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
- gtk_table_attach ((GtkTable *) table, label, 1, 2, row, row+1, GTK_FILL | GTK_EXPAND, 0, 3, 0);
+ gtk_table_attach ((GtkTable *) table, label, 1, 2, row, row+1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
row++;
/* build an arggetv/argv to retrieve/store the results */
@@ -205,14 +209,14 @@
w = gtk_check_button_new_with_label (prop->description);
gtk_toggle_button_set_active ((GtkToggleButton *) w, argv->argv[i].ca_int != 0);
gtk_widget_show (w);
- gtk_table_attach ((GtkTable *) table, w, 0, 2, row, row + 1, 0, 0, 3, 3);
+ gtk_table_attach ((GtkTable *) table, w, 0, 2, row, row + 1, 0, 0, 0, 0);
prop_data->widgets[i] = w;
break;
case CAMEL_ARG_STR:
label = gtk_label_new (prop->description);
- gtk_misc_set_alignment ((GtkMisc *) label, 1.0, 0.5);
+ gtk_misc_set_alignment ((GtkMisc *) label, 0.0, 0.5);
gtk_widget_show (label);
- gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row + 1, GTK_FILL | GTK_EXPAND, 0, 3, 3);
+ gtk_table_attach ((GtkTable *) table, label, 0, 1, row, row + 1, GTK_FILL, 0, 0, 0);
w = gtk_entry_new ();
gtk_widget_show (w);
@@ -221,7 +225,7 @@
camel_object_free (folder, argv->argv[i].tag, argv->argv[i].ca_str);
argv->argv[i].ca_str = NULL;
}
- gtk_table_attach ((GtkTable *) table, w, 1, 2, row, row + 1, GTK_FILL, 0, 3, 3);
+ gtk_table_attach ((GtkTable *) table, w, 1, 2, row, row + 1, GTK_FILL | GTK_EXPAND, 0, 0, 0);
prop_data->widgets[i] = w;
break;
default:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]