pull/6/head
reionwong 4 years ago
parent a54d5db285
commit d2da612ca9

@ -38,21 +38,18 @@ Item {
property bool showed: launcher.showed property bool showed: launcher.showed
onShowedChanged: { onShowedChanged: {
rootOpacityAni.restart()
wallpaperColorAni.restart()
blurAnimation.restart()
appViewOpacityAni.restart() appViewOpacityAni.restart()
appViewScaleAni.restart() blurAnimation.restart()
} }
NumberAnimation { // NumberAnimation {
id: rootOpacityAni // id: rootOpacityAni
from: root.showed ? 1 : 0 // from: root.showed ? 1 : 0
to: root.showed ? 0 : 1 // to: root.showed ? 0 : 1
target: root // target: root
property: "opacity" // property: "opacity"
duration: 200 // duration: 200
} // }
NumberAnimation { NumberAnimation {
id: blurAnimation id: blurAnimation
@ -63,24 +60,24 @@ Item {
to: root.showed ? 0 : 72 to: root.showed ? 0 : 72
} }
NumberAnimation { // NumberAnimation {
id: wallpaperColorAni // id: wallpaperColorAni
target: wallpaperColor // target: wallpaperColor
property: "opacity" // property: "opacity"
from: root.showed ? 0.4 : 0.0 // from: root.showed ? 0.4 : 0.0
to: root.showed ? 0.0 : 0.4 // to: root.showed ? 0.0 : 0.4
duration: 250 // duration: 250
} // }
NumberAnimation { // NumberAnimation {
id: appViewScaleAni // id: appViewScaleAni
target: appView // target: appView
property: "scale" // property: "scale"
easing.type: Easing.OutCubic // easing.type: Easing.OutCubic
from: root.showed ? 1.0 : 1.2 // from: root.showed ? 1.0 : 1.2
to: root.showed ? 1.2 : 1.0 // to: root.showed ? 1.2 : 1.0
duration: 180 // duration: 180
} // }
NumberAnimation { NumberAnimation {
id: appViewOpacityAni id: appViewOpacityAni
@ -89,7 +86,7 @@ Item {
easing.type: Easing.OutCubic easing.type: Easing.OutCubic
from: root.showed ? 1.0 : 0.0 from: root.showed ? 1.0 : 0.0
to: root.showed ? 0.0 : 1.0 to: root.showed ? 0.0 : 1.0
duration: 240 duration: 250
} }
Wallpaper { Wallpaper {
@ -111,17 +108,18 @@ Item {
FastBlur { FastBlur {
id: wallpaperBlur id: wallpaperBlur
anchors.fill: parent anchors.fill: parent
radius: 72
source: wallpaper source: wallpaper
cached: true cached: true
visible: true visible: true
} }
ColorOverlay { ColorOverlay {
id: wallpaperColor id: wallpaperColor
anchors.fill: parent anchors.fill: parent
source: wallpaperBlur source: wallpaperBlur
color: "#000000" color: "#000000"
opacity: 0.4
visible: true visible: true
} }
@ -141,7 +139,8 @@ Item {
id: mainLayout id: mainLayout
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: launcher.screenAvailableRect ? launcher.screenAvailableRect.x : 0 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.rightMargin: launcher.screenRect.width - (launcher.screenAvailableRect.x + launcher.screenAvailableRect.width)
anchors.bottomMargin: launcher.screenRect.height - (launcher.screenAvailableRect.y + launcher.screenAvailableRect.height - root.verticalSpacing) anchors.bottomMargin: launcher.screenRect.height - (launcher.screenAvailableRect.y + launcher.screenAvailableRect.height - root.verticalSpacing)
@ -164,8 +163,6 @@ Item {
width: searchItem.width * 0.2 width: searchItem.width * 0.2
height: parent.height height: parent.height
opacity: root.showed ? 1.0 : 0.0
leftPadding: FishUI.Units.largeSpacing leftPadding: FishUI.Units.largeSpacing
rightPadding: FishUI.Units.largeSpacing rightPadding: FishUI.Units.largeSpacing
@ -273,7 +270,6 @@ Item {
interactive: true interactive: true
spacing: FishUI.Units.largeSpacing spacing: FishUI.Units.largeSpacing
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
opacity: root.showed ? 1.0 : 0.0
delegate: Rectangle { delegate: Rectangle {
width: 10 width: 10

@ -68,24 +68,18 @@ bool Launcher::showed()
void Launcher::showWindow() void Launcher::showWindow()
{ {
if (m_hideTimer->isActive())
m_hideTimer->stop();
m_showed = true; m_showed = true;
setVisible(true);
emit showedChanged(); emit showedChanged();
setVisible(true);
} }
void Launcher::hideWindow() void Launcher::hideWindow()
{ {
if (m_hideTimer->isActive())
m_hideTimer->stop();
// Start to execute qml exit animation
m_showed = false; m_showed = false;
emit showedChanged(); emit showedChanged();
m_hideTimer->start(); setVisible(false);
} }
void Launcher::toggle() void Launcher::toggle()

Loading…
Cancel
Save