[balsa/gtk3] Get initial focus on the "To:" address



commit ba949f1e61543eecac06342199c8b9b384f457b1
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Aug 21 14:02:53 2011 -0400

    Get initial focus on the "To:" address
    
    	* libbalsa/address-view.c (lbav_ensure_blank_line_idle_cb):
    	remove irrelevant comment.
    	* src/sendmsg-window.c (create_info_pane): create "Reply-To:"
    	entry before regular recipients, so the latter get the focus.

 ChangeLog               |    7 +++++++
 libbalsa/address-view.c |    7 +------
 src/sendmsg-window.c    |   13 +++++++++++--
 3 files changed, 19 insertions(+), 8 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 7787358..6b8f322 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-08-21  Peter Bloomfield
+
+	* libbalsa/address-view.c (lbav_ensure_blank_line_idle_cb):
+	remove irrelevant comment.
+	* src/sendmsg-window.c (create_info_pane): create "Reply-To:"
+	entry before regular recipients, so the latter get the focus.
+
 2011-08-20  Peter Bloomfield
 
 	* src/main-window.h: add BalsaWindow::bottom_bar.
diff --git a/libbalsa/address-view.c b/libbalsa/address-view.c
index 26bd683..2246897 100644
--- a/libbalsa/address-view.c
+++ b/libbalsa/address-view.c
@@ -280,12 +280,7 @@ lbav_ensure_blank_line_idle_cb(LibBalsaAddressView * address_view)
     gtk_tree_row_reference_free(address_view->focus_row);
     address_view->focus_row = NULL;
 
-    /* This will open the entry for editing;
-     * NOTE: the GtkTreeView documentation states that:
-     *  "This function is often followed by
-     *   gtk_widget_grab_focus(tree_view) in order to give keyboard
-     *   focus to the widget."
-     * but in fact, that leaves the entry /not/ open for editing. */
+    /* This will open the entry for editing */
     gtk_tree_view_set_cursor(GTK_TREE_VIEW(address_view), focus_path,
                              address_view->focus_column, TRUE);
     gtk_tree_path_free(focus_path);
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 7c262ce..27d107f 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -2908,6 +2908,14 @@ create_info_pane(BalsaSendmsg * bsmsg)
     /* From: */
     create_from_entry(table, bsmsg);
 
+#if !defined(ENABLE_TOUCH_UI)
+    /* Create the 'Reply To:' entry before the regular recipients, to
+     * get the initial focus in the regular recipients*/
+#define REPLY_TO_ROW 3
+    create_email_entry(table, REPLY_TO_ROW, bsmsg, &bsmsg->replyto_view,
+                       bsmsg->replyto, "R_eply To:", NULL, 0);
+#endif
+
     /* To:, Cc:, and Bcc: */
     create_email_entry(table, ++row, bsmsg, &bsmsg->recipient_view,
                        bsmsg->recipients, "Rec_ipients", address_types,
@@ -2928,8 +2936,9 @@ create_info_pane(BalsaSendmsg * bsmsg)
 
 #if !defined(ENABLE_TOUCH_UI)
     /* Reply To: */
-    create_email_entry(table, ++row, bsmsg, &bsmsg->replyto_view,
-                       bsmsg->replyto, "R_eply To:", NULL, 0);
+    /* We already created it, so just increment row: */
+    g_assert(++row == REPLY_TO_ROW);
+#undef REPLY_TO_ROW
 #endif
 
     /* fcc: mailbox folder where the message copy will be written to */



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