Show new messages on the bottom
Summary: Like every messaging app I know does Test Plan: Compare message order with phone Reviewers: #kde_connect, sredman Reviewed By: #kde_connect, sredman Subscribers: sredman, kdeconnect Tags: #kde_connect Differential Revision: https://phabricator.kde.org/D14638
This commit is contained in:
parent
21b52d7dcf
commit
5f63f78f77
2 changed files with 10 additions and 5 deletions
|
@ -44,6 +44,8 @@ public:
|
||||||
DateRole,
|
DateRole,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Q_ENUMS(Roles)
|
||||||
|
|
||||||
QString threadId() const;
|
QString threadId() const;
|
||||||
void setThreadId(const QString &threadId);
|
void setThreadId(const QString &threadId);
|
||||||
|
|
||||||
|
|
|
@ -39,11 +39,14 @@ Kirigami.ScrollablePage
|
||||||
title: person && person.name ? i18n("%1: %2", person.name, phoneNumber) : phoneNumber
|
title: person && person.name ? i18n("%1: %2", person.name, phoneNumber) : phoneNumber
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
|
model: QSortFilterProxyModel {
|
||||||
model: ConversationModel {
|
|
||||||
id: model
|
id: model
|
||||||
deviceId: device.id()
|
sortOrder: Qt.AscendingOrder
|
||||||
threadId: page.conversationId
|
sortRole: ConversationModel.DateRole
|
||||||
|
sourceModel: ConversationModel {
|
||||||
|
deviceId: device.id()
|
||||||
|
threadId: page.conversationId
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
spacing: Kirigami.Units.largeSpacing
|
spacing: Kirigami.Units.largeSpacing
|
||||||
|
@ -62,7 +65,7 @@ Kirigami.ScrollablePage
|
||||||
placeholderText: i18n("Say hi...")
|
placeholderText: i18n("Say hi...")
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
console.log("sending sms", page.phoneNumber)
|
console.log("sending sms", page.phoneNumber)
|
||||||
model.sendReplyToConversation(message.text)
|
model.sourceModel.sendReplyToConversation(message.text)
|
||||||
text = ""
|
text = ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue