Trash: Add animation

This commit is contained in:
reionwong 2021-11-03 01:29:31 +08:00
parent 7cfdfe040a
commit 668e365b43
2 changed files with 21 additions and 3 deletions

View file

@ -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

View file

@ -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