summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/qml/ConversationView.qml30
-rw-r--r--framework/src/domain/maillistmodel.cpp4
2 files changed, 4 insertions, 30 deletions
diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml
index d5b64ea4..2f499752 100644
--- a/framework/qml/ConversationView.qml
+++ b/framework/qml/ConversationView.qml
@@ -17,7 +17,6 @@
17 */ 17 */
18 18
19import QtQuick 2.7 19import QtQuick 2.7
20import QtQuick.Controls 1.3 as Controls1
21import QtQuick.Controls 2 20import QtQuick.Controls 2
22import QtQuick.Layouts 1.1 21import QtQuick.Layouts 1.1
23import org.kube.framework 1.0 as Kube 22import org.kube.framework 1.0 as Kube
@@ -65,6 +64,8 @@ Rectangle {
65 64
66 anchors.fill: parent 65 anchors.fill: parent
67 66
67 verticalLayoutDirection: ListView.BottomToTop
68
68 function setCurrentIndex() 69 function setCurrentIndex()
69 { 70 {
70 /** 71 /**
@@ -117,33 +118,6 @@ Rectangle {
117 //Optimize for view quality 118 //Optimize for view quality
118 pixelAligned: true 119 pixelAligned: true
119 120
120 Timer {
121 id: scrollToEndTimer
122 interval: 10
123 running: false
124 repeat: false
125 onTriggered: {
126 //Only do this once per conversation
127 root.scrollToEnd = false;
128 root.currentIndex = listView.count - 1
129 //positionViewAtEnd/Index don't work
130 listView.contentY = Math.max(listView.contentHeight - listView.height, 0)
131 }
132 }
133
134 onCountChanged: {
135 if (root.scrollToEnd) {
136 scrollToEndTimer.restart()
137 }
138 }
139
140 onContentHeightChanged: {
141 //Initially it will resize a lot, so we keep waiting
142 if (root.scrollToEnd) {
143 scrollToEndTimer.restart()
144 }
145 }
146
147 onContentYChanged: { 121 onContentYChanged: {
148 //We have to track our current mail manually 122 //We have to track our current mail manually
149 setCurrentIndex(); 123 setCurrentIndex();
diff --git a/framework/src/domain/maillistmodel.cpp b/framework/src/domain/maillistmodel.cpp
index fa0dda04..2d9f3147 100644
--- a/framework/src/domain/maillistmodel.cpp
+++ b/framework/src/domain/maillistmodel.cpp
@@ -295,8 +295,8 @@ void MailListModel::setMail(const QVariant &variant)
295 mFetchMails = true; 295 mFetchMails = true;
296 mFetchedMails.clear(); 296 mFetchedMails.clear();
297 qDebug() << "Running mail query: " << mail->resourceInstanceIdentifier() << mail->identifier(); 297 qDebug() << "Running mail query: " << mail->resourceInstanceIdentifier() << mail->identifier();
298 //Latest mail at the bottom 298 //Latest mail on top
299 sort(0, Qt::AscendingOrder); 299 sort(0, Qt::DescendingOrder);
300 runQuery(query); 300 runQuery(query);
301} 301}
302 302