[SailfishDevel] Silica: On-page drag interaction vs. page switching

Martin Jones martin.jones at jollamobile.com
Fri Mar 1 07:29:01 UTC 2013


Hi,

The most correct way is to set:

drag.target: <id of whatever you're dragging, or just Item {}>
drag.axis: Drag.XAxis

You could also try setting preventStealing: true, but that's a bit brute force.

Br,
Martin.

________________________________________
From: devel-bounces at lists.sailfishos.org [devel-bounces at lists.sailfishos.org] on behalf of Thomas Perl [th.perl at gmail.com]
Sent: 01 March 2013 17:14
To: devel at lists.sailfishos.org
Subject: [SailfishDevel] Silica: On-page drag interaction vs. page switching

Hi,

While porting gPodder, I've noticed that right now, a drag interaction
on a page (e.g. seek bar for audio playback) conflicts with the "drag
to go back to previous page" gesture, see the video here:

http://youtu.be/dRYBG1fQ-kU

Is there anything I can do to "capture" the events and prevent the
page drag interaction from happening? (I'd still like to enable the
drag interaction for that page on non-interactive elements.)

How to reproduce:

 - Create a UI with two Page {} elements
 - Open the first, then the second page
 - On the second page, have a UI Element (e.g. MouseArea) that allows dragging

The MouseArea I'm using is the one at the end of this file (right now,
that's line 113-130):

https://github.com/gpodder/gpodder/blob/master/share/gpodder/ui/qml/PlaybackBarProgress.qml

Is setting "accepted" on the MouseEvent enough or what is the
preferred way to deal with this?

Thanks,
Thomas
_______________________________________________
SailfishOS.org Devel mailing list


More information about the Devel mailing list