Use flickable for scrolling

Flick when arrow keys are pressed.
This commit is contained in:
Dag Heyman 2017-03-28 14:27:49 +02:00
parent 2c6bba3add
commit e321bca972
No known key found for this signature in database
GPG Key ID: 06FC004369E7D338
2 changed files with 64 additions and 53 deletions

View File

@ -19,7 +19,9 @@ Item {
} else if (!lastCredSelected) {
credRepeater.selected = credRepeater.model[credRepeater.selectedIndex + 1]
credRepeater.selectedIndex = credRepeater.selectedIndex + 1
flickable.flick(0, -300)
}
}
Keys.onUpPressed: {
@ -29,6 +31,7 @@ Item {
} else if (!firstCredSeleced) {
credRepeater.selected = credRepeater.model[credRepeater.selectedIndex - 1]
credRepeater.selectedIndex = credRepeater.selectedIndex - 1
flickable.flick(0, 300)
}
}

View File

@ -195,14 +195,21 @@ ApplicationWindow {
id: timeLeftBar
shouldBeVisible: canShowCredentials
}
ScrollView {
id: scrollView
Layout.fillHeight: true
Layout.fillWidth: true
Flickable {
id: flickable
Layout.fillHeight: true
Layout.fillWidth: true
contentWidth: credentialsColumn.width;
contentHeight: credentialsColumn.height
clip: true
boundsBehavior: Flickable.StopAtBounds
ColumnLayout {
width: scrollView.viewport.width
width: flickable.width
id: credentialsColumn
visible: device.hasDevice && (ccidModeMatch || slotModeMatch)
anchors.right: appWindow.right
@ -263,6 +270,7 @@ ApplicationWindow {
}
}
}
}
TextField {
id: search