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



commit e4c3d70f1f1a87303a354229fdb7a7e6da793cf3
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 7a8054d..f0d54d8 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();
     }
     
@@ -424,8 +428,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]