Merge lp://qastaging/~zsombi/ubuntu-ui-toolkit/55-snap-options into lp://qastaging/~zsombi/ubuntu-ui-toolkit/listitem-master

Proposed by Zsombor Egri
Status: Merged
Approved by: Tim Peeters
Approved revision: 1314
Merged at revision: 1276
Proposed branch: lp://qastaging/~zsombi/ubuntu-ui-toolkit/55-snap-options
Merge into: lp://qastaging/~zsombi/ubuntu-ui-toolkit/listitem-master
Prerequisite: lp://qastaging/~zsombi/ubuntu-ui-toolkit/50-custom-delegates
Diff against target: 805 lines (+261/-109)
14 files modified
components.api (+2/-1)
modules/Ubuntu/Components/Themes/Ambiance/ListItemPanel.qml (+25/-2)
modules/Ubuntu/Components/Themes/Ambiance/ListItemStyle.qml (+5/-3)
modules/Ubuntu/Components/plugin/uclistitem.cpp (+76/-19)
modules/Ubuntu/Components/plugin/uclistitem.h (+2/-0)
modules/Ubuntu/Components/plugin/uclistitem_p.h (+5/-1)
modules/Ubuntu/Components/plugin/uclistitemactions.cpp (+5/-5)
modules/Ubuntu/Components/plugin/uclistitemactions.h (+0/-3)
modules/Ubuntu/Components/plugin/uclistitemactions_p.h (+1/-0)
modules/Ubuntu/Components/plugin/uclistitemactionsattached.cpp (+0/-24)
modules/Ubuntu/Components/plugin/uclistitemstyle.cpp (+12/-34)
modules/Ubuntu/Components/plugin/uclistitemstyle.h (+8/-9)
modules/Ubuntu/Test/UbuntuTestCase.qml (+3/-6)
tests/unit_x11/tst_components/tst_listitem.qml (+117/-2)
To merge this branch: bzr merge lp://qastaging/~zsombi/ubuntu-ui-toolkit/55-snap-options
Reviewer Review Type Date Requested Status
Tim Peeters Approve
Review via email: mp+235172@code.qastaging.launchpad.net

Commit message

Snap In/Out implementation.

To post a comment you must log in.
1261. By Zsombor Egri

prereq sync

1262. By Zsombor Egri

prereq sync

1263. By Zsombor Egri

prereq sync

1264. By Zsombor Egri

tests fixed

1265. By Zsombor Egri

prereq sync

1266. By Zsombor Egri

test fixes on naming

1267. By Zsombor Egri

prereq sync

1268. By Zsombor Egri

test fix

1269. By Zsombor Egri

prereq merge

1270. By Zsombor Egri

prereq sync

1271. By Zsombor Egri

prereq sync

1272. By Zsombor Egri

prereq sync

1273. By Zsombor Egri

prereq sync

1274. By Zsombor Egri

prereq sync

1275. By Zsombor Egri

prereq sync

1276. By Zsombor Egri

prereq sync

1277. By Zsombor Egri

overshoot

1278. By Zsombor Egri

overshoot completed

1279. By Zsombor Egri

test case fix

1280. By Zsombor Egri

prereq sync

1281. By Zsombor Egri

test cases adjusted to the new snapping logic

1282. By Zsombor Egri

snap out when actions list is changed

1283. By Zsombor Egri

provide a better name for rebounding with no animation

1284. By Zsombor Egri

prereq sync

1285. By Zsombor Egri

prereq sync

1286. By Zsombor Egri

tests fixed

1287. By Zsombor Egri

reboundTo renamed into snapTo

1288. By Zsombor Egri

prereq sync

1289. By Zsombor Egri

prereq sync

1290. By Zsombor Egri

prereq sync

1291. By Zsombor Egri

rename dragged to flicking as dragging will mean different thing

1292. By Zsombor Egri

test fixed

1293. By Zsombor Egri

test adjustments

1294. By Zsombor Egri

prereq sync

1295. By Zsombor Egri

fixing build and adjusting to prereq changes

1296. By Zsombor Egri

adding snap gesture test

1297. By Zsombor Egri

remove unneeded private slot

1298. By Zsombor Egri

prereq sync

1299. By Zsombor Egri

prereq sync

1300. By Zsombor Egri

prereq sync

1301. By Zsombor Egri

prereq sync

1302. By Zsombor Egri

prereq sync

1303. By Zsombor Egri

prereq sync

1304. By Zsombor Egri

leadingPAnel fixed

1305. By Zsombor Egri

prereq sync

1306. By Zsombor Egri

prereq sync

1307. By Zsombor Egri

prereq sync

Revision history for this message
Tim Peeters (tpeeters) wrote :

8 + // track drag dirrection, so we know in which direction we should snap

diRRection

Revision history for this message
Tim Peeters (tpeeters) wrote :

As a developer, I like to configure the overshoot when I use a custom delegate. Is that possible now? I have this delegate:

            delegate: Rectangle {
                color: delegateArea.pressed ? "orange" : "yellow"
                width: units.gu(10)
                ListItemActions.overshoot: 0
                Label {
                    text: action.text
                    anchors.centerIn: parent
                }
                MouseArea {
                    anchors.fill: parent
                    id: delegateArea
                    onPressed: print("press")
                }
            }

which is yellow, but when dragging I can pull a bit further and show the default white background of the panel. Can I disable the overshoot completely to avoid this?

Revision history for this message
Tim Peeters (tpeeters) wrote :

why is overshoot an attached property and not a property of ListItemActions directly?

Revision history for this message
Zsombor Egri (zsombi) wrote :

> As a developer, I like to configure the overshoot when I use a custom
> delegate. Is that possible now? I have this delegate:
>
> delegate: Rectangle {
> color: delegateArea.pressed ? "orange" : "yellow"
> width: units.gu(10)
> ListItemActions.overshoot: 0
> Label {
> text: action.text
> anchors.centerIn: parent
> }
> MouseArea {
> anchors.fill: parent
> id: delegateArea
> onPressed: print("press")
> }
> }
>
> which is yellow, but when dragging I can pull a bit further and show the
> default white background of the panel. Can I disable the overshoot completely
> to avoid this?

If you want to see the white background, you have to have a different actionsDelegate style component (perhaps we should name that differently?). Changing the overshoot to 0 would also mean that the panel cannot be dragged further than the panel size, so you won't see any background.

Revision history for this message
Zsombor Egri (zsombi) wrote :

> why is overshoot an attached property and not a property of ListItemActions
> directly?

that property is needed for the panel for sure. I thought we should expose that in the style, but we can expose it as property to ListItem rather to ListItemActions. As it is not actions specific, it is more like ListItem specific.

1308. By Zsombor Egri

prereq sync

1309. By Zsombor Egri

typo fix

Revision history for this message
Tim Peeters (tpeeters) wrote :

> 8 + // track drag dirrection, so we know in which direction we should
> snap
>
> diRRection

I was highlighting the mistake, direction is with 1 r.

Revision history for this message
Tim Peeters (tpeeters) wrote :

add ListItem.swipeOvershoot, and the style can have a default value for that.

review: Needs Fixing
Revision history for this message
Zsombor Egri (zsombi) wrote :

> add ListItem.swipeOvershoot, and the style can have a default value for that.

Now, we have a slight problem with getting the value from the style... as the style component is loaded only when someone starts swiping the content... so I can only get the value from the style when the style is loaded. Of course this doesn't make any harm when a user value is set on ListItem, but may cause property changed signalled when the style gets loaded.

1310. By Zsombor Egri

swipeOvershoot added to ListItem, overshoot removed from ListItemActions attached properties. Styling added.

Revision history for this message
Tim Peeters (tpeeters) wrote :

286 + * \qmlproperty real ListItem::swipeOvershoot
287 + * The property configures the overshoot value on swiping. Its default value is configured by the style.
288 + */

You can link "style" to ListItemStyle

1311. By Zsombor Egri

overshoot fix

1312. By Zsombor Egri

overshoot fixes

1313. By Zsombor Egri

rogue print removed

1314. By Zsombor Egri

link to style component

Revision history for this message
Zsombor Egri (zsombi) wrote :

> 286 + * \qmlproperty real ListItem::swipeOvershoot
> 287 + * The property configures the overshoot value on swiping. Its
> default value is configured by the style.
> 288 + */
>
> You can link "style" to ListItemStyle

Done.

Revision history for this message
Tim Peeters (tpeeters) wrote :

Perfect. >=0 overshoot works as expected now, and <0 overshoot sets the default value.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches

to all changes: