From 0e42042fa41f39da1dcd48bf9069e219496bab7a Mon Sep 17 00:00:00 2001 From: James Graham Date: Wed, 26 Oct 2022 18:18:13 +0000 Subject: [PATCH] Use updated ListSectionHeader Don't override the contentItem for the RoomList section header and just add the extra icon. --- src/qml/Page/RoomListPage.qml | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/qml/Page/RoomListPage.qml b/src/qml/Page/RoomListPage.qml index b86fee1e9..84b8b356e 100644 --- a/src/qml/Page/RoomListPage.qml +++ b/src/qml/Page/RoomListPage.qml @@ -234,25 +234,16 @@ Kirigami.ScrollablePage { section.delegate: Kirigami.ListSectionHeader { id: sectionHeader height: implicitHeight + label: roomListModel.categoryName(section) action: Kirigami.Action { onTriggered: roomListModel.setCategoryVisible(section, !roomListModel.categoryVisible(section)) } - contentItem: RowLayout { - implicitHeight: categoryName.implicitHeight - Kirigami.Heading { - id: categoryName - level: 3 - text: roomListModel.categoryName(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 - } + contentItem.children: QQC2.ToolButton { + icon.name: page.collapsedMode ? roomListModel.categoryIconName(section) : (roomListModel.categoryVisible(section) ? "go-up" : "go-down") + icon.width: Kirigami.Units.iconSizes.small + icon.height: Kirigami.Units.iconSizes.small + + onClicked: roomListModel.setCategoryVisible(section, !roomListModel.categoryVisible(section)) } }