[geary/wip/765516-gtk-widget-conversation-viewer] Reset the conversation-viewer's scrollbars when adding a new convo list.



commit aa2901eef40ae42c7c26bdb53831bf5f2d26b394
Author: Michael James Gratton <mike vee net>
Date:   Tue Oct 4 15:16:16 2016 +1100

    Reset the conversation-viewer's scrollbars when adding a new convo list.

 .../conversation-viewer/conversation-viewer.vala   |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/client/conversation-viewer/conversation-viewer.vala 
b/src/client/conversation-viewer/conversation-viewer.vala
index 1ba8ffc..2669072 100644
--- a/src/client/conversation-viewer/conversation-viewer.vala
+++ b/src/client/conversation-viewer/conversation-viewer.vala
@@ -243,10 +243,17 @@ public class ConversationViewer : Gtk.Stack {
 
     // Remove any existing conversation list, cancelling its loading
     private void remove_current_list() {
+        // Remove the viewport that contains the current list
         Gtk.Widget? scrolled_child = this.conversation_scroller.get_child();
         if (scrolled_child != null) {
             scrolled_child.destroy();
         }
+
+        // Reset the scrollbars to their initial positions
+        this.conversation_scroller.hadjustment.set_value(0);
+        this.conversation_scroller.vadjustment.set_value(0);
+
+        // Notify that the current list was removed
         if (this.current_list != null) {
             this.conversation_removed(this.current_list);
             this.current_list = null;


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