From 7ae0bf938202f5f3465fd5c51bbf786063396463 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Fri, 13 Jul 2018 12:41:21 +0800 Subject: [PATCH] Fix currentRoom issue && add category label. --- qml/form/RoomListForm.qml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qml/form/RoomListForm.qml b/qml/form/RoomListForm.qml index 1a21b63..b280f1c 100644 --- a/qml/form/RoomListForm.qml +++ b/qml/form/RoomListForm.qml @@ -11,7 +11,7 @@ import "qrc:/qml/component" Item { property alias listModel: roomListProxyModel.sourceModel - property alias currentIndex: listView.currentIndex + property int currentIndex: roomListProxyModel.mapToSource(listView.currentIndex) readonly property bool mini: width <= 80 // Used as an indicator of whether the listform should be displayed as "Mini mode". ColumnLayout { @@ -188,9 +188,14 @@ Item { section.property: "category" section.criteria: ViewSection.FullString - section.delegate: Rectangle { + section.delegate: Label { width: parent.width - height: 16 + height: 24 + text: section + color: "grey" + leftPadding: 16 + verticalAlignment: Text.AlignVCenter + background: Rectangle { anchors.fill:parent; color: "#dbdbdb" } } } }