Merge lp://qastaging/~zsombi/ubuntu-ui-toolkit/35-options-panel-swipe into lp://qastaging/~zsombi/ubuntu-ui-toolkit/listitem-master

Proposed by Zsombor Egri
Status: Merged
Approved by: Zsombor Egri
Approved revision: 1311
Merged at revision: 1272
Proposed branch: lp://qastaging/~zsombi/ubuntu-ui-toolkit/35-options-panel-swipe
Merge into: lp://qastaging/~zsombi/ubuntu-ui-toolkit/listitem-master
Prerequisite: lp://qastaging/~zsombi/ubuntu-ui-toolkit/34-snap-animator
Diff against target: 1767 lines (+1074/-69)
22 files modified
components.api (+9/-0)
modules/Ubuntu/Components/Themes/Ambiance/ListItemPanel.qml (+64/-0)
modules/Ubuntu/Components/Themes/Ambiance/ListItemStyle.qml (+34/-0)
modules/Ubuntu/Components/Themes/Ambiance/qmldir (+4/-0)
modules/Ubuntu/Components/plugin/plugin.cpp (+5/-0)
modules/Ubuntu/Components/plugin/plugin.pro (+4/-2)
modules/Ubuntu/Components/plugin/uclistitem.cpp (+389/-47)
modules/Ubuntu/Components/plugin/uclistitem.h (+9/-1)
modules/Ubuntu/Components/plugin/uclistitem_p.h (+24/-3)
modules/Ubuntu/Components/plugin/uclistitemactions.cpp (+158/-3)
modules/Ubuntu/Components/plugin/uclistitemactions.h (+1/-0)
modules/Ubuntu/Components/plugin/uclistitemactions_p.h (+14/-2)
modules/Ubuntu/Components/plugin/uclistitemactionsattached.cpp (+6/-3)
modules/Ubuntu/Components/plugin/uclistitemstyle.cpp (+92/-0)
modules/Ubuntu/Components/plugin/uclistitemstyle.h (+54/-0)
tests/qmlapicheck.sh (+1/-1)
tests/resources/listitems/ListItemTest.qml (+29/-0)
tests/unit/tst_performance/ListItemWithActionsList.qml (+6/-0)
tests/unit/tst_performance/ListItemWithInlineActionsList.qml (+41/-0)
tests/unit/tst_performance/tst_performance.cpp (+2/-1)
tests/unit/tst_performance/tst_performance.pro (+3/-2)
tests/unit_x11/tst_components/tst_listitem.qml (+125/-4)
To merge this branch: bzr merge lp://qastaging/~zsombi/ubuntu-ui-toolkit/35-options-panel-swipe
Reviewer Review Type Date Requested Status
Tim Peeters Approve
Review via email: mp+241036@code.qastaging.launchpad.net

Description of the change

Actions panel handling, swiping and snap animation take in use. Uses fix-size panel for testing.

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

small fixes

1288. By Zsombor Egri

prereq sync

1289. By Zsombor Egri

adjustments to prerequisite changes; documentation fix

1290. By Zsombor Egri

accessing private property fix

1291. By Zsombor Egri

test cases fixed

1292. By Zsombor Egri

prereq sync

1293. By Zsombor Egri

fixing eronous trailingActions assignment

1294. By Zsombor Egri

introduce styling; move ListItemPanel into Ambiance theme, expose ListItemStyle C++ style component from the main plugin

1295. By Zsombor Egri

animation cleanup

1296. By Zsombor Egri

make leadingPanel property readonly

1297. By Zsombor Egri

prereq sync

1298. By Zsombor Egri

adjusting code to prereq changes

1299. By Zsombor Egri

prereq sync

1300. By Zsombor Egri

staging in test fixing

1301. By Zsombor Egri

prereq sync

1302. By Zsombor Egri

prereq sync

1303. By Zsombor Egri

test fix

1304. By Zsombor Egri

fixing tests to comply with prereq changes

1305. By Zsombor Egri

prereq sync

1306. By Zsombor Egri

prereq sync

1307. By Zsombor Egri

method name fixed

1308. By Zsombor Egri

prereq sync

1309. By Zsombor Egri

prereq sync

1310. By Zsombor Egri

prereq sync

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

I don't see icons with this code: http://pastebin.ubuntu.com/9145869/

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

with the code above, the list item text never becomes red, so swiping never becomes true?

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

66 + // for testing
67 + objectName: "ListItemPanel" + (leadingPanel ? "Leading" : "Trailing")

That might appear like you left some debugging code that should not be in the final version.

Change the comment to // Used for autopilot testing in filename.py?
or something similar.

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

74 + Specifies whether the panel is used to visualize leading or trailing options.
75 + */
76 + readonly property bool leadingPanel: panel.ListItemActions.status == panel.ListItemActions.Leading

I prefer readonly property bool leading.
We know we are a panel.

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

> 66 + // for testing
> 67 + objectName: "ListItemPanel" + (leadingPanel ? "Leading" :
> "Trailing")
>
> That might appear like you left some debugging code that should not be in the
> final version.
>
> Change the comment to // Used for autopilot testing in filename.py?
> or something similar.

It is used in module testing.

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

321 + , xAxisMoveThresholdGU(1.5)
322 , overshoot(UCUnits::instance().gu(2))

let's do the x-axis threshold like the overshoot, so:
xAxisMoveThreshold(UCUnits::instance().gu(1.5))

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

372 + if (!UCListItemActionsPrivate::isConnectedTo(leadingActions, q) && !UCListItemActionsPrivate::isConnectedTo(trailingActions, q)) {

add a linebreak

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

383 + * animations. The component does not assume any visuals present in the style,
384 + * and will load its content only when requested, i.e. either of the mentioned
385 + * components are visualized.

the part from i.e. is a bit unclear to me. What do you try to say there?

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

458 + setTugged(false);

didn't we switch from "tug" to "swipe" in a previous MR?

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

should we include a link to ListItemStyle in the ListItem docs?

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

Can we improve this text?

> The component defines the style API for the ListItem component.
> Provides the default actions visualization panel, snap animation,
> selection mode and drag handler delegates. ListItem treats the
> style differently compared to the other components, as it will
> load it only when needed, to load the components defining the
> look and feel of the different configurable elements of the component,
> and will ignore any visuals declared in the style.

Style API for the ListItem component which provides actions, select and
drag handler delegates, and snap animation via its properties.
ListItem treats the style differently compared to the other components,
as it:
- loads the style only when needed
- gets delegates and snap animation from the style properties
- ignores any other visuals defined in the style

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

replace "tug" by "swipe" everywhere?

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

Remove this completely?
I understand the example, but I think it is bad practice to show the same action on both sides, so we should not include it as a code example.

 If
568 + * it is desired to have the same action present in both leading and trailing
569 + * actions, one of the ListItemActions actions list can use the other's list. In
570 + * the following example the list item can be deleted through both leading and
571 + * trailing actions:
572 + * \qml
573 + * ListItem {
574 + * id: listItem
575 + * leadingActions: ListItemActions {
576 + * actions: [
577 + * Action {
578 + * iconName: "delete"
579 + * onTriggered: listItem.destroy()
580 + * }
581 + * ]
582 + * }
583 + * trailingActions: ListItemActions {
584 + * actions: leadingActions.actions
585 + * }
586 + * }

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

1478 === added file 'tests/unit/tst_performance/ListItemWithInlineOptionsList.qml'

filename options-->actions

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

> with the code above, the list item text never becomes red, so swiping never
> becomes true?

First, ListItem attached properties are only valid when attached to their parent, or if used in ListView, then attached to ListView, or when used in Flickables, attached to Flickables.

Second, swiping is not defined for ListItem, but for ListItemAttached. Now that property is valid only for leadin/trailing panels.

It is unfortunate that you can attach the property to any object, but this is something we cannot change. The same happens with ListView attached properties, it doesn't give you any warning/error (as it cannot) if attached to other elements but the ListView's delegate, but only works with the delegate.

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

> 321 + , xAxisMoveThresholdGU(1.5)
> 322 , overshoot(UCUnits::instance().gu(2))
>
> let's do the x-axis threshold like the overshoot, so:
> xAxisMoveThreshold(UCUnits::instance().gu(1.5))

No, I would not. Especially that this is not configurable. If we decide to make it configurable, we can do it later. Yet, there's no reason to watch the units change to update this property, as we need the threshold only when swiping. And if we don't configure it, we can always get the proper pixel amount by converting in place.

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

> 383 + * animations. The component does not assume any visuals present in
> the style,
> 384 + * and will load its content only when requested, i.e. either of the
> mentioned
> 385 + * components are visualized.
>
> the part from i.e. is a bit unclear to me. What do you try to say there?

Perhaps that si not even needed... Will remove it.

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

> 458 + setTugged(false);
>
> didn't we switch from "tug" to "swipe" in a previous MR?

The concept yes, but this staid... I'll change it to swipe

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

> should we include a link to ListItemStyle in the ListItem docs?

Yep. Added.

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

> Can we improve this text?
>
> > The component defines the style API for the ListItem component.
> > Provides the default actions visualization panel, snap animation,
> > selection mode and drag handler delegates. ListItem treats the
> > style differently compared to the other components, as it will
> > load it only when needed, to load the components defining the
> > look and feel of the different configurable elements of the component,
> > and will ignore any visuals declared in the style.
>
> Style API for the ListItem component which provides actions, select and
> drag handler delegates, and snap animation via its properties.
> ListItem treats the style differently compared to the other components,
> as it:
> - loads the style only when needed
> - gets delegates and snap animation from the style properties
> - ignores any other visuals defined in the style

Done.

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

> replace "tug" by "swipe" everywhere?

No. We agreed with design that they call it tug, so we will, at least in the doc.

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

> Remove this completely?
> I understand the example, but I think it is bad practice to show the same
> action on both sides, so we should not include it as a code example.
>
>
> If
> 568 + * it is desired to have the same action present in both leading and
> trailing
> 569 + * actions, one of the ListItemActions actions list can use the
> other's list. In
> 570 + * the following example the list item can be deleted through both
> leading and
> 571 + * trailing actions:
> 572 + * \qml
> 573 + * ListItem {
> 574 + * id: listItem
> 575 + * leadingActions: ListItemActions {
> 576 + * actions: [
> 577 + * Action {
> 578 + * iconName: "delete"
> 579 + * onTriggered: listItem.destroy()
> 580 + * }
> 581 + * ]
> 582 + * }
> 583 + * trailingActions: ListItemActions {
> 584 + * actions: leadingActions.actions
> 585 + * }
> 586 + * }

Why not? this is a practice some apps may apply. So why shouldn't we have it documented on how to do it? This way we can be sure we won't spend useless time by triaging these kind of bugs...

1311. By Zsombor Egri

review comments applied

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

okay, thanks

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: