diff --git a/src/qml/DebugConsole.qml b/src/qml/DebugConsole.qml index b4fe8ac2..73b617c1 100644 --- a/src/qml/DebugConsole.qml +++ b/src/qml/DebugConsole.qml @@ -44,6 +44,8 @@ HDrawer { .h, .help Show this help`.replace(/^ {8}/gm, "") ) + readonly property alias commandsView: commandsView + Component.onCompleted: { if (mainUI.shortcuts.debugConsole) diff --git a/src/qml/Shortcuts.qml b/src/qml/Shortcuts.qml index 3f51b4ed..20ee1a74 100644 --- a/src/qml/Shortcuts.qml +++ b/src/qml/Shortcuts.qml @@ -15,6 +15,10 @@ Item { // DebugConsole that should be affected by console shortcuts property DebugConsole debugConsole + readonly property Item toFlick: + debugConsole && debugConsole.activeFocus ? + debugConsole.commandsView : flickTarget + // App @@ -66,46 +70,46 @@ Item { // Page scrolling HShortcut { - enabled: flickTarget + enabled: toFlick sequences: settings.keys.scrollUp - onActivated: Utils.smartVerticalFlick(flickTarget, -335) + onActivated: Utils.smartVerticalFlick(toFlick, -335) } HShortcut { - enabled: flickTarget + enabled: toFlick sequences: settings.keys.scrollDown - onActivated: Utils.smartVerticalFlick(flickTarget, 335) + onActivated: Utils.smartVerticalFlick(toFlick, 335) } HShortcut { - enabled: flickTarget + enabled: toFlick sequences: settings.keys.scrollPageUp onActivated: Utils.smartVerticalFlick( - flickTarget, -2.3 * flickTarget.height, 8, + toFlick, -2.3 * toFlick.height, 8, ) // Ensure only a slight slip after releasing the key - // onReleased: Utils.smartVerticalFlick(flickTarget, -335) + // onReleased: Utils.smartVerticalFlick(toFlick, -335) } HShortcut { - enabled: flickTarget + enabled: toFlick sequences: settings.keys.scrollPageDown onActivated: Utils.smartVerticalFlick( - flickTarget, 2.3 * flickTarget.height, 8, + toFlick, 2.3 * toFlick.height, 8, ) - // onReleased: Utils.smartVerticalFlick(flickTarget, 335) + // onReleased: Utils.smartVerticalFlick(toFlick, 335) } HShortcut { - enabled: flickTarget + enabled: toFlick sequences: settings.keys.scrollToTop - onActivated: Utils.flickToTop(flickTarget) + onActivated: Utils.flickToTop(toFlick) } HShortcut { - enabled: flickTarget + enabled: toFlick sequences: settings.keys.scrollToBottom - onActivated: Utils.flickToBottom(flickTarget) + onActivated: Utils.flickToBottom(toFlick) }