Merge PR #676: Hide inactive instances more agressively

pull/678/head
Jenkins nymea 2021-09-19 22:20:39 +02:00
commit 41d7f685f2
1 changed files with 13 additions and 0 deletions

View File

@ -86,6 +86,18 @@ Item {
interactive: false
currentIndex: configuredHostsModel.currentIndex
onCurrentIndexChanged: visibleHackTimer.start();
// Hack: we only want the current one visible for performance reasons, however, during transitions this might look odd
// as we need to show two views partially at the same time.
// Couldn't find a way to determine the swipeView position, so let's assume it's moving for a second after currentIndex changed
Timer {
id: visibleHackTimer
repeat: false
interval: 500
running: false
}
Repeater {
id: mainRepeater
model: configuredHostsModel
@ -94,6 +106,7 @@ Item {
height: swipeView.height
width: swipeView.width
clip: true
visible: SwipeView.isCurrentItem || visibleHackTimer.running
readonly property ConfiguredHost configuredHost: configuredHostsModel.get(index)