fix(qml):优化应用组收起动画
This commit is contained in:
parent
07f818f3bd
commit
3252ac3bd4
|
@ -247,6 +247,7 @@ ListView {
|
||||||
|
|
||||||
cellWidth: width / root.column
|
cellWidth: width / root.column
|
||||||
cellHeight: cellWidth
|
cellHeight: cellWidth
|
||||||
|
interactive: false
|
||||||
|
|
||||||
function indexAtNullItem() {
|
function indexAtNullItem() {
|
||||||
var nullItemIndex;
|
var nullItemIndex;
|
||||||
|
|
|
@ -238,6 +238,24 @@ UkuiItems.StyleBackground {
|
||||||
Component {
|
Component {
|
||||||
id: folderIconComponent
|
id: folderIconComponent
|
||||||
Item {
|
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 {
|
AppControls2.FolderIcon {
|
||||||
id: folderIcon
|
id: folderIcon
|
||||||
height: width
|
height: width
|
||||||
|
@ -250,7 +268,7 @@ UkuiItems.StyleBackground {
|
||||||
rows: mainWindow.isFullScreen ? 4 : 2
|
rows: mainWindow.isFullScreen ? 4 : 2
|
||||||
spacing: mainWindow.isFullScreen ? 4 : 2
|
spacing: mainWindow.isFullScreen ? 4 : 2
|
||||||
padding: mainWindow.isFullScreen ? 8 : 2
|
padding: mainWindow.isFullScreen ? 8 : 2
|
||||||
radius: mainWindow.isFullScreen ? 16 :4
|
radius: mainWindow.isFullScreen ? Platform.Theme.maxRadius : Platform.Theme.normalRadius
|
||||||
}
|
}
|
||||||
function itemClicked(mouseButton) {
|
function itemClicked(mouseButton) {
|
||||||
if (mouseButton === Qt.RightButton) {
|
if (mouseButton === Qt.RightButton) {
|
||||||
|
@ -260,7 +278,7 @@ UkuiItems.StyleBackground {
|
||||||
var y = mapToGlobal(folderIcon.x, folderIcon.y).y
|
var y = mapToGlobal(folderIcon.x, folderIcon.y).y
|
||||||
openFolderSignal(id, name, x, y);
|
openFolderSignal(id, name, x, y);
|
||||||
// 执行隐藏动画,并且当前图标消失且鼠标区域不可用
|
// 执行隐藏动画,并且当前图标消失且鼠标区域不可用
|
||||||
opacity = 0;
|
state = "iconHide";
|
||||||
control.enabled = false;
|
control.enabled = false;
|
||||||
control.hoverEnabled = false;
|
control.hoverEnabled = false;
|
||||||
}
|
}
|
||||||
|
@ -270,7 +288,7 @@ UkuiItems.StyleBackground {
|
||||||
|
|
||||||
// folderFunction
|
// folderFunction
|
||||||
function resetOpacity() {
|
function resetOpacity() {
|
||||||
itemLoader.item.opacity = 1;
|
itemLoader.item.state = "iconShow";
|
||||||
control.enabled = true;
|
control.enabled = true;
|
||||||
control.hoverEnabled = true;
|
control.hoverEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,6 +40,10 @@ SwipeView {
|
||||||
property real labelSpacing
|
property real labelSpacing
|
||||||
property bool isFullScreen: false
|
property bool isFullScreen: false
|
||||||
|
|
||||||
|
function normalScreenIconSignal() {
|
||||||
|
turnPageFinished();
|
||||||
|
}
|
||||||
|
|
||||||
function hideFolder() {
|
function hideFolder() {
|
||||||
// 在非第一页时,执行翻页动画
|
// 在非第一页时,执行翻页动画
|
||||||
if (currentIndex > 0) {
|
if (currentIndex > 0) {
|
||||||
|
|
|
@ -77,6 +77,7 @@ Loader {
|
||||||
x: (parent.width - width) / 2
|
x: (parent.width - width) / 2
|
||||||
y: 82
|
y: 82
|
||||||
alpha: 0
|
alpha: 0
|
||||||
|
opacity: 1
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: content
|
target: content
|
||||||
|
@ -96,6 +97,7 @@ Loader {
|
||||||
x: root.mapFromGlobal(folderX, 0).x
|
x: root.mapFromGlobal(folderX, 0).x
|
||||||
y: root.mapFromGlobal(0, folderY).y
|
y: root.mapFromGlobal(0, folderY).y
|
||||||
alpha: 0.1
|
alpha: 0.1
|
||||||
|
opacity: 0
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: content
|
target: content
|
||||||
|
@ -113,17 +115,21 @@ Loader {
|
||||||
ScriptAction { script: content.mouseEnable = false }
|
ScriptAction { script: content.mouseEnable = false }
|
||||||
ParallelAnimation {
|
ParallelAnimation {
|
||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
|
target: folderIconBase
|
||||||
duration: animationDuration; easing.type: Easing.InOutCubic
|
duration: animationDuration; easing.type: Easing.InOutCubic
|
||||||
properties: "x, y, width, height, radius, alpha"
|
properties: "x, y, width, height, radius, alpha, opacity"
|
||||||
}
|
}
|
||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
|
target: folderNameText
|
||||||
duration: animationDuration; easing.type: Easing.OutQuint
|
duration: animationDuration; easing.type: Easing.OutQuint
|
||||||
properties: "opacity"
|
properties: "opacity"
|
||||||
}
|
}
|
||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
|
target: content
|
||||||
duration: animationDuration; easing.type: Easing.OutQuint
|
duration: animationDuration; easing.type: Easing.OutQuint
|
||||||
properties: "contentMargins, labelMagrins, labelSpacing, labelMagrins"
|
properties: "contentMargins, labelMagrins, labelSpacing, labelMagrins"
|
||||||
}
|
}
|
||||||
|
ScriptAction { script: content.folderSwipeView.normalScreenIconSignal() }
|
||||||
}
|
}
|
||||||
ScriptAction {
|
ScriptAction {
|
||||||
script: {
|
script: {
|
||||||
|
@ -141,14 +147,17 @@ Loader {
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
ParallelAnimation {
|
ParallelAnimation {
|
||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
|
target: folderIconBase
|
||||||
duration: animationDuration; easing.type: Easing.InOutCubic
|
duration: animationDuration; easing.type: Easing.InOutCubic
|
||||||
properties: "x, y, width, height, radius, alpha"
|
properties: "x, y, width, height, radius, alpha, opacity"
|
||||||
}
|
}
|
||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
|
target: folderNameText
|
||||||
duration: animationDuration; easing.type: Easing.InQuint
|
duration: animationDuration; easing.type: Easing.InQuint
|
||||||
properties: "opacity"
|
properties: "opacity"
|
||||||
}
|
}
|
||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
|
target: content
|
||||||
duration: animationDuration; easing.type: Easing.OutQuint
|
duration: animationDuration; easing.type: Easing.OutQuint
|
||||||
properties: "contentMargins, labelMagrins, labelSpacing, labelMagrins"
|
properties: "contentMargins, labelMagrins, labelSpacing, labelMagrins"
|
||||||
}
|
}
|
||||||
|
@ -162,6 +171,7 @@ Loader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
FolderContent {
|
FolderContent {
|
||||||
id: content
|
id: content
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
@ -98,7 +98,7 @@ Loader {
|
||||||
}
|
}
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: content
|
target: content
|
||||||
contentMargins: 0
|
contentMargins: 8
|
||||||
labelSpacing: 0
|
labelSpacing: 0
|
||||||
labelMagrins: 0
|
labelMagrins: 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue