From 3252ac3bd4b0617b6aeeb58821a6bb6f1e6ddb19 Mon Sep 17 00:00:00 2001 From: qiqi49 Date: Tue, 27 Feb 2024 17:58:23 +0800 Subject: [PATCH] =?UTF-8?q?fix(qml):=E4=BC=98=E5=8C=96=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=BB=84=E6=94=B6=E8=B5=B7=E5=8A=A8=E7=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qml/AppUI/FullScreenAppList.qml | 1 + qml/extensions/FavoriteDelegate.qml | 24 +++++++++++++++++++++--- qml/extensions/FolderContent.qml | 4 ++++ qml/extensions/FolderGridView.qml | 14 ++++++++++++-- qml/extensions/FullScreenFolder.qml | 2 +- 5 files changed, 39 insertions(+), 6 deletions(-) diff --git a/qml/AppUI/FullScreenAppList.qml b/qml/AppUI/FullScreenAppList.qml index 084a034..96182e8 100644 --- a/qml/AppUI/FullScreenAppList.qml +++ b/qml/AppUI/FullScreenAppList.qml @@ -247,6 +247,7 @@ ListView { cellWidth: width / root.column cellHeight: cellWidth + interactive: false function indexAtNullItem() { var nullItemIndex; diff --git a/qml/extensions/FavoriteDelegate.qml b/qml/extensions/FavoriteDelegate.qml index 05786f1..e5f044d 100644 --- a/qml/extensions/FavoriteDelegate.qml +++ b/qml/extensions/FavoriteDelegate.qml @@ -238,6 +238,24 @@ UkuiItems.StyleBackground { Component { id: folderIconComponent Item { + states: [ + State { + name: "iconHide" + PropertyChanges { target: folderIcon; opacity: 0 } + }, + State { + name: "iconShow" + PropertyChanges { target: folderIcon; opacity: 1 } + } + ] + + transitions: [ + Transition { + to: "iconShow" + NumberAnimation { duration: 300; easing.type: Easing.InQuint } + } + ] + AppControls2.FolderIcon { id: folderIcon height: width @@ -250,7 +268,7 @@ UkuiItems.StyleBackground { rows: mainWindow.isFullScreen ? 4 : 2 spacing: mainWindow.isFullScreen ? 4 : 2 padding: mainWindow.isFullScreen ? 8 : 2 - radius: mainWindow.isFullScreen ? 16 :4 + radius: mainWindow.isFullScreen ? Platform.Theme.maxRadius : Platform.Theme.normalRadius } function itemClicked(mouseButton) { if (mouseButton === Qt.RightButton) { @@ -260,7 +278,7 @@ UkuiItems.StyleBackground { var y = mapToGlobal(folderIcon.x, folderIcon.y).y openFolderSignal(id, name, x, y); // 执行隐藏动画,并且当前图标消失且鼠标区域不可用 - opacity = 0; + state = "iconHide"; control.enabled = false; control.hoverEnabled = false; } @@ -270,7 +288,7 @@ UkuiItems.StyleBackground { // folderFunction function resetOpacity() { - itemLoader.item.opacity = 1; + itemLoader.item.state = "iconShow"; control.enabled = true; control.hoverEnabled = true; } diff --git a/qml/extensions/FolderContent.qml b/qml/extensions/FolderContent.qml index 6b388f9..4d4e9f6 100644 --- a/qml/extensions/FolderContent.qml +++ b/qml/extensions/FolderContent.qml @@ -40,6 +40,10 @@ SwipeView { property real labelSpacing property bool isFullScreen: false + function normalScreenIconSignal() { + turnPageFinished(); + } + function hideFolder() { // 在非第一页时,执行翻页动画 if (currentIndex > 0) { diff --git a/qml/extensions/FolderGridView.qml b/qml/extensions/FolderGridView.qml index 7b2708b..527fd91 100644 --- a/qml/extensions/FolderGridView.qml +++ b/qml/extensions/FolderGridView.qml @@ -77,6 +77,7 @@ Loader { x: (parent.width - width) / 2 y: 82 alpha: 0 + opacity: 1 } PropertyChanges { target: content @@ -96,6 +97,7 @@ Loader { x: root.mapFromGlobal(folderX, 0).x y: root.mapFromGlobal(0, folderY).y alpha: 0.1 + opacity: 0 } PropertyChanges { target: content @@ -113,17 +115,21 @@ Loader { ScriptAction { script: content.mouseEnable = false } ParallelAnimation { PropertyAnimation { + target: folderIconBase duration: animationDuration; easing.type: Easing.InOutCubic - properties: "x, y, width, height, radius, alpha" + properties: "x, y, width, height, radius, alpha, opacity" } PropertyAnimation { + target: folderNameText duration: animationDuration; easing.type: Easing.OutQuint properties: "opacity" } PropertyAnimation { + target: content duration: animationDuration; easing.type: Easing.OutQuint properties: "contentMargins, labelMagrins, labelSpacing, labelMagrins" } + ScriptAction { script: content.folderSwipeView.normalScreenIconSignal() } } ScriptAction { script: { @@ -141,14 +147,17 @@ Loader { SequentialAnimation { ParallelAnimation { PropertyAnimation { + target: folderIconBase duration: animationDuration; easing.type: Easing.InOutCubic - properties: "x, y, width, height, radius, alpha" + properties: "x, y, width, height, radius, alpha, opacity" } PropertyAnimation { + target: folderNameText duration: animationDuration; easing.type: Easing.InQuint properties: "opacity" } PropertyAnimation { + target: content duration: animationDuration; easing.type: Easing.OutQuint properties: "contentMargins, labelMagrins, labelSpacing, labelMagrins" } @@ -162,6 +171,7 @@ Loader { } } ] + FolderContent { id: content anchors.fill: parent diff --git a/qml/extensions/FullScreenFolder.qml b/qml/extensions/FullScreenFolder.qml index 176a209..178206d 100644 --- a/qml/extensions/FullScreenFolder.qml +++ b/qml/extensions/FullScreenFolder.qml @@ -98,7 +98,7 @@ Loader { } PropertyChanges { target: content - contentMargins: 0 + contentMargins: 8 labelSpacing: 0 labelMagrins: 0 }