Minor DebugConsole improvements

Startup animation, top position by default, add F1 shortcut
This commit is contained in:
miruka 2019-12-09 12:27:40 -04:00
parent 9b9cf274ac
commit f125b6d60e
2 changed files with 5 additions and 4 deletions

View File

@ -118,7 +118,7 @@ class UISettings(JSONConfigFile):
}, },
"keys": { "keys": {
"startPythonDebugger": ["Alt+Shift+D"], "startPythonDebugger": ["Alt+Shift+D"],
"toggleDebugConsole": ["Alt+Shift+C"], "toggleDebugConsole": ["Alt+Shift+C", "F1"],
"reloadConfig": ["Alt+Shift+R"], "reloadConfig": ["Alt+Shift+R"],
"zoomIn": ["Ctrl++"], "zoomIn": ["Ctrl++"],

View File

@ -6,13 +6,14 @@ import "utils.js" as Utils
HDrawer { HDrawer {
id: debugConsole id: debugConsole
edge: Qt.BottomEdge edge: Qt.TopEdge
x: horizontal ? 0 : referenceSizeParent.width / 2 - width / 2 x: horizontal ? 0 : referenceSizeParent.width / 2 - width / 2
y: vertical ? 0 : referenceSizeParent.height / 2 - height / 2 y: vertical ? 0 : referenceSizeParent.height / 2 - height / 2
width: horizontal ? calculatedSize : Math.min(window.width, 720) width: horizontal ? calculatedSize : Math.min(window.width, 720)
height: vertical ? calculatedSize : Math.min(window.width, 480) height: vertical ? calculatedSize : Math.min(window.width, 480)
normalSize: 360 normalSize: 360
z: 9999 z: 9999
position: 0
property var target: null property var target: null
property alias t: debugConsole.target property alias t: debugConsole.target
@ -41,13 +42,13 @@ HDrawer {
Component.onCompleted: { Component.onCompleted: {
mainUI.shortcuts.debugConsole = debugConsole mainUI.shortcuts.debugConsole = debugConsole
forceActiveFocus()
position = 1
commandsView.model.insert(0, { commandsView.model.insert(0, {
input: "t = " + String(target), input: "t = " + String(target),
output: "", output: "",
error: false, error: false,
}) })
visible = true
forceActiveFocus()
} }
onHistoryEntryChanged: onHistoryEntryChanged: