Closed iBelieve closed 11 years ago
I had the same idea with you about swipe but I couldn't figure out how to do it. Now I know! Consider it done ;)
Here is the code to add a background indicator behind a list item when you swipe it:
backgroundIndicator: Rectangle {
anchors.fill: parent
color: "darkgray"
clip: true
Image {
source: "/usr/share/icons/ubuntu-mobile/actions/scalable/delete.svg"
anchors {
top: parent.top
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
margins: units.gu(1.5)
}
width: height
}
}
You'll probably want to change the color so it looks partially transparent on top of a Suru theme.
I have already add a label with info about the swipe. I'll check the code above and see which I like most. :)
In my opinion, the checkbox makes it look more like a task manager instead of a notes app (and there already is a task manager for the showdown, Ubuntu Tasks, which I'm developing). I'd love to see a really good notes app, but I don't think it should be combined with a task manager.
Instead, you could swipe to the right/left to remove tasks. To do this, just set the
removable
property of a list item totrue
. You can also add a background component with a background color and icon. If you want, I can post some code I used for the Core Apps' email client a while back.Also, if you wanted to keep tasks around after being swiped, you could "archive" tasks by swiping so they're still around but hidden by default.