[geary/wip/765516-gtk-widget-conversation-viewer: 30/117] Enable ConversationViewer list box focus scrolling.



commit 5ba7118df3ffb68bde68ed65d0a9875265a20b5b
Author: Michael James Gratton <mike vee net>
Date:   Tue Apr 12 01:14:02 2016 +1000

    Enable ConversationViewer list box focus scrolling.
    
    * src/client/conversation-viewer/conversation-viewer.vala
      (ConversationViewer::ConversationViewer): Hook up list's scrolled
      window's adjustment to the list.
      (ConversationViewer::select_conversation_async): Try to make last message
      get scrolled to when adding messages from a new convo.

 .../conversation-viewer/conversation-viewer.vala   |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index f9241e9..c448c90 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -183,6 +183,10 @@ public class ConversationViewer : Gtk.Stack {
         //conversation_find_bar.close.connect(() => { fsm.issue(SearchEvent.CLOSE_FIND_BAR); });
         //pack_start(conversation_find_bar, false);
 
+        // Ensure the conversation_listbox scrolls with the focused message
+        Gtk.Adjustment adjustment = conversation_page.vadjustment;
+        conversation_listbox.set_focus_vadjustment(adjustment);
+        
         do_conversation();
     }
     
@@ -429,8 +433,9 @@ public class ConversationViewer : Gtk.Stack {
         } else {
             compress_emails();
             // Ensure the last message is always shown
-            show_message(conversation_listbox.get_row_at_index(messages.size - 1),
-                         false);
+            Gtk.ListBoxRow last_row = conversation_listbox.get_row_at_index(messages.size - 1);
+            show_message(last_row, false);
+            last_row.grab_focus();
         }
     }
     


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