mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2025-01-07 11:20:47 +03:00
Use flickable for scrolling
Flick when arrow keys are pressed.
This commit is contained in:
parent
2c6bba3add
commit
e321bca972
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
12
qml/main.qml
12
qml/main.qml
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user