From 52e07a63065a8207da6ebf81be6c9c1b9c901d4a Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 29 May 2017 20:36:00 +0200 Subject: QML UI: select / unselect dive by clicking on it Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index e17032dd9..1e93fc3ea 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -15,6 +15,8 @@ Kirigami.Page { Layout.fillWidth: true; title: qsTr("Dive Computer") + property bool selectAll : false + DCDownloadThread { id: downloadThread deviceData.vendor : comboVendor.currentText @@ -99,9 +101,17 @@ Kirigami.Page { model : importModel delegate : DownloadedDiveDelegate { + id: delegate datetime: model.datetime duration: model.duration depth: model.depth + + backgroundColor: selectAll ? Kirigami.Theme.highlightColor : Kirigami.Theme.viewBackgroundColor + + onClicked : { + console.log("Selecting index" + index); + importModel.selectRow(index) + } } } @@ -126,10 +136,17 @@ Kirigami.Page { } Button { text: qsTr("Select All") + onClicked : { + selectAll = true + importModel.selectAll() + } } Button { - id: unselectbutton text: qsTr("Unselect All") + onClicked : { + selectAll = false + importModel.selectNone() + } } } } -- cgit v1.2.3-70-g09d2