From 115d4e7466f54d42021cbc3f89655b02e9e2a4fe Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Wed, 11 Feb 2026 19:01:06 -0500 Subject: [PATCH] Reduce the tap target of RoomTreeSection For some reason I don't understand, the ItemDelegate used for these sections are ginormous. There is quite a bit of padding which confuses users as its unexpectedly used for the tap area. I changed it so we only listen for taps inside of the contentItem itself, which is a more suitable area. --- src/rooms/RoomTreeSection.qml | 67 +++++++++++++++++++++-------------- 1 file changed, 40 insertions(+), 27 deletions(-) diff --git a/src/rooms/RoomTreeSection.qml b/src/rooms/RoomTreeSection.qml index 79c850a84..10b479da7 100644 --- a/src/rooms/RoomTreeSection.qml +++ b/src/rooms/RoomTreeSection.qml @@ -31,43 +31,56 @@ QQC2.ItemDelegate { activeFocusOnTab: false background: null - onClicked: root.treeView.toggleExpanded(row) - Keys.onEnterPressed: root.treeView.toggleExpanded(row) Keys.onReturnPressed: root.treeView.toggleExpanded(row) Keys.onSpacePressed: root.treeView.toggleExpanded(row) - contentItem: RowLayout { - spacing: 0 - Kirigami.ListSectionHeader { - Layout.fillWidth: true - visible: !root.collapsed - horizontalPadding: 0 - topPadding: 0 - bottomPadding: 0 - text: root.collapsed ? "" : root.displayName + contentItem: Item { + implicitWidth: layout.implicitWidth + implicitHeight: layout.implicitHeight - onClicked: root.treeView.toggleExpanded(row) - } - QQC2.ToolButton { - id: collapseButton - Layout.alignment: Qt.AlignHCenter + RowLayout { + id: layout - icon { - name: root.expanded ? "go-up" : "go-down" - width: Kirigami.Units.iconSizes.small - height: Kirigami.Units.iconSizes.small + width: root.contentItem.width + + spacing: 0 + + Kirigami.ListSectionHeader { + Layout.fillWidth: true + visible: !root.collapsed + horizontalPadding: 0 + topPadding: 0 + bottomPadding: 0 + text: root.collapsed ? "" : root.displayName + + onClicked: root.treeView.toggleExpanded(row) } - text: root.expanded ? i18nc("Collapse
", "Collapse %1", root.displayName) : i18nc("Expand
", "Collapse %1", root.displayName) : i18nc("Expand