booru: page number

This commit is contained in:
end-4
2025-04-28 23:58:10 +02:00
parent 1f5ea7b983
commit f24cd8fa35
3 changed files with 101 additions and 40 deletions
@@ -15,6 +15,17 @@ Item {
property var panelWindow
property var inputField: tagInputField
Keys.onPressed: (event) => {
tagInputField.forceActiveFocus()
if (event.key === Qt.Key_PageUp) {
booruResponseListView.contentY = Math.max(0, booruResponseListView.contentY - booruResponseListView.height / 2)
event.accepted = true
} else if (event.key === Qt.Key_PageDown) {
booruResponseListView.contentY = Math.min(booruResponseListView.contentHeight - booruResponseListView.height, booruResponseListView.contentY + booruResponseListView.height / 2)
event.accepted = true
}
}
onFocusChanged: (focus) => {
if (focus) {
tagInputField.forceActiveFocus()
@@ -39,6 +50,14 @@ Item {
}
}
Behavior on contentY {
NumberAnimation {
id: scrollAnim
duration: Appearance.animation.elementDecel.duration
easing.type: Appearance.animation.elementDecel.type
}
}
spacing: 10
model: ScriptModel {
values: Booru.responses