Add toggle icons for section in room list
This commit is contained in:
@@ -48,11 +48,24 @@ Kirigami.ScrollablePage {
|
|||||||
section.property: "category"
|
section.property: "category"
|
||||||
section.delegate: Kirigami.ListSectionHeader {
|
section.delegate: Kirigami.ListSectionHeader {
|
||||||
id: sectionHeader
|
id: sectionHeader
|
||||||
label: roomListModel.categoryName(section)
|
action: Kirigami.Action {
|
||||||
MouseArea {
|
onTriggered: roomListModel.setCategoryVisible(section, !roomListModel.categoryVisible(section))
|
||||||
Layout.fillWidth: true
|
}
|
||||||
Layout.fillHeight: true
|
contentItem: Item {
|
||||||
onClicked: roomListModel.setCategoryVisible(section, !roomListModel.categoryVisible(section))
|
implicitHeight: categoryName.implicitHeight
|
||||||
|
Kirigami.Heading {
|
||||||
|
id: categoryName
|
||||||
|
level: 3
|
||||||
|
text: roomListModel.categoryName(section)
|
||||||
|
}
|
||||||
|
Kirigami.Icon {
|
||||||
|
source: roomListModel.categoryVisible(section) ? "go-up" : "go-down"
|
||||||
|
implicitHeight: Kirigami.Units.iconSizes.small
|
||||||
|
implicitWidth: Kirigami.Units.iconSizes.small
|
||||||
|
anchors.left: categoryName.right
|
||||||
|
anchors.leftMargin: Kirigami.Units.largeSpacing
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user