aboutsummaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/DiveList.qml
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2018-10-27 13:00:02 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-11-18 06:31:44 +0800
commit88d5eccb17583ea81f09775074a2d263aae89090 (patch)
treecd9abb5646e5585e1783da9919747d8a364d95c9 /mobile-widgets/qml/DiveList.qml
parent37e7602a1e62f85bec0ad2bc12d838175df8968b (diff)
downloadsubsurface-88d5eccb17583ea81f09775074a2d263aae89090.tar.gz
delete-copy-paste buttons layed out properly
Now these buttons are finally shown with long press and seem to be working more-or-less as intended. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'mobile-widgets/qml/DiveList.qml')
-rw-r--r--mobile-widgets/qml/DiveList.qml28
1 files changed, 16 insertions, 12 deletions
diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml
index 41b56601c..f31a2ca8b 100644
--- a/mobile-widgets/qml/DiveList.qml
+++ b/mobile-widgets/qml/DiveList.qml
@@ -118,12 +118,12 @@ Kirigami.ScrollablePage {
}
property bool deleteButtonVisible: false
- property bool copyButtonVisible: true // TODO: false
+ property bool copyButtonVisible: false
property bool pasteButtonVisible: false
onPressAndHold: {
- deleteButtonVisible = false // TODO: true
- copyButtonVisible = false // TODO: true
+ deleteButtonVisible = true
+ copyButtonVisible = true
pasteButtonVisible = true
timer.restart()
}
@@ -143,7 +143,7 @@ Kirigami.ScrollablePage {
}
Item {
id: diveListEntry
- width: parent.width - Kirigami.Units.gridUnit * (innerListItem.deleteButtonVisible ? 3 : 1)
+ width: parent.width - Kirigami.Units.gridUnit * (innerListItem.deleteButtonVisible ? 3 * 3 : 1)
height: Math.ceil(childrenRect.height + Kirigami.Units.smallSpacing)
anchors.left: leftBarDive.right
Controls.Label {
@@ -202,15 +202,16 @@ Kirigami.ScrollablePage {
id: copyButton
visible: copyButtonVisible
height: diveListEntry.height - 2 * Kirigami.Units.smallSpacing
- width: height - 3 * Kirigami.Units.smallSpacing
+ width: height
color: subsurfaceTheme.lightDrawerColor
antialiasing: true
radius: Kirigami.Units.smallSpacing
anchors {
left: diveListEntry.right
- right: parent.right
verticalCenter: diveListEntry.verticalCenter
verticalCenterOffset: Kirigami.Units.smallSpacing / 2
+ rightMargin: horizontalPadding * 2
+ leftMargin: horizontalPadding * 2
}
Kirigami.Icon {
anchors {
@@ -237,15 +238,16 @@ Kirigami.ScrollablePage {
id: pasteButton
visible: pasteButtonVisible
height: diveListEntry.height - 2 * Kirigami.Units.smallSpacing
- width: height - 3 * Kirigami.Units.smallSpacing
- color: subsurfaceTheme.contrastAccentColor
+ width: height
+ color: subsurfaceTheme.lightDrawerColor
antialiasing: true
radius: Kirigami.Units.smallSpacing
anchors {
- left: diveListEntry.right
- right: parent.right
+ left: copyButton.right
verticalCenter: diveListEntry.verticalCenter
verticalCenterOffset: Kirigami.Units.smallSpacing / 2
+ rightMargin: horizontalPadding * 2
+ leftMargin: horizontalPadding * 2
}
Kirigami.Icon {
anchors {
@@ -272,15 +274,17 @@ Kirigami.ScrollablePage {
id: deleteButton
visible: deleteButtonVisible
height: diveListEntry.height - 2 * Kirigami.Units.smallSpacing
- width: height - 3 * Kirigami.Units.smallSpacing
+ width: height
color: subsurfaceTheme.contrastAccentColor
antialiasing: true
radius: Kirigami.Units.smallSpacing
anchors {
- left: diveListEntry.right
+ left: pasteButton.right
right: parent.right
verticalCenter: diveListEntry.verticalCenter
verticalCenterOffset: Kirigami.Units.smallSpacing / 2
+ rightMargin: horizontalPadding * 2
+ leftMargin: horizontalPadding * 2
}
Kirigami.Icon {
anchors {