Use updated ListSectionHeader
Don't override the contentItem for the RoomList section header and just add the extra icon.
This commit is contained in:
@@ -234,25 +234,16 @@ Kirigami.ScrollablePage {
|
|||||||
section.delegate: Kirigami.ListSectionHeader {
|
section.delegate: Kirigami.ListSectionHeader {
|
||||||
id: sectionHeader
|
id: sectionHeader
|
||||||
height: implicitHeight
|
height: implicitHeight
|
||||||
|
label: roomListModel.categoryName(section)
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
onTriggered: roomListModel.setCategoryVisible(section, !roomListModel.categoryVisible(section))
|
onTriggered: roomListModel.setCategoryVisible(section, !roomListModel.categoryVisible(section))
|
||||||
}
|
}
|
||||||
contentItem: RowLayout {
|
contentItem.children: QQC2.ToolButton {
|
||||||
implicitHeight: categoryName.implicitHeight
|
icon.name: page.collapsedMode ? roomListModel.categoryIconName(section) : (roomListModel.categoryVisible(section) ? "go-up" : "go-down")
|
||||||
Kirigami.Heading {
|
icon.width: Kirigami.Units.iconSizes.small
|
||||||
id: categoryName
|
icon.height: Kirigami.Units.iconSizes.small
|
||||||
level: 3
|
|
||||||
text: roomListModel.categoryName(section)
|
onClicked: roomListModel.setCategoryVisible(section, !roomListModel.categoryVisible(section))
|
||||||
Layout.fillWidth: true
|
|
||||||
elide: Text.ElideRight
|
|
||||||
visible: !page.collapsedMode
|
|
||||||
}
|
|
||||||
Kirigami.Icon {
|
|
||||||
source: page.collapsedMode ? roomListModel.categoryIconName(section) : (roomListModel.categoryVisible(section) ? "go-up" : "go-down")
|
|
||||||
implicitHeight: Kirigami.Units.iconSizes.small
|
|
||||||
implicitWidth: Kirigami.Units.iconSizes.small
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user