From 03e771066bf79c2f719b58948a55547f105f2dc2 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Sun, 4 Jun 2017 14:40:25 +0200 Subject: QML UI: show selection box on the Download from DC list QML and C++ model don't interact too much, a new Rule should be created and used on the QML Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DownloadFromDiveComputer.qml | 1 + mobile-widgets/qml/DownloadedDiveDelegate.qml | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DownloadFromDiveComputer.qml b/mobile-widgets/qml/DownloadFromDiveComputer.qml index 3a5cf6618..c4dc70790 100644 --- a/mobile-widgets/qml/DownloadFromDiveComputer.qml +++ b/mobile-widgets/qml/DownloadFromDiveComputer.qml @@ -116,6 +116,7 @@ Kirigami.Page { datetime: model.datetime duration: model.duration depth: model.depth + selected: model.selected backgroundColor: selectAll ? Kirigami.Theme.highlightColor : Kirigami.Theme.viewBackgroundColor diff --git a/mobile-widgets/qml/DownloadedDiveDelegate.qml b/mobile-widgets/qml/DownloadedDiveDelegate.qml index eb66ce52d..5bfc884b3 100644 --- a/mobile-widgets/qml/DownloadedDiveDelegate.qml +++ b/mobile-widgets/qml/DownloadedDiveDelegate.qml @@ -12,6 +12,7 @@ Kirigami.AbstractListItem { property string depth property string datetime property string duration + property bool selected enabled: true supportsMouseEvents: true @@ -30,9 +31,15 @@ Kirigami.AbstractListItem { NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 } NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 } } + CheckBox { + id: diveIsSelected + checked: innerListItem.selected; + width: childrenRect.heigh - Kirigami.Units.smallSpacing; + height: childrenRect.heigh - Kirigami.Units.smallSpacing; + } Item { id: diveListEntry - width: parent.width - Kirigami.Units.gridUnit * (innerListItem.deleteButtonVisible ? 3 : 1) + width: parent.width - diveIsSelected.width - Kirigami.Units.gridUnit * (innerListItem.deleteButtonVisible ? 3 : 1) height: childrenRect.height - Kirigami.Units.smallSpacing Kirigami.Label { -- cgit v1.2.3-70-g09d2