Make DebugConsole keyboard-scrollable again

This commit is contained in:
miruka 2020-03-28 12:31:42 -04:00
parent 3f0241b7f1
commit 790229e188
5 changed files with 24 additions and 0 deletions

View File

@ -16,6 +16,7 @@ HPage {
contentHeight: column.childrenRect.height contentHeight: column.childrenRect.height
FlickShortcuts { FlickShortcuts {
enabled: ! mainUI.debugConsole.visible
flickable: flickable flickable: flickable
} }

View File

@ -4,6 +4,7 @@ import QtQuick 2.12
import QtQuick.Window 2.12 import QtQuick.Window 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import "Base" import "Base"
import "ShortcutBundles"
HDrawer { HDrawer {
id: debugConsole id: debugConsole
@ -165,6 +166,11 @@ HDrawer {
} }
} }
FlickShortcuts {
enabled: debugConsole.visible
flickable: commandsView
}
Rectangle { Rectangle {
z: -10 z: -10
anchors.fill: parent anchors.fill: parent

View File

@ -70,6 +70,7 @@ Rectangle {
} }
FlickShortcuts { FlickShortcuts {
enabled: ! mainUI.debugConsole.visible
flickable: eventList flickable: eventList
} }

View File

@ -4,35 +4,45 @@ import QtQuick 2.12
import "../Base" import "../Base"
HQtObject { HQtObject {
id: root
property Item flickable: parent property Item flickable: parent
property bool enabled: true
HShortcut { HShortcut {
enabled: root.enabled
sequences: window.settings.keys.scrollUp sequences: window.settings.keys.scrollUp
onActivated: utils.flickPages(flickable, -1 / 10) onActivated: utils.flickPages(flickable, -1 / 10)
} }
HShortcut { HShortcut {
enabled: root.enabled
sequences: window.settings.keys.scrollDown sequences: window.settings.keys.scrollDown
onActivated: utils.flickPages(flickable, 1 / 10) onActivated: utils.flickPages(flickable, 1 / 10)
} }
HShortcut { HShortcut {
enabled: root.enabled
sequences: window.settings.keys.scrollPageUp sequences: window.settings.keys.scrollPageUp
onActivated: utils.flickPages(flickable, -1) onActivated: utils.flickPages(flickable, -1)
} }
HShortcut { HShortcut {
enabled: root.enabled
sequences: window.settings.keys.scrollPageDown sequences: window.settings.keys.scrollPageDown
onActivated: utils.flickPages(flickable, 1) onActivated: utils.flickPages(flickable, 1)
} }
HShortcut { HShortcut {
enabled: root.enabled
sequences: window.settings.keys.scrollToTop sequences: window.settings.keys.scrollToTop
onActivated: utils.flickToTop(flickable) onActivated: utils.flickToTop(flickable)
} }
HShortcut { HShortcut {
enabled: root.enabled
sequences: window.settings.keys.scrollToBottom sequences: window.settings.keys.scrollToBottom
onActivated: utils.flickToBottom(flickable) onActivated: utils.flickToBottom(flickable)
} }

View File

@ -4,10 +4,15 @@ import QtQuick 2.12
import "../Base" import "../Base"
HQtObject { HQtObject {
id: root
property Item container: parent property Item container: parent
property bool enabled: true
HShortcut { HShortcut {
enabled: root.enabled
sequences: window.settings.keys.previousTab sequences: window.settings.keys.previousTab
onActivated: container.setCurrentIndex( onActivated: container.setCurrentIndex(
utils.numberWrapAt(container.currentIndex - 1, container.count), utils.numberWrapAt(container.currentIndex - 1, container.count),
@ -15,6 +20,7 @@ HQtObject {
} }
HShortcut { HShortcut {
enabled: root.enabled
sequences: window.settings.keys.nextTab sequences: window.settings.keys.nextTab
onActivated: container.setCurrentIndex( onActivated: container.setCurrentIndex(
utils.numberWrapAt(container.currentIndex + 1, container.count), utils.numberWrapAt(container.currentIndex + 1, container.count),