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.
This commit is contained in:
Joshua Goins
2025-03-04 18:20:54 -05:00
parent 0ada4cdebe
commit 3d663be506
2 changed files with 25 additions and 15 deletions

View File

@@ -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"

View File

@@ -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");
});
}
}
}
}
}