mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
QML UI: select / unselect dive by clicking on it
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
1de1a85e32
commit
52e07a6306
3 changed files with 27 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue