From f5b0cbb204080dac394de3ab7ce8c8ac3b2f9195 Mon Sep 17 00:00:00 2001 From: miruka Date: Mon, 9 Dec 2019 12:32:46 -0400 Subject: [PATCH] Make new console when needed & destroy old console --- src/qml/DebugConsole.qml | 3 +++ src/qml/Shortcuts.qml | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/qml/DebugConsole.qml b/src/qml/DebugConsole.qml index a7791851..b6619b4a 100644 --- a/src/qml/DebugConsole.qml +++ b/src/qml/DebugConsole.qml @@ -41,6 +41,9 @@ HDrawer { Component.onCompleted: { + if (mainUI.shortcuts.debugConsole) + mainUI.shortcuts.debugConsole.destroy() + mainUI.shortcuts.debugConsole = debugConsole forceActiveFocus() position = 1 diff --git a/src/qml/Shortcuts.qml b/src/qml/Shortcuts.qml index da60e1b1..3f51b4ed 100644 --- a/src/qml/Shortcuts.qml +++ b/src/qml/Shortcuts.qml @@ -25,9 +25,15 @@ Item { } HShortcut { - enabled: debugMode && debugConsole + enabled: debugMode sequences: settings.keys.toggleDebugConsole - onActivated: debugConsole.visible = ! debugConsole.visible + onActivated: { + if (debugConsole) { + debugConsole.visible = ! debugConsole.visible + } else { + Utils.debug(mainUI || window) + } + } } HShortcut {