Fix multiple Global menu issues
See individual commits. When backporting, I'll create a separate patchset just for the we-broke-something-bugs without the strings.
This commit is contained in:
@@ -15,7 +15,7 @@ import org.kde.neochat.settings
|
|||||||
Labs.MenuBar {
|
Labs.MenuBar {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property NeoChatConnection connection
|
required property NeoChatConnection connection
|
||||||
|
|
||||||
Labs.Menu {
|
Labs.Menu {
|
||||||
title: i18nc("menu", "NeoChat")
|
title: i18nc("menu", "NeoChat")
|
||||||
@@ -38,25 +38,31 @@ Labs.MenuBar {
|
|||||||
title: i18nc("menu", "File")
|
title: i18nc("menu", "File")
|
||||||
|
|
||||||
Labs.MenuItem {
|
Labs.MenuItem {
|
||||||
text: i18nc("menu", "Find your friends")
|
icon.name: "list-add-user"
|
||||||
|
text: i18nc("@action:inmenu", "Find your Friends")
|
||||||
enabled: pageStack.layers.currentItem.title !== i18n("Find your friends") && AccountRegistry.accountCount > 0
|
enabled: pageStack.layers.currentItem.title !== i18n("Find your friends") && AccountRegistry.accountCount > 0
|
||||||
onTriggered: pushReplaceLayer(Qt.createComponent('org.kde.neochat', 'UserSearchPage'), {
|
onTriggered: pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'UserSearchPage'), {
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
}, {
|
}, {
|
||||||
title: i18nc("@title", "Find your friends")
|
title: i18nc("@title", "Find your friends")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Labs.MenuItem {
|
Labs.MenuItem {
|
||||||
text: i18nc("menu", "New Group…")
|
icon.name: "system-users-symbolic"
|
||||||
|
text: i18nc("@action:inmenu", "Create a Room…")
|
||||||
enabled: pageStack.layers.currentItem.title !== i18n("Find your friends") && AccountRegistry.accountCount > 0
|
enabled: pageStack.layers.currentItem.title !== i18n("Find your friends") && AccountRegistry.accountCount > 0
|
||||||
shortcut: StandardKey.New
|
shortcut: StandardKey.New
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
const dialog = createRoomDialog.createObject(root.overlay);
|
pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'CreateRoomDialog'), {
|
||||||
dialog.open();
|
connection: root.connection
|
||||||
|
}, {
|
||||||
|
title: i18nc("@title", "Create a Room")
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Labs.MenuItem {
|
Labs.MenuItem {
|
||||||
text: i18nc("menu", "Browse Chats…")
|
icon.name: "compass-symbolic"
|
||||||
|
text: i18nc("@action:inmenu", "Explore Rooms")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage'), {
|
let dialog = pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat', 'ExploreRoomsPage'), {
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
@@ -77,7 +83,8 @@ Labs.MenuBar {
|
|||||||
title: i18nc("menu", "View")
|
title: i18nc("menu", "View")
|
||||||
|
|
||||||
Labs.MenuItem {
|
Labs.MenuItem {
|
||||||
text: i18nc("menu item that opens a UI element called the 'Quick Switcher', which offers a fast keyboard-based interface for switching in between chats.", "Open Quick Switcher")
|
icon.name: "search-symbolic"
|
||||||
|
text: i18nc("@action:inmenu opens a UI element called the 'Quick Switcher', which offers a fast keyboard-based interface for switching in between chats.", "Search Rooms")
|
||||||
onTriggered: quickSwitcher.open()
|
onTriggered: quickSwitcher.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,6 +92,7 @@ Labs.MenuBar {
|
|||||||
title: i18nc("menu", "Window")
|
title: i18nc("menu", "Window")
|
||||||
|
|
||||||
Labs.MenuItem {
|
Labs.MenuItem {
|
||||||
|
icon.name: "view-fullscreen-symbolic"
|
||||||
text: root.visibility === Window.FullScreen ? i18nc("menu", "Exit Full Screen") : i18nc("menu", "Enter Full Screen")
|
text: root.visibility === Window.FullScreen ? i18nc("menu", "Exit Full Screen") : i18nc("menu", "Enter Full Screen")
|
||||||
onTriggered: root.visibility === Window.FullScreen ? root.showNormal() : root.showFullScreen()
|
onTriggered: root.visibility === Window.FullScreen ? root.showNormal() : root.showFullScreen()
|
||||||
}
|
}
|
||||||
@@ -93,14 +101,12 @@ Labs.MenuBar {
|
|||||||
title: i18nc("menu", "Help")
|
title: i18nc("menu", "Help")
|
||||||
|
|
||||||
Labs.MenuItem {
|
Labs.MenuItem {
|
||||||
text: i18nc("menu", "About Matrix")
|
icon.name: "help-about-symbolic"
|
||||||
onTriggered: UrlHelper.openUrl("https://matrix.org/docs/chat_basics/matrix-for-im/")
|
|
||||||
}
|
|
||||||
Labs.MenuItem {
|
|
||||||
text: i18nc("menu", "About NeoChat")
|
text: i18nc("menu", "About NeoChat")
|
||||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent("org.kde.kirigamiaddons.formcard", "AboutPage"))
|
onTriggered: pageStack.pushDialogLayer(Qt.createComponent("org.kde.kirigamiaddons.formcard", "AboutPage"))
|
||||||
}
|
}
|
||||||
Labs.MenuItem {
|
Labs.MenuItem {
|
||||||
|
icon.name: "kde-symbolic"
|
||||||
text: i18nc("menu", "About KDE")
|
text: i18nc("menu", "About KDE")
|
||||||
onTriggered: pageStack.pushDialogLayer(Qt.createComponent("org.kde.kirigamiaddons.formcard", "AboutKDEPage"))
|
onTriggered: pageStack.pushDialogLayer(Qt.createComponent("org.kde.kirigamiaddons.formcard", "AboutKDEPage"))
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -80,9 +80,8 @@ Kirigami.ApplicationWindow {
|
|||||||
|
|
||||||
Loader {
|
Loader {
|
||||||
active: Kirigami.Settings.hasPlatformMenuBar && !Kirigami.Settings.isMobile
|
active: Kirigami.Settings.hasPlatformMenuBar && !Kirigami.Settings.isMobile
|
||||||
sourceComponent: Qt.createComponent("org.kde.neochat", "GlobalMenu")
|
sourceComponent: GlobalMenu {
|
||||||
onActiveChanged: if (active) {
|
connection: root.connection
|
||||||
item.connection = root.connection;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user