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
|
// Roughly equivalent to what Kirigami does for its built-in headings
|
||||||
Layout.leftMargin: Kirigami.Units.gridUnit - Kirigami.Units.mediumSpacing
|
Layout.leftMargin: Kirigami.Units.gridUnit - Kirigami.Units.mediumSpacing
|
||||||
visible: !root.collapsed
|
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 {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|||||||
@@ -29,63 +29,42 @@ Kirigami.NavigationTabBar {
|
|||||||
|
|
||||||
actions: [
|
actions: [
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
id: infoAction
|
id: homeAction
|
||||||
text: i18n("Search")
|
|
||||||
icon.name: "search"
|
text: i18nc("@action:button The 'normal' view of NeoChat including the room list", "Home")
|
||||||
onTriggered: {
|
icon.name: "user-home-symbolic"
|
||||||
if (explorePopup.visible && explorePopupLoader.sourceComponent == search) {
|
checked: true
|
||||||
explorePopup.close();
|
|
||||||
root.currentIndex = -1;
|
|
||||||
} else if (explorePopup.visible && explorePopupLoader.sourceComponent != search) {
|
|
||||||
explorePopup.close();
|
|
||||||
explorePopup.open();
|
|
||||||
} else {
|
|
||||||
explorePopup.open();
|
|
||||||
}
|
|
||||||
explorePopupLoader.switchComponent(search);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
text: i18nc("@action:inmenu Explore public rooms and spaces", "Explore")
|
id: notificationsAction
|
||||||
icon.name: "compass"
|
|
||||||
|
text: i18nc("@action:button View all notifications for this account", "Notifications")
|
||||||
|
icon.name: "notifications-symbolic"
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
explorePopup.close();
|
(root.Kirigami.PageStack.pageStack as Kirigami.PageRow).pushDialogLayer(Qt.createComponent('org.kde.neochat', 'NotificationsView'), {
|
||||||
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'), {
|
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
}, {
|
}, {
|
||||||
title: i18nc("@title", "Find your friends")
|
title: i18nc("@title", "Notifications"),
|
||||||
});
|
modality: Qt.NonModal
|
||||||
root.currentIndex = -1;
|
})
|
||||||
|
homeAction.checked = true; // Reset back to Home
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Kirigami.Action {
|
Kirigami.Action {
|
||||||
text: i18n("Create New")
|
id: accountAction
|
||||||
icon.name: "list-add"
|
|
||||||
|
text: i18nc("@action:button Open the account menu", "Account")
|
||||||
|
icon.name: "im-user-symbolic"
|
||||||
|
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (explorePopup.visible && explorePopupLoader.sourceComponent == create) {
|
accountMenu.popup(root.QQC2.Overlay.overlay);
|
||||||
explorePopup.close();
|
homeAction.checked = true; // Reset back to Home
|
||||||
root.currentIndex = -1;
|
}
|
||||||
} else if (explorePopup.visible && explorePopupLoader.sourceComponent != create) {
|
|
||||||
explorePopup.close();
|
readonly property AccountMenu accountMenu: AccountMenu {
|
||||||
explorePopup.open();
|
connection: root.connection
|
||||||
} else {
|
window: QQC2.ApplicationWindow.window as Kirigami.ApplicationWindow
|
||||||
explorePopup.open();
|
|
||||||
}
|
|
||||||
explorePopupLoader.switchComponent(create);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ Kirigami.Page {
|
|||||||
|
|
||||||
titleDelegate: Loader {
|
titleDelegate: Loader {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
sourceComponent: Kirigami.Settings.isMobile ? userInfo : exploreComponent
|
sourceComponent: exploreComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ QQC2.Control {
|
|||||||
contentItem: Kirigami.Icon {
|
contentItem: Kirigami.Icon {
|
||||||
source: "notifications"
|
source: "notifications"
|
||||||
}
|
}
|
||||||
|
visible: !Kirigami.Settings.isMobile // Shows up in the mobile bar instead
|
||||||
|
|
||||||
activeFocusOnTab: true
|
activeFocusOnTab: true
|
||||||
|
|
||||||
@@ -74,6 +75,8 @@ QQC2.Control {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.Separator {
|
Kirigami.Separator {
|
||||||
|
visible: notificationsButton.visible
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: Kirigami.Units.smallSpacing
|
Layout.leftMargin: Kirigami.Units.smallSpacing
|
||||||
Layout.rightMargin: Kirigami.Units.smallSpacing
|
Layout.rightMargin: Kirigami.Units.smallSpacing
|
||||||
|
|||||||
Reference in New Issue
Block a user