fix(qml):优化应用组收起动画

This commit is contained in:
qiqi49 2024-02-27 17:58:23 +08:00 committed by iaom
parent 07f818f3bd
commit 3252ac3bd4
5 changed files with 39 additions and 6 deletions

View File

@ -247,6 +247,7 @@ ListView {
cellWidth: width / root.column
cellHeight: cellWidth
interactive: false
function indexAtNullItem() {
var nullItemIndex;

View File

@ -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;
}

View File

@ -40,6 +40,10 @@ SwipeView {
property real labelSpacing
property bool isFullScreen: false
function normalScreenIconSignal() {
turnPageFinished();
}
function hideFolder() {
//
if (currentIndex > 0) {

View File

@ -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

View File

@ -98,7 +98,7 @@ Loader {
}
PropertyChanges {
target: content
contentMargins: 0
contentMargins: 8
labelSpacing: 0
labelMagrins: 0
}