Skip to content

Commit

Permalink
Performance improvement
Browse files Browse the repository at this point in the history
The ListView of MenuScreen doesn't hide Item's which are currently not
on the screen. The logic has been improved to hide all Items which
are not on the Screen and are not needed for a transition.

In addition we make sure that the surface for the mapWidget is hidden
once the HomeScreen is not visible.

Change-Id: I1974ce997811366fe9f011612b5fa5d91aa7e76d
Reviewed-by: Nedim Hadzic <[email protected]>
  • Loading branch information
Gagi2k committed Oct 13, 2016
1 parent 78e4a5a commit 105c1aa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions sysui/Home/MapWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ UIPanel {
ApplicationManagerInterface.mapWidget.width = Qt.binding(function () { return loader.width})
ApplicationManagerInterface.mapWidget.height = loader.height
loader.children = ApplicationManagerInterface.mapWidget
ApplicationManagerInterface.mapWidget.visible = Qt.binding(function () { return root.visible})
}
}
}
20 changes: 20 additions & 0 deletions sysui/MenuScreen.qml
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,44 @@ PageSwipeScreen {
MyCarPage {
width: root.itemWidth
height: root.height
visible: root.currentIndex === ObjectModel.index ||
root.moving &&
(root.currentIndex + 1 === ObjectModel.index ||
root.currentIndex - 1 === ObjectModel.index)
}
FunctionsPage {
width: root.itemWidth
height: root.height
visible: root.currentIndex === ObjectModel.index ||
root.moving &&
(root.currentIndex + 1 === ObjectModel.index ||
root.currentIndex - 1 === ObjectModel.index)
}
HomePage {
width: root.itemWidth
height: root.height
visible: root.currentIndex === ObjectModel.index ||
root.moving &&
(root.currentIndex + 1 === ObjectModel.index ||
root.currentIndex - 1 === ObjectModel.index)
}
LauncherPage {
id: launcher
width: root.itemWidth
height: root.height
onUpdateApp: currentIndex = 3
visible: root.currentIndex === ObjectModel.index ||
root.moving &&
(root.currentIndex + 1 === ObjectModel.index ||
root.currentIndex - 1 === ObjectModel.index)
}
CloudPage {
width: root.itemWidth
height: root.height
visible: root.currentIndex === ObjectModel.index ||
root.moving &&
(root.currentIndex + 1 === ObjectModel.index ||
root.currentIndex - 1 === ObjectModel.index)
}
}
}

0 comments on commit 105c1aa

Please sign in to comment.