Plasma mobile HID question: popup on long press
Dirk Hohndel
dirk at hohndel.org
Fri Jan 8 21:35:48 UTC 2016
On Fri, Jan 08, 2016 at 10:18:31PM +0100, Marco Martin wrote:
> On Friday 08 January 2016 13:04:53 Dirk Hohndel wrote:
> > >
> > > To me, this sounds like a case for the "slide to reveal actions" pattern
> > > (see [1]). Would that work in your case?
> >
> > Totally. I didn't know that was an available option with QML / Plasma
> > mobile. Certainly much more elegant than a popup window (so 80s).
> >
> > Any pointers, suggestions how to implement this?
>
> take a look at
> https://quickgit.kde.org/?p=plasma-mobile.git&a=blob&h=495bf02a284c999b688a0d1f5ab2b4eadbf62ec5&hb=9da0a08af277c2d92e069b58571a648795cfc96e&f=components%2Fmobilecomponents%2Fexample%2Fcontents%2Fui%2FMainPage.qml
>
> the part
> delegate: MobileComponents.ListItemWithActions {
> enabled: true
> MobileComponents.Label {
> enabled: true
> text: model.text
> }
> property Item ownPage
> onClicked: {
> root.pageStack.pop(root.initialPage);
> if (!model.component) {
> return;
> }
> ownPage = root.pageStack.push(Qt.resolvedUrl("gallery/" +
> model.component + "Gallery.qml"));
> }
> checked: root.pageStack.currentPage == ownPage
> actions: [
> Controls.Action {
> iconName: "document-decrypt"
> onTriggered: print("Action 1 clicked")
> },
> Controls.Action {
> iconName: "mail-reply-sender"
> }]
> }
>
> I'm still not 100% happy with it since the component is a tad complex, so for
> a list with thousands elements can be noticed not that smpooth while
> scrolling, but can be improved :)
> (and a big stress test like that would be very useful)
Excellent, two people pointing me at the same sample that I clearly missed.
I will play with the ListItemWithActions and see how this goes.
I have more than a thousand elements in that list and have phones from old
and sluggish to state of the art to play with.
I will definitely provide feedback and can easily make sample data
available for people to test with.
Thanks!
/D
More information about the Plasma-devel
mailing list