From 2bacbe7ac79f62f832b1011be1fe89907a9ab321 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Tue, 13 Jan 2026 18:36:49 -0500 Subject: [PATCH] Improve the bottom mobile navigation bar The previous set of actions seems like a random selection, how many rooms is someone creating to be that important? I have redone it to have way fewer actions, mostly notification and settings. --- src/rooms/ExploreComponent.qml | 12 ++++- src/rooms/ExploreComponentMobile.qml | 75 ++++++++++------------------ src/rooms/RoomListPage.qml | 2 +- src/rooms/SpaceDrawer.qml | 3 ++ 4 files changed, 42 insertions(+), 50 deletions(-) diff --git a/src/rooms/ExploreComponent.qml b/src/rooms/ExploreComponent.qml index 260b37b47..ce7d754db 100644 --- a/src/rooms/ExploreComponent.qml +++ b/src/rooms/ExploreComponent.qml @@ -29,7 +29,17 @@ RowLayout { // Roughly equivalent to what Kirigami does for its built-in headings Layout.leftMargin: Kirigami.Units.gridUnit - Kirigami.Units.mediumSpacing visible: !root.collapsed - text: i18nc("@title", "Rooms") + text: { + if (Kirigami.Settings.isMobile) { + if (RoomManager.currentSpace === '') { + return i18nc("@title Home space", "Home"); + } else if(RoomManager.currentSpace === 'DM') { + return i18nc("@title", "Direct Messages"); + } + return root.connection.room(RoomManager.currentSpace).displayName; + } + return i18nc("@title List of rooms", "Rooms"); + } } Item { Layout.fillWidth: true diff --git a/src/rooms/ExploreComponentMobile.qml b/src/rooms/ExploreComponentMobile.qml index 1174771a7..d64e0cf28 100644 --- a/src/rooms/ExploreComponentMobile.qml +++ b/src/rooms/ExploreComponentMobile.qml @@ -29,63 +29,42 @@ Kirigami.NavigationTabBar { actions: [ Kirigami.Action { - id: infoAction - text: i18n("Search") - icon.name: "search" - onTriggered: { - if (explorePopup.visible && explorePopupLoader.sourceComponent == search) { - explorePopup.close(); - root.currentIndex = -1; - } else if (explorePopup.visible && explorePopupLoader.sourceComponent != search) { - explorePopup.close(); - explorePopup.open(); - } else { - explorePopup.open(); - } - explorePopupLoader.switchComponent(search); - } + id: homeAction + + text: i18nc("@action:button The 'normal' view of NeoChat including the room list", "Home") + icon.name: "user-home-symbolic" + checked: true }, Kirigami.Action { - text: i18nc("@action:inmenu Explore public rooms and spaces", "Explore") - icon.name: "compass" + id: notificationsAction + + text: i18nc("@action:button View all notifications for this account", "Notifications") + icon.name: "notifications-symbolic" + onTriggered: { - explorePopup.close(); - let dialog = (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage'), { - connection: root.connection - }, {}); - dialog.roomSelected.connect((roomId, displayName, avatarUrl, alias, topic, memberCount, isJoined) => { - RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, isJoined ? "" : "join"); - }); - root.currentIndex = -1; - } - }, - Kirigami.Action { - text: i18n("Find your friends") - icon.name: "list-add-user" - onTriggered: { - explorePopup.close(); - (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UserSearchPage'), { + (root.Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'NotificationsView'), { connection: root.connection }, { - title: i18nc("@title", "Find your friends") - }); - root.currentIndex = -1; + title: i18nc("@title", "Notifications"), + modality: Qt.NonModal + }) + homeAction.checked = true; // Reset back to Home } }, Kirigami.Action { - text: i18n("Create New") - icon.name: "list-add" + id: accountAction + + text: i18nc("@action:button Open the account menu", "Account") + icon.name: "im-user-symbolic" + onTriggered: { - if (explorePopup.visible && explorePopupLoader.sourceComponent == create) { - explorePopup.close(); - root.currentIndex = -1; - } else if (explorePopup.visible && explorePopupLoader.sourceComponent != create) { - explorePopup.close(); - explorePopup.open(); - } else { - explorePopup.open(); - } - explorePopupLoader.switchComponent(create); + accountMenu.popup(root.QQC2.Overlay.overlay); + homeAction.checked = true; // Reset back to Home + } + + readonly property AccountMenu accountMenu: AccountMenu { + connection: root.connection + window: QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow } } ] diff --git a/src/rooms/RoomListPage.qml b/src/rooms/RoomListPage.qml index 56ab26696..7a7a30901 100644 --- a/src/rooms/RoomListPage.qml +++ b/src/rooms/RoomListPage.qml @@ -87,7 +87,7 @@ Kirigami.Page { titleDelegate: Loader { Layout.fillWidth: true - sourceComponent: Kirigami.Settings.isMobile ? userInfo : exploreComponent + sourceComponent: exploreComponent } padding: 0 diff --git a/src/rooms/SpaceDrawer.qml b/src/rooms/SpaceDrawer.qml index 1d443275b..5c0a968ef 100644 --- a/src/rooms/SpaceDrawer.qml +++ b/src/rooms/SpaceDrawer.qml @@ -62,6 +62,7 @@ QQC2.Control { contentItem: Kirigami.Icon { source: "notifications" } + visible: !Kirigami.Settings.isMobile // Shows up in the mobile bar instead activeFocusOnTab: true @@ -74,6 +75,8 @@ QQC2.Control { } Kirigami.Separator { + visible: notificationsButton.visible + Layout.fillWidth: true Layout.leftMargin: Kirigami.Units.smallSpacing Layout.rightMargin: Kirigami.Units.smallSpacing