From 105c1aa9d8d380275946d9cd8b3236e4c844969a Mon Sep 17 00:00:00 2001 From: Dominik Holland Date: Thu, 13 Oct 2016 13:01:51 +0200 Subject: [PATCH] Performance improvement 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 --- sysui/Home/MapWidget.qml | 1 + sysui/MenuScreen.qml | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/sysui/Home/MapWidget.qml b/sysui/Home/MapWidget.qml index fb81e18..9a419a3 100644 --- a/sysui/Home/MapWidget.qml +++ b/sysui/Home/MapWidget.qml @@ -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}) } } } diff --git a/sysui/MenuScreen.qml b/sysui/MenuScreen.qml index aef4380..9abcb3e 100644 --- a/sysui/MenuScreen.qml +++ b/sysui/MenuScreen.qml @@ -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) } } }