From 0515a6d62902012a7eb152c19d289c235adf923c Mon Sep 17 00:00:00 2001
From: Joseph Donofry <rubberduckie3554@gmail.com>
Date: Mon, 27 Dec 2021 22:49:40 -0500
Subject: [PATCH] Add scrolling to the completer and change max values from 7
 to 70

---
 resources/qml/Completer.qml | 10 +++++++++-
 src/CompletionProxyModel.h  |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/resources/qml/Completer.qml b/resources/qml/Completer.qml
index abaee3dff..b4061f8da 100644
--- a/resources/qml/Completer.qml
+++ b/resources/qml/Completer.qml
@@ -77,11 +77,19 @@ Popup {
     }
     padding: 1
     onAboutToShow: currentIndex = -1
-    height: listView.contentHeight + 2 // + 2 for the padding on top and bottom
+    // height: listView.contentHeight + 2 // + 2 for the padding on top and bottom
+    height: Math.min(listView.contentHeight + 2, 7*popup.avatarHeight + 2)
 
     ListView {
         id: listView
 
+        clip: true 
+        ScrollHelper {
+            flickable: parent
+            anchors.fill: parent
+            enabled: !Settings.mobileMode
+        }
+
         anchors.fill: parent
         implicitWidth: fullWidth ? parent.width : contentItem.childrenRect.width
         model: completer
diff --git a/src/CompletionProxyModel.h b/src/CompletionProxyModel.h
index 8a485aea9..5c34826b3 100644
--- a/src/CompletionProxyModel.h
+++ b/src/CompletionProxyModel.h
@@ -151,7 +151,7 @@ class CompletionProxyModel : public QAbstractProxyModel
 public:
     CompletionProxyModel(QAbstractItemModel *model,
                          int max_mistakes       = 2,
-                         size_t max_completions = 7,
+                         size_t max_completions = 70,
                          QObject *parent        = nullptr);
 
     void invalidate();
-- 
GitLab