From 7fc43c58bee8212217e2c0ba9c9dcc15b56171d4 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 21 Feb 2020 09:56:21 -0800 Subject: mobile/dive-list: long press on dive selects and opens context drawer This way one can execute dive list manipulations without the detour to the dive details screen. For example you can long-press on a dive and then add it to a trip or remove it from a trip. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveList.qml | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 7ecd9287a..f09609a73 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -74,6 +74,18 @@ Kirigami.ScrollablePage { } } } + // use this to select a dive without switching to dive details; instead open context drawer + onPressAndHold: { + view.currentIndex = index + if (isTrip) { + manager.appendTextToLog("press and hold on trip is same as click") + manager.toggle(model.row) + } else { + manager.appendTextToLog("press and hold on dive; open context drawer") + manager.selectRow(model.row) + contextDrawer.open() + } + } // first we look at the trip Item { -- cgit v1.2.3-70-g09d2