Hi, This patch is similar to the one I sent for the mailer a week ago. It makes the search dialog in the composer take the Escape key to close it. The patch also removes unnecessary padding so that the dialog is consistent with other dialogs, in particular the mailer's Search Mail dialog. See the attached screenshot for the inconsistency. Is it OK to commit? Federico
Index: search.c =================================================================== RCS file: /cvs/gnome/gtkhtml/components/html-editor/search.c,v retrieving revision 1.22 diff -u -r1.22 search.c --- search.c 12 May 2003 20:46:48 -0000 1.22 +++ search.c 11 Jun 2003 00:31:54 -0000 @@ -70,11 +70,19 @@ { GtkHTMLSearchDialog *dialog = g_new (GtkHTMLSearchDialog, 1); GtkWidget *hbox, *vbox; + GtkAccelGroup *accel_group; + GtkWidget *button; + + dialog->dialog = GTK_DIALOG (gtk_dialog_new ()); + gtk_window_set_title (GTK_WINDOW (dialog->dialog), _("Find")); + + button = gtk_dialog_add_button (dialog->dialog, GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE); + accel_group = gtk_accel_group_new (); + gtk_window_add_accel_group (GTK_WINDOW (dialog->dialog), accel_group); + gtk_widget_add_accelerator (button, "activate", accel_group, GDK_Escape, 0, GTK_ACCEL_LOCKED); + + gtk_dialog_add_button (dialog->dialog, GTK_STOCK_FIND, 0); - dialog->dialog = GTK_DIALOG (gtk_dialog_new_with_buttons (_("Find"), NULL, 0, - GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, - GTK_STOCK_FIND, 0, - NULL)); dialog->entry = gtk_entry_new (); dialog->backward = gtk_check_button_new_with_mnemonic (_("_Backward")); dialog->case_sensitive = gtk_check_button_new_with_mnemonic (_("Case _sensitive")); @@ -93,10 +101,8 @@ gtk_widget_show (vbox); gtk_box_pack_start (GTK_BOX (vbox), dialog->entry, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (dialog->dialog), 6); gtk_container_set_border_width (GTK_CONTAINER (vbox), 6); gtk_container_set_border_width (GTK_CONTAINER (dialog->dialog->vbox), 6); - gtk_box_set_spacing (GTK_BOX (dialog->dialog->vbox), 6); gtk_box_pack_start (GTK_BOX (dialog->dialog->vbox), vbox, FALSE, FALSE, 0); gtk_widget_show (dialog->entry); gtk_widget_show_all (hbox);
Attachment:
ugly-padding.png
Description: PNG image