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



commit 9168ed78586f27bbd47ff1cabe44037d5143ddaa
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 |   18 +++++++++++-------
 src/client/components/main-window.vala       |    2 +-
 2 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/src/client/application/geary-controller.vala b/src/client/application/geary-controller.vala
index f3b4a55..2423abe 100644
--- a/src/client/application/geary-controller.vala
+++ b/src/client/application/geary-controller.vala
@@ -51,9 +51,9 @@ public class GearyController : Geary.BaseObject {
     public const string ACTION_TOGGLE_FIND = "GearyToggleFind";
 
     public const string PROP_CURRENT_CONVERSATION ="current-conversations";
-    
-    public const int MIN_CONVERSATION_COUNT = 50;
-    
+
+    internal const int CONVERSATION_PAGE_SIZE = 50;
+
     private const string DELETE_CONVERSATION_LABEL = _("Delete conversation");
     private const string DELETE_CONVERSATION_TOOLTIP_SINGLE = _("Delete conversation (Shift+Delete)");
     private const string DELETE_CONVERSATION_TOOLTIP_MULTIPLE = _("Delete conversations (Shift+Delete)");
@@ -1436,10 +1436,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 5031c7f..2ffcef1 100644
--- a/src/client/components/main-window.vala
+++ b/src/client/components/main-window.vala
@@ -498,7 +498,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]