diff --git a/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml b/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml index 3daa2d26..74d1f581 100644 --- a/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml +++ b/containments/homescreens/halcyon/package/contents/ui/FavoritesView.qml @@ -38,6 +38,16 @@ Item { signal openConfigureRequested() + function goToBeginning() { + goToBeginningAnim.restart(); + } + + function closeFolder() { + if (folderShown) { + folderShown = false; + } + } + FavoritesGrid { id: favoritesGrid anchors.fill: parent @@ -77,7 +87,7 @@ Item { twoColumn: root.twoColumn onOpenConfigureRequested: root.openConfigureRequested() - onCloseRequested: root.folderShown = false + onCloseRequested: root.closeFolder() property real translateX: 0 transform: Translate { x: folderGrid.translateX } @@ -85,6 +95,15 @@ Item { visible: opacity !== 0 } + NumberAnimation { + id: goToBeginningAnim + target: favoritesGrid + properties: 'contentY' + to: favoritesGrid.originY + duration: 200 + easing.type: Easing.InOutQuad + } + SequentialAnimation { id: openFolderAnim diff --git a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml index bd0cb212..ff852363 100644 --- a/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml +++ b/containments/homescreens/halcyon/package/contents/ui/GridAppList.qml @@ -32,6 +32,17 @@ MobileShell.GridView { cacheBuffer: Math.max(0, rows * cellHeight) + function goToBeginning() { + goToBeginningAnim.restart(); + } + + NumberAnimation on contentY { + id: goToBeginningAnim + to: gridView.originY + duration: 200 + easing.type: Easing.InOutQuad + } + model: Halcyon.ApplicationListModel header: MobileShell.BaseItem { diff --git a/containments/homescreens/halcyon/package/contents/ui/HomeScreen.qml b/containments/homescreens/halcyon/package/contents/ui/HomeScreen.qml index 812b8532..53e177a4 100644 --- a/containments/homescreens/halcyon/package/contents/ui/HomeScreen.qml +++ b/containments/homescreens/halcyon/package/contents/ui/HomeScreen.qml @@ -25,6 +25,9 @@ Item { function triggerHomescreen() { swipeView.setCurrentIndex(0); + favoritesView.closeFolder(); + favoritesView.goToBeginning(); + gridAppList.goToBeginning(); } function openConfigure() { @@ -53,6 +56,7 @@ Item { } FavoritesView { + id: favoritesView anchors.fill: parent searchWidget: root.searchWidget interactive: root.interactive @@ -67,13 +71,17 @@ Item { property real horizontalMargin: Math.max(Kirigami.Units.largeSpacing, root.width * 0.1 / 2) - GridAppList { - interactive: root.interactive - leftMargin: column.horizontalMargin - rightMargin: column.horizontalMargin - effectiveContentWidth: swipeView.width - leftMargin - rightMargin + QQC2.ScrollView { Layout.fillWidth: true Layout.fillHeight: true + + GridAppList { + id: gridAppList + interactive: root.interactive + leftMargin: column.horizontalMargin + rightMargin: column.horizontalMargin + effectiveContentWidth: swipeView.width - leftMargin - rightMargin + } } } }