mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Mobile: consistently refer to the dive list model
The number of different ways we tried to refer to the model made my head spin. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
9e09a7d920
commit
ae27dd77a7
1 changed files with 11 additions and 8 deletions
|
@ -330,7 +330,7 @@ Kirigami.ScrollablePage {
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
text: {
|
text: {
|
||||||
diveListView.model ? diveListView.model.tripShortDate(section) : "no data model"
|
diveListModel ? diveListModel.tripShortDate(section) : "no data model"
|
||||||
}
|
}
|
||||||
color: subsurfaceTheme.primaryTextColor
|
color: subsurfaceTheme.primaryTextColor
|
||||||
font.pointSize: subsurfaceTheme.smallPointSize
|
font.pointSize: subsurfaceTheme.smallPointSize
|
||||||
|
@ -346,16 +346,18 @@ Kirigami.ScrollablePage {
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: headingBackground
|
anchors.fill: headingBackground
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (diveTripModel.activeTrip() === section)
|
if (diveListModel) {
|
||||||
diveTripModel.setActiveTrip("")
|
if (diveListModel.activeTrip() === section)
|
||||||
else
|
diveListModel.setActiveTrip("")
|
||||||
diveTripModel.setActiveTrip(section)
|
else
|
||||||
|
diveListModel.setActiveTrip(section)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Controls.Label {
|
Controls.Label {
|
||||||
id: sectionText
|
id: sectionText
|
||||||
text: {
|
text: {
|
||||||
diveListView.model ? diveListView.model.tripTitle(section) : "no data model"
|
diveListModel ? diveListModel.tripTitle(section) : "no data model"
|
||||||
}
|
}
|
||||||
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
|
||||||
visible: text !== ""
|
visible: text !== ""
|
||||||
|
@ -491,7 +493,7 @@ Kirigami.ScrollablePage {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
opacity: 1.0 - startPage.opacity
|
opacity: 1.0 - startPage.opacity
|
||||||
visible: opacity > 0
|
visible: opacity > 0
|
||||||
model: page.diveListModel
|
model: diveListModel
|
||||||
currentIndex: -1
|
currentIndex: -1
|
||||||
delegate: diveDelegate
|
delegate: diveDelegate
|
||||||
header: filterHeader
|
header: filterHeader
|
||||||
|
@ -578,7 +580,8 @@ Kirigami.ScrollablePage {
|
||||||
function setCurrentDiveListIndex(idx, noScroll) {
|
function setCurrentDiveListIndex(idx, noScroll) {
|
||||||
// pick the dive in the dive list and make sure its trip is expanded
|
// pick the dive in the dive list and make sure its trip is expanded
|
||||||
diveListView.currentIndex = idx
|
diveListView.currentIndex = idx
|
||||||
diveTripModel.setActiveTrip(diveListView.currentItem.myData.tripId)
|
if (diveListModel)
|
||||||
|
diveListModel.setActiveTrip(diveListView.currentItem.myData.tripId)
|
||||||
|
|
||||||
// update the diveDetails page to also show that dive
|
// update the diveDetails page to also show that dive
|
||||||
detailsWindow.showDiveIndex(idx)
|
detailsWindow.showDiveIndex(idx)
|
||||||
|
|
Loading…
Add table
Reference in a new issue