From e79e06235f346e498fbfd512bb868afd8870399d Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Sat, 25 Dec 2021 14:41:43 +0100 Subject: [PATCH] Fix QuickSwitcher activation By making sure the global menu bar is disabled when not needed. This should also help with memory usage. Fix #482 --- imports/NeoChat/Component/QuickSwitcher.qml | 6 ++++++ qml/main.qml | 9 +-------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/imports/NeoChat/Component/QuickSwitcher.qml b/imports/NeoChat/Component/QuickSwitcher.qml index 444c3f9b6..fc42893a5 100644 --- a/imports/NeoChat/Component/QuickSwitcher.qml +++ b/imports/NeoChat/Component/QuickSwitcher.qml @@ -11,6 +11,12 @@ import org.kde.neochat 1.0 QQC2.Popup { id: _popup + Shortcut { + sequence: "Ctrl+K" + enabled: !Kirigami.Settings.hasPlatformMenuBar + onActivated: _popup.open() + } + onVisibleChanged: { if (!visible) { return diff --git a/qml/main.qml b/qml/main.qml index c1d8babc7..7a2c4ee03 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -40,7 +40,7 @@ Kirigami.ApplicationWindow { } Loader { - active: !Kirigami.Settings.isMobile + active: Kirigami.Settings.hasPlatformMenuBar && !Kirigami.Settings.isMobile source: Qt.resolvedUrl("qrc:/imports/NeoChat/Menu/GlobalMenu.qml") } @@ -66,16 +66,9 @@ Kirigami.ApplicationWindow { function onYChanged() { saveWindowGeometryTimer.restart(); } } - Shortcut { - sequence: "Ctrl+K" - onActivated: { - quickView.item.open() - } - } Loader { id: quickView - active: !Kirigami.Settings.isMobile sourceComponent: QuickSwitcher { } }