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.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -87,7 +87,7 @@ Kirigami.Page {
|
||||
|
||||
titleDelegate: Loader {
|
||||
Layout.fillWidth: true
|
||||
sourceComponent: Kirigami.Settings.isMobile ? userInfo : exploreComponent
|
||||
sourceComponent: exploreComponent
|
||||
}
|
||||
|
||||
padding: 0
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user