[geary/wip/730682-refine-convo-list: 173/175] Increase initial conversation load to make initial scroll less janky.



commit e3376e51ed0155e954d3cdece7c756eacba361a4
Author: Michael James Gratton <mike vee net>
Date:   Sun Oct 15 08:04:38 2017 +1030

    Increase initial conversation load to make initial scroll less janky.

 src/client/application/geary-controller.vala |   14 +++++++++-----
 src/client/components/main-window.vala       |    2 +-
 2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index cd47e44..220c7fe 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -50,7 +50,7 @@ public class GearyController : Geary.BaseObject {
     // Properties
     public const string PROP_CURRENT_CONVERSATION ="current-conversations";
 
-    public const int MIN_CONVERSATION_COUNT = 50;
+    internal const int CONVERSATION_PAGE_SIZE = 50;
 
     private const int SELECT_FOLDER_TIMEOUT_USEC = 100 * 1000;
 
@@ -1332,10 +1332,14 @@ public class GearyController : Geary.BaseObject {
         }
         
         update_ui();
-        
-        current_conversations = new Geary.App.ConversationMonitor(current_folder, 
Geary.Folder.OpenFlags.NO_DELAY,
-            ConversationListStore.REQUIRED_FIELDS, MIN_CONVERSATION_COUNT);
-        
+
+        current_conversations = new Geary.App.ConversationMonitor(
+            current_folder,
+            Geary.Folder.OpenFlags.NO_DELAY,
+            ConversationListStore.REQUIRED_FIELDS,
+            CONVERSATION_PAGE_SIZE * 2 // load double up front when not scrolling
+        );
+
         if (inboxes.values.contains(current_folder)) {
             // Inbox selected, clear new messages if visible
             clear_new_messages("do_select_folder (inbox)", null);
diff --git a/src/client/components/main-window.vala b/src/client/components/main-window.vala
index ab5765d..3d9e45e 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -512,7 +512,7 @@ public class MainWindow : Gtk.ApplicationWindow {
 
     private void on_load_more() {
         debug("on_load_more");
-        this.application.controller.current_conversations.min_window_count += 
GearyController.MIN_CONVERSATION_COUNT;
+        this.application.controller.current_conversations.min_window_count += 
GearyController.CONVERSATION_PAGE_SIZE;
     }
 
     private void on_scan_error(Error err) {


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