[gitg] Keep the scrolling position of navigation during reloading



commit ca1fab7f2dc563ccdc16df0808b7c5c244af6b01
Author: Techlive Zheng <techlivezheng gmail com>
Date:   Sun Jun 2 14:45:10 2013 +0800

    Keep the scrolling position of navigation during reloading

 plugins/history/gitg-history.vala |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/plugins/history/gitg-history.vala b/plugins/history/gitg-history.vala
index 8deac58..3fc08ca 100644
--- a/plugins/history/gitg-history.vala
+++ b/plugins/history/gitg-history.vala
@@ -186,11 +186,15 @@ namespace GitgHistory
 
                public void reload()
                {
+                       double vadj = d_navigation.get_vadjustment().get_value();
                        d_navigation.set_model(null);
                        d_navigation_model.reload();
                        d_navigation.set_model(d_navigation_model);
                        d_navigation.expand_all();
                        d_navigation.select();
+                       d_navigation.size_allocate.connect((a) => {
+                               d_navigation.get_vadjustment().set_value(vadj);
+                       });
                }
 
                private void build_ui()


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