From 3d663be506fb9f5905cd3853f35ab11e3a0f568d Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 4 Mar 2025 18:20:54 -0500 Subject: [PATCH] Move the "Explore rooms" button from the hamburger to the space drawer I think we should put this feature in a more obvious place (and similar to other chat applications.) Instead of it being buried underneath a menu, joining spaces/rooms should have the space promenience as creating them - you're going to be more likely to access this dialog more anyway. --- src/qml/ExploreComponent.qml | 15 --------------- src/qml/SpaceDrawer.qml | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/qml/ExploreComponent.qml b/src/qml/ExploreComponent.qml index 84d47be5b..2a93afa40 100644 --- a/src/qml/ExploreComponent.qml +++ b/src/qml/ExploreComponent.qml @@ -78,21 +78,6 @@ RowLayout { Component { id: menu QQC2.Menu { - QQC2.MenuItem { - text: i18n("Explore rooms") - icon.name: "compass" - onTriggered: { - let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage'), { - connection: root.connection - }, { - title: i18nc("@title", "Explore Rooms") - }); - dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => { - RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join"); - }); - } - } - QQC2.MenuItem { text: i18n("Find your friends") icon.name: "list-add-user" diff --git a/src/qml/SpaceDrawer.qml b/src/qml/SpaceDrawer.qml index 735d05510..790f91dc0 100644 --- a/src/qml/SpaceDrawer.qml +++ b/src/qml/SpaceDrawer.qml @@ -275,6 +275,31 @@ QQC2.Control { title: i18nc("@title", "Create a Space") }) } + + AvatarTabButton { + Layout.fillWidth: true + Layout.preferredHeight: width - Kirigami.Units.smallSpacing + Layout.maximumHeight: width - Kirigami.Units.smallSpacing + + text: i18nc("@action:button", "Explore rooms") + contentItem: Kirigami.Icon { + source: "compass" + } + + activeFocusOnTab: true + + onSelected: { + let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage'), { + connection: root.connection, + keyword: RoomManager.sortFilterRoomTreeModel.filterText + }, { + title: i18nc("@title", "Explore Rooms") + }); + dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => { + RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join"); + }); + } + } } } }