From d2da612ca98eca7e293826ae4e40a2368c15ca2f Mon Sep 17 00:00:00 2001 From: reionwong Date: Thu, 24 Jun 2021 02:32:45 +0800 Subject: [PATCH] Update --- qml/main.qml | 68 +++++++++++++++++++++++------------------------- src/launcher.cpp | 12 +++------ 2 files changed, 35 insertions(+), 45 deletions(-) diff --git a/qml/main.qml b/qml/main.qml index 883ad92..16ed1d1 100755 --- a/qml/main.qml +++ b/qml/main.qml @@ -38,21 +38,18 @@ Item { property bool showed: launcher.showed onShowedChanged: { - rootOpacityAni.restart() - wallpaperColorAni.restart() - blurAnimation.restart() appViewOpacityAni.restart() - appViewScaleAni.restart() + blurAnimation.restart() } - NumberAnimation { - id: rootOpacityAni - from: root.showed ? 1 : 0 - to: root.showed ? 0 : 1 - target: root - property: "opacity" - duration: 200 - } +// NumberAnimation { +// id: rootOpacityAni +// from: root.showed ? 1 : 0 +// to: root.showed ? 0 : 1 +// target: root +// property: "opacity" +// duration: 200 +// } NumberAnimation { id: blurAnimation @@ -63,24 +60,24 @@ Item { to: root.showed ? 0 : 72 } - NumberAnimation { - id: wallpaperColorAni - target: wallpaperColor - property: "opacity" - from: root.showed ? 0.4 : 0.0 - to: root.showed ? 0.0 : 0.4 - duration: 250 - } - - NumberAnimation { - id: appViewScaleAni - target: appView - property: "scale" - easing.type: Easing.OutCubic - from: root.showed ? 1.0 : 1.2 - to: root.showed ? 1.2 : 1.0 - duration: 180 - } +// NumberAnimation { +// id: wallpaperColorAni +// target: wallpaperColor +// property: "opacity" +// from: root.showed ? 0.4 : 0.0 +// to: root.showed ? 0.0 : 0.4 +// duration: 250 +// } + +// NumberAnimation { +// id: appViewScaleAni +// target: appView +// property: "scale" +// easing.type: Easing.OutCubic +// from: root.showed ? 1.0 : 1.2 +// to: root.showed ? 1.2 : 1.0 +// duration: 180 +// } NumberAnimation { id: appViewOpacityAni @@ -89,7 +86,7 @@ Item { easing.type: Easing.OutCubic from: root.showed ? 1.0 : 0.0 to: root.showed ? 0.0 : 1.0 - duration: 240 + duration: 250 } Wallpaper { @@ -111,17 +108,18 @@ Item { FastBlur { id: wallpaperBlur anchors.fill: parent + radius: 72 source: wallpaper cached: true visible: true } - ColorOverlay { id: wallpaperColor anchors.fill: parent source: wallpaperBlur color: "#000000" + opacity: 0.4 visible: true } @@ -141,7 +139,8 @@ Item { id: mainLayout anchors.fill: parent anchors.leftMargin: launcher.screenAvailableRect ? launcher.screenAvailableRect.x : 0 - anchors.topMargin: launcher.screenAvailableRect ? launcher.screenAvailableRect.y + root.maxSpacing * 2 : 0 + // anchors.topMargin: launcher.screenAvailableRect ? launcher.screenAvailableRect.y + root.maxSpacing * 2 : 0 + anchors.topMargin: launcher.screenRect.y + FishUI.Units.largeSpacing * 2 anchors.rightMargin: launcher.screenRect.width - (launcher.screenAvailableRect.x + launcher.screenAvailableRect.width) anchors.bottomMargin: launcher.screenRect.height - (launcher.screenAvailableRect.y + launcher.screenAvailableRect.height - root.verticalSpacing) @@ -164,8 +163,6 @@ Item { width: searchItem.width * 0.2 height: parent.height - opacity: root.showed ? 1.0 : 0.0 - leftPadding: FishUI.Units.largeSpacing rightPadding: FishUI.Units.largeSpacing @@ -273,7 +270,6 @@ Item { interactive: true spacing: FishUI.Units.largeSpacing Layout.alignment: Qt.AlignHCenter - opacity: root.showed ? 1.0 : 0.0 delegate: Rectangle { width: 10 diff --git a/src/launcher.cpp b/src/launcher.cpp index 59d4df4..1183a00 100644 --- a/src/launcher.cpp +++ b/src/launcher.cpp @@ -68,24 +68,18 @@ bool Launcher::showed() void Launcher::showWindow() { - if (m_hideTimer->isActive()) - m_hideTimer->stop(); - m_showed = true; - setVisible(true); emit showedChanged(); + + setVisible(true); } void Launcher::hideWindow() { - if (m_hideTimer->isActive()) - m_hideTimer->stop(); - - // Start to execute qml exit animation m_showed = false; emit showedChanged(); - m_hideTimer->start(); + setVisible(false); } void Launcher::toggle()