Fix tab navigation
This commit is contained in:
parent
b5ae104bcd
commit
17a7e0108b
4 changed files with 5 additions and 10 deletions
|
@ -15,7 +15,6 @@ ListView {
|
||||||
signal selected(var event)
|
signal selected(var event)
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
focus: true
|
|
||||||
highlightMoveDuration: 0
|
highlightMoveDuration: 0
|
||||||
highlightResizeDuration: 0
|
highlightResizeDuration: 0
|
||||||
|
|
||||||
|
@ -46,10 +45,6 @@ ListView {
|
||||||
editing = false
|
editing = false
|
||||||
model.remove(currentIndex)
|
model.remove(currentIndex)
|
||||||
break
|
break
|
||||||
case Qt.Key_Tab:
|
|
||||||
case Qt.Key_Backtab:
|
|
||||||
// swallow tabs so we don’t lose focus when editing
|
|
||||||
break
|
|
||||||
default:
|
default:
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -94,8 +89,8 @@ ListView {
|
||||||
model.values = values
|
model.values = values
|
||||||
}
|
}
|
||||||
|
|
||||||
// Try passing key to each field input in order. If none can
|
// Pass the key to parent first to check if Video handles it.
|
||||||
// handle it, pass it to control.
|
// If not, try passing it to each field input when editing.
|
||||||
Keys.forwardTo: Array.prototype.concat(control, editing ? inputs.items : [])
|
Keys.forwardTo: Array.prototype.concat(control, editing ? inputs.items : [])
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
|
@ -122,7 +122,7 @@ Page {
|
||||||
|
|
||||||
onTextChanged: modified = true
|
onTextChanged: modified = true
|
||||||
KeyNavigation.priority: KeyNavigation.BeforeItem
|
KeyNavigation.priority: KeyNavigation.BeforeItem
|
||||||
KeyNavigation.tab: events
|
KeyNavigation.tab: nextItemInFocusChain()
|
||||||
|
|
||||||
Shortcut {
|
Shortcut {
|
||||||
id: shortcutDescription
|
id: shortcutDescription
|
||||||
|
@ -168,8 +168,10 @@ Page {
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.rightMargin: -control.padding
|
Layout.rightMargin: -control.padding
|
||||||
|
|
||||||
|
focusPolicy: Qt.StrongFocus
|
||||||
padding: 1
|
padding: 1
|
||||||
rightPadding: 0
|
rightPadding: 0
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
color: 'transparent'
|
color: 'transparent'
|
||||||
border.color: events.activeFocus ? palette.highlight : palette.dark
|
border.color: events.activeFocus ? palette.highlight : palette.dark
|
||||||
|
|
|
@ -136,7 +136,6 @@ Page {
|
||||||
SpinBox {
|
SpinBox {
|
||||||
id: rate
|
id: rate
|
||||||
implicitWidth: 80
|
implicitWidth: 80
|
||||||
focusPolicy: Qt.NoFocus
|
|
||||||
|
|
||||||
from: 25; to: 250; stepSize: 25
|
from: 25; to: 250; stepSize: 25
|
||||||
value: 100
|
value: 100
|
||||||
|
|
1
main.qml
1
main.qml
|
@ -31,7 +31,6 @@ ApplicationWindow {
|
||||||
video: video
|
video: video
|
||||||
padding: 5
|
padding: 5
|
||||||
leftPadding: 0
|
leftPadding: 0
|
||||||
focus: true
|
|
||||||
SplitView.fillHeight: true
|
SplitView.fillHeight: true
|
||||||
SplitView.preferredWidth: 300
|
SplitView.preferredWidth: 300
|
||||||
SplitView.minimumWidth: 200
|
SplitView.minimumWidth: 200
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue