fix startpage appearing over dive list

Use the view, rather than the model to check if the list is empty. This
allows us to use the property notifiers rather than a function call, and
hence fixes updating the visibility of the startpage when the listview
gets filled (or emptied).

Signed-off-by: Sebastian Kügler <sebas@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Sebastian Kügler 2015-11-07 23:46:36 +00:00 committed by Dirk Hohndel
parent 9ff701069d
commit bfe24526d3

View file

@ -169,11 +169,11 @@ Rectangle {
}
StartPage {
anchors.fill: parent
opacity: (diveModel.rowCount() == 0) ? 1.0 : 0
opacity: (diveListView.count == 0) ? 1.0 : 0
visible: opacity > 0
Behavior on opacity { NumberAnimation { duration: units.shortDuration } }
Component.onCompleted: {
print("diveModel.count " + diveModel.rowCount());
print("diveListView.count " + diveListView.count);
}
}
}