Hide inactive instances more agressively

This commit is contained in:
Michael Zanetti 2021-09-17 15:12:25 +02:00
parent fc5ec90ba3
commit cb38b11db3

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)