From 668e365b435843d26bd56b77a1ae1b780ecf31b9 Mon Sep 17 00:00:00 2001 From: reionwong Date: Wed, 3 Nov 2021 01:29:31 +0800 Subject: [PATCH] Trash: Add animation --- qml/DockItem.qml | 6 +++--- qml/main.qml | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/qml/DockItem.qml b/qml/DockItem.qml index 591b5b6..963bcef 100644 --- a/qml/DockItem.qml +++ b/qml/DockItem.qml @@ -160,13 +160,13 @@ Item { Rectangle { id: activeRect - property var leftX: 3 + property var leftX: 2 property var leftY: (parent.height - height) / 2 property var bottomX: (parent.width - width) / 2 - property var bottomY: icon.y + icon.height + activeRect.height / 2 - 2 + property var bottomY: icon.y + icon.height + activeRect.height / 2 - 1 - property var rightX: icon.x + icon.width + activeRect.width / 2 - 2 + property var rightX: icon.x + icon.width + activeRect.width / 2 - 1 property var rightY: (parent.height - height) / 2 property var circleSize: isBottom ? control.height * 0.06 : control.width * 0.06 diff --git a/qml/main.qml b/qml/main.qml index 88164c5..b2148c7 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -133,6 +133,24 @@ Item { onClicked: trash.openTrash() onRightClicked: trashMenu.popup() + dropArea.enabled: true + + Rectangle { + anchors.fill: parent + anchors.margins: FishUI.Units.smallSpacing / 2 + color: "transparent" + border.color: FishUI.Theme.textColor + radius: height * 0.3 + border.width: 1 + opacity: trashItem.dropArea.containsDrag ? 0.8 : 0 + + Behavior on opacity { + NumberAnimation { + duration: 200 + } + } + } + FishUI.DesktopMenu { id: trashMenu