Fix shortcut focus issue?

This commit is contained in:
miruka 2019-09-09 06:44:06 -04:00
parent 6f7695ad22
commit af17151c11
4 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@ Popup {
id: popup
anchors.centerIn: Overlay.overlay
modal: true
focus: true
padding: 0

View File

@ -6,10 +6,16 @@ Item {
Keys.onPressed: {
let shortcut = match(event)
if (! shortcut) return
event.accepted = true
event.isAutoRepeat ? shortcut.held(event) : shortcut.pressed(event)
}
Keys.onReleased: {
if (event.isAutoRepeat) return
let shortcut = match(event)
if (! shortcut) return
event.accepted = true
if (shortcut && ! event.isAutoRepeat) shortcut.released(event)
}

View File

@ -8,7 +8,9 @@ import "SidePane"
Item {
id: mainUI
focus: true
Component.onCompleted: window.mainUI = mainUI
Keys.forwardTo: [shortcuts]
property alias shortcuts: shortcuts
property alias sidePane: sidePane

View File

@ -49,6 +49,7 @@ ApplicationWindow {
asynchronous: false
anchors.fill: parent
focus: true
scale: py.ready ? 1 : 0.5
source: py.ready ? (Qt.application.arguments[1] || "UI.qml") : ""