fix(qml):优化应用组收起动画
This commit is contained in:
parent
07f818f3bd
commit
3252ac3bd4
|
@ -247,6 +247,7 @@ ListView {
|
|||
|
||||
cellWidth: width / root.column
|
||||
cellHeight: cellWidth
|
||||
interactive: false
|
||||
|
||||
function indexAtNullItem() {
|
||||
var nullItemIndex;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -40,6 +40,10 @@ SwipeView {
|
|||
property real labelSpacing
|
||||
property bool isFullScreen: false
|
||||
|
||||
function normalScreenIconSignal() {
|
||||
turnPageFinished();
|
||||
}
|
||||
|
||||
function hideFolder() {
|
||||
// 在非第一页时,执行翻页动画
|
||||
if (currentIndex > 0) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -98,7 +98,7 @@ Loader {
|
|||
}
|
||||
PropertyChanges {
|
||||
target: content
|
||||
contentMargins: 0
|
||||
contentMargins: 8
|
||||
labelSpacing: 0
|
||||
labelMagrins: 0
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue