From b34a507d514b491b8060d4e21484ba5d5c3ca461 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 8 Jan 2016 21:48:53 -0800 Subject: QML UI: support sliding action to allow the user to delete GPS fixes This is just the UI, the actual deletion is not yet implemented. I really like this interaction with the list items. Slide them to the left and you see icons for actions. Right now we have just one and that may seem like overkill (hey, we could just have the delete icon instead of the application menu icon, right?) but once we allow the ability to show the GPS location on a map we'll have two operations and this will make more sense. Signed-off-by: Dirk Hohndel --- qt-mobile/qml/GpsList.qml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'qt-mobile/qml/GpsList.qml') diff --git a/qt-mobile/qml/GpsList.qml b/qt-mobile/qml/GpsList.qml index f0afc56db..baa65e3b9 100644 --- a/qt-mobile/qml/GpsList.qml +++ b/qt-mobile/qml/GpsList.qml @@ -28,11 +28,12 @@ MobileComponents.Page { Component { id: gpsDelegate - MobileComponents.ListItem { + MobileComponents.ListItemWithActions { id: gpsFix enabled: true width: parent.width property int horizontalPadding: MobileComponents.Units.gridUnit / 2 - MobileComponents.Units.smallSpacing + 1 + Item { width: parent.width - MobileComponents.Units.gridUnit height: childrenRect.height - MobileComponents.Units.smallSpacing @@ -84,8 +85,16 @@ MobileComponents.Page { font.pointSize: subsurfaceTheme.smallPointSize } } - } + actions: [ + Action { + iconName: "dialog-cancel" + onTriggered: { + print("delete this!") + } + } + + ] } } -- cgit v1.2.3-70-g09d2