summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.si>2021-09-16 16:57:45 +0200
committerTimotej Lazar <timotej.lazar@araneo.si>2021-09-16 20:34:28 +0200
commit17a7e0108b0a2b4fbd8cb7c1e5d6e269505092e6 (patch)
tree0636939fd1eb52bb9453631352c3739a25795160
parentb5ae104bcddcc6a6a9cf73eab47bb43fe3a6ad14 (diff)
Fix tab navigation
-rw-r--r--Events.qml9
-rw-r--r--Sidebar.qml4
-rw-r--r--Video.qml1
-rw-r--r--main.qml1
4 files changed, 5 insertions, 10 deletions
diff --git a/Events.qml b/Events.qml
index 2128f39..846f2bb 100644
--- a/Events.qml
+++ b/Events.qml
@@ -15,7 +15,6 @@ ListView {
signal selected(var event)
clip: true
- focus: true
highlightMoveDuration: 0
highlightResizeDuration: 0
@@ -46,10 +45,6 @@ ListView {
editing = false
model.remove(currentIndex)
break
- case Qt.Key_Tab:
- case Qt.Key_Backtab:
- // swallow tabs so we don’t lose focus when editing
- break
default:
return
}
@@ -94,8 +89,8 @@ ListView {
model.values = values
}
- // Try passing key to each field input in order. If none can
- // handle it, pass it to control.
+ // Pass the key to parent first to check if Video handles it.
+ // If not, try passing it to each field input when editing.
Keys.forwardTo: Array.prototype.concat(control, editing ? inputs.items : [])
onClicked: {
diff --git a/Sidebar.qml b/Sidebar.qml
index 6c45ccc..fbf1eac 100644
--- a/Sidebar.qml
+++ b/Sidebar.qml
@@ -122,7 +122,7 @@ Page {
onTextChanged: modified = true
KeyNavigation.priority: KeyNavigation.BeforeItem
- KeyNavigation.tab: events
+ KeyNavigation.tab: nextItemInFocusChain()
Shortcut {
id: shortcutDescription
@@ -168,8 +168,10 @@ Page {
Layout.fillHeight: true
Layout.rightMargin: -control.padding
+ focusPolicy: Qt.StrongFocus
padding: 1
rightPadding: 0
+
background: Rectangle {
color: 'transparent'
border.color: events.activeFocus ? palette.highlight : palette.dark
diff --git a/Video.qml b/Video.qml
index dd502ae..423d9d0 100644
--- a/Video.qml
+++ b/Video.qml
@@ -136,7 +136,6 @@ Page {
SpinBox {
id: rate
implicitWidth: 80
- focusPolicy: Qt.NoFocus
from: 25; to: 250; stepSize: 25
value: 100
diff --git a/main.qml b/main.qml
index 7e4d720..c2824a9 100644
--- a/main.qml
+++ b/main.qml
@@ -31,7 +31,6 @@ ApplicationWindow {
video: video
padding: 5
leftPadding: 0
- focus: true
SplitView.fillHeight: true
SplitView.preferredWidth: 300
SplitView.minimumWidth: 200