Display room's latest event instead of topic when possible.

This commit is contained in:
Black Hat
2018-08-22 23:21:39 +08:00
parent e428e9f005
commit cca9467703
6 changed files with 25 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ import "qrc:/qml/component"
Item {
property alias listModel: roomListProxyModel.sourceModel
property alias rawCurrentIndex: listView.currentIndex
readonly property int currentIndex: roomListProxyModel.mapToSource(listView.currentIndex)
readonly property var currentRoom: currentIndex != -1 ? listModel.roomAt(currentIndex) : null
readonly property bool mini: MatriqueSettings.miniMode // Used as an indicator of whether the listform should be displayed as "Mini mode".
@@ -96,6 +97,10 @@ Item {
sorters: [
RoleSorter { roleName: "category" },
RoleSorter {
roleName: "unreadCount"
sortOrder: Qt.DescendingOrder
},
StringSorter { roleName: "name" }
]
}
@@ -165,7 +170,7 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
text: name ? name : ""
text: name || "No Name"
font.pointSize: 16
elide: Text.ElideRight
wrapMode: Text.NoWrap
@@ -175,7 +180,7 @@ Item {
Layout.fillWidth: true
Layout.fillHeight: true
text: topic ? topic : "No topic yet."
text: lastEvent || topic
elide: Text.ElideRight
wrapMode: Text.NoWrap
}