From 738d6e6a8402ac11245ec738da75920b39ad6830 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 11 Jan 2018 09:31:44 +0100 Subject: Next/Previous buttons --- views/inboxcrusher/qml/View.qml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'views') diff --git a/views/inboxcrusher/qml/View.qml b/views/inboxcrusher/qml/View.qml index 7059a8eb..cb662c33 100644 --- a/views/inboxcrusher/qml/View.qml +++ b/views/inboxcrusher/qml/View.qml @@ -26,12 +26,10 @@ FocusScope { property variant currentMail: null Keys.onRightPressed: { - modelIndexRetriever.currentIndex = modelIndexRetriever.currentIndex + 1 + modelIndexRetriever.increaseCurrentIndex() } Keys.onLeftPressed: { - if (modelIndexRetriever.currentIndex > 0) { - modelIndexRetriever.currentIndex = modelIndexRetriever.currentIndex - 1 - } + modelIndexRetriever.decreaseCurrentIndex() } Kube.ModelIndexRetriever { id: modelIndexRetriever @@ -97,6 +95,18 @@ FocusScope { onClicked: { } } + Kube.Button { + text: qsTr("Previous") + onClicked: { + modelIndexRetriever.decreaseCurrentIndex() + } + } + Kube.Button { + text: qsTr("Next") + onClicked: { + modelIndexRetriever.increaseCurrentIndex() + } + } } } } -- cgit v1.2.3