Commit cb71a777 authored by Devin Lin's avatar Devin Lin 🎨
Browse files

homescreens/halcyon: Properly implement home button trigger animations

parent e80408a9
......@@ -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
......
......@@ -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 {
......
......@@ -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
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment