add focus navigation to qml

This commit is contained in:
Cyril Anisimov 2024-09-19 20:27:48 +02:00
parent cecee3769e
commit 01e31b4b4d
23 changed files with 103 additions and 196 deletions

View file

@ -23,10 +23,20 @@ PageType {
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 20
onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (activeFocus) {
if (fl) {
fl.ensureVisible(this)
}
}
}
}
FlickableType {
id: fl
anchors.top: backButton.bottom
anchors.bottom: parent.bottom
contentHeight: content.height
@ -51,6 +61,7 @@ PageType {
SwitcherType {
id: switcher
Layout.fillWidth: true
Layout.topMargin: 16
Layout.leftMargin: 16
@ -66,14 +77,7 @@ PageType {
}
}
onFocusChanged: {
console.debug("MOVE THIS LOGIC TO CPP!")
if (activeFocus) {
if (fl) {
fl.ensureVisible(this)
}
}
}
parentFlickable: fl
}
DividerType {}