diff options
-rw-r--r-- | qt-mobile/qml/DiveList.qml | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/qt-mobile/qml/DiveList.qml b/qt-mobile/qml/DiveList.qml index d7fb5fdca..c3a92a93d 100644 --- a/qt-mobile/qml/DiveList.qml +++ b/qt-mobile/qml/DiveList.qml @@ -42,7 +42,23 @@ Kirigami.ScrollablePage { } } + property bool deleteButtonVisible: false + + onPressAndHold: { + deleteButtonVisible = true + timer.restart() + } + + Row { + width: parent.width - Kirigami.Units.gridUnit + height: childrenRect.height - Kirigami.Units.smallSpacing + spacing: horizontalPadding + add: Transition { + NumberAnimation { property: "opacity"; from: 0; to: 1.0; duration: 400 } + NumberAnimation { property: "scale"; from: 0; to: 1.0; duration: 400 } + } Item { + id: diveListEntry width: parent.width - Kirigami.Units.gridUnit height: childrenRect.height - Kirigami.Units.smallSpacing @@ -113,6 +129,40 @@ Kirigami.ScrollablePage { } } } + Rectangle { + visible: deleteButtonVisible + height: diveListEntry.height - Kirigami.Units.smallSpacing + width: height - 3 * Kirigami.Units.smallSpacing + color: "#FF3030" + antialiasing: true + radius: Kirigami.Units.smallSpacing + Kirigami.Icon { + anchors { + horizontalCenter: parent.horizontalCenter + verticalCenter: parent.verticalCenter + } + source: "trash-empty" + } + MouseArea { + anchors.fill: parent + enabled: parent.visible + onClicked: { + parent.visible = false + timer.stop() + manager.deleteDive(dive.id) + } + } + } + Item { + Timer { + id: timer + interval: 4000 + onTriggered: { + deleteButtonVisible = false + } + } + } + } } } |