Merge lp://staging/~mzanetti/unity/phablet-folding-launcher into lp://staging/unity/phablet

Proposed by Michael Zanetti
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: no longer in the source branch.
Merged at revision: 732
Proposed branch: lp://staging/~mzanetti/unity/phablet-folding-launcher
Merge into: lp://staging/unity/phablet
Diff against target: 1923 lines (+902/-677)
18 files modified
Launcher/Launcher.qml (+161/-337)
Launcher/LauncherDelegate.qml (+127/-0)
Launcher/LauncherPanel.qml (+82/-279)
Shell.qml (+13/-21)
plugins/Ubuntu/Gestures/DirectionalDragArea.cpp (+11/-4)
plugins/Ubuntu/Gestures/DirectionalDragArea.h (+3/-2)
plugins/Unity/CMakeLists.txt (+1/-0)
plugins/Unity/launchermodel.cpp (+153/-0)
plugins/Unity/launchermodel.h (+86/-0)
plugins/Unity/plugin.cpp (+3/-0)
tests/autopilot/qml_phone_shell/tests/helpers.py (+1/-1)
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.cpp (+3/-1)
tests/qmltests/CMakeLists.txt (+1/-1)
tests/qmltests/Launcher/tst_Launcher.qml (+17/-31)
tests/qmltests/plugins/Unity/CMakeLists.txt (+1/-0)
tests/qmltests/plugins/Unity/fake_launchermodel.cpp (+150/-0)
tests/qmltests/plugins/Unity/fake_launchermodel.h (+86/-0)
tests/qmltests/plugins/Unity/fake_unity_plugin.cpp (+3/-0)
To merge this branch: bzr merge lp://staging/~mzanetti/unity/phablet-folding-launcher
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Daniel d'Andrada (community) Approve
Michał Sawicz Needs Information
Review via email: mp+166000@code.staging.launchpad.net

Commit message

refactored launcher
- moved dummy data one level towards real implementation
- throw away all unused demo experiments from the launcher
- add folding effect
- preliminary (and disabled) drag'n'drop feature for icons

Description of the change

Ugly dummy data will of course be removed again when switching to real API.

preliminary drag and drop support in there is disabled as its not really working anyways. This will be fixed/completed in next steps.

This also fixes a signal in the DirectionalDragArea. As dragging is defined by (undecided || recognized) a switch to rejected should signal the ending of the drag.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

My 2¢ here:
* feels like the long-drag-launcher-to-dash-apps has an unnecessary delay (behavior?) between the finger and the app edge
* when (un)folding, the icons change in distance from the adjacent, unfolded icon - that's not necessarily bad, just noting to make sure that's ok with design

review: Needs Information
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Good refactoring and clean up. Looks way better now!

=====================================================

Icons are not getting highlighted when pressed. The only way I could get an icon highlighted was by long-pressing it.

=====================================================

The branch alone works fine, but if I merge it with latest trunk it get the following wrong behavior:
I have an application on foreground. Right from the beginning of a left-edge drag the application window slides rightwards instead of only after the launcher is fully revealed.

======================================================

+ MouseArea {
+ id: closeMouseArea
+ enabled: root.state == "visible"
+ anchors.fill: panel
+ anchors.rightMargin: -units.gu(2)
+ drag {
+ axis: Drag.XAxis
+ maximumX: 0
+ target: panel
+ }
+
+ onReleased: {
+ if (panel.x < -panel.width/3) {
+ root.switchToNextState("")
+ } else {
+ root.switchToNextState("visible")
             }
         }
- }

- function hide() {
- launcher.state = ""
+ }
+ MouseArea {
+ anchors {
+ left: closeMouseArea.right
+ top: parent.top
+ right: parent.right
+ bottom: parent.bottom
+ }
+ enabled: root.state == "visible"
+ onPressed: {
+ root.state = ""
+ }
     }

I think second MouseArea should be the one named "closeMouseArea" (as it closes the launcher when clicked), not the first one.

============================================================

+ if (distance > root.width / 2){

Coding style: spacing between ')' and '{'

============================================================

- default: // Rejected
+ case Rejected:
+ Q_EMIT draggingChanged(false);
+ break;
+ default:
             // no-op
             break;

Since the default case now deals specifically with invalid states, we could make it issue a qFatal().

============================================================

You can remove this line from Launcher.qml:

import "../Applications/applications.js" as ApplicationsModel

And this one from tst_Launcher.qml:

import "../../../Applications/applications.js" as ApplicationsModel

============================================================

In Shell.qml:

"""
+ InputFilterArea {
+ blockInput: launcher.shown
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ left: parent.left
+ }
+ width: launcher.shown ? launcher.width : launcher.panelWidth
+ }

"""

Why not make width just:

+ width: launcher.width

Afterall it only works when launcher.shown is true anyway.

============================================================

tst_Launcher fails to run due to missing symbols, related to "import Unity 0.1".

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> My 2¢ here:
> * feels like the long-drag-launcher-to-dash-apps has an unnecessary delay
> (behavior?) between the finger and the app edge

Hmm... might be this:
Behavior on x {SmoothedAnimation{velocity: 600}}

However, I did not touch this and the current launcher has the same. If it would be just some NumberAnimation I would disable it while dragging, but as it is a SmoothedAnimation with some velocity it seems kinda intentional. I'll have a chat with Vesa about it.

> * when (un)folding, the icons change in distance from the adjacent, unfolded
> icon - that's not necessarily bad, just noting to make sure that's ok with
> design

Hmm... this seems to be pretty much the same distance as it is on the desktop. However, next steps in the design work is to figure how many folded items should be visible. Depending on how the others will fade out, this most likely will still change by design.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :
Download full text (3.4 KiB)

> Icons are not getting highlighted when pressed. The only way I could get an
> icon highlighted was by long-pressing it.

fixed.

> =====================================================
>
> The branch alone works fine, but if I merge it with latest trunk it get the
> following wrong behavior:
> I have an application on foreground. Right from the beginning of a left-edge
> drag the application window slides rightwards instead of only after the
> launcher is fully revealed.

Hmm... Can't reproduce. After merging it still seems to be the same for me.

> ======================================================
>
> + MouseArea {
> + id: closeMouseArea
> + enabled: root.state == "visible"
> + anchors.fill: panel
> + anchors.rightMargin: -units.gu(2)
> + drag {
> + axis: Drag.XAxis
> + maximumX: 0
> + target: panel
> + }
> +
> + onReleased: {
> + if (panel.x < -panel.width/3) {
> + root.switchToNextState("")
> + } else {
> + root.switchToNextState("visible")
> }
> }
> - }
>
> - function hide() {
> - launcher.state = ""
> + }
> + MouseArea {
> + anchors {
> + left: closeMouseArea.right
> + top: parent.top
> + right: parent.right
> + bottom: parent.bottom
> + }
> + enabled: root.state == "visible"
> + onPressed: {
> + root.state = ""
> + }
> }
>
> I think second MouseArea should be the one named "closeMouseArea" (as it
> closes the launcher when clicked), not the first one.

Fixed.

> ============================================================
>
> + if (distance > root.width / 2){
>
> Coding style: spacing between ')' and '{'

Fixed.

> ============================================================
>
> - default: // Rejected
> + case Rejected:
> + Q_EMIT draggingChanged(false);
> + break;
> + default:
> // no-op
> break;
>
> Since the default case now deals specifically with invalid states, we could
> make it issue a qFatal().

How I read it, the default case is still valid for the Recognized state.

> ============================================================
>
> You can remove this line from Launcher.qml:
>
> import "../Applications/applications.js" as ApplicationsModel
>
> And this one from tst_Launcher.qml:
>
> import "../../../Applications/applications.js" as ApplicationsModel

fixed.

> ============================================================
>
> In Shell.qml:
>
> """
> + InputFilterArea {
> + blockInput: launcher.shown
> + anchors {
> + top: parent.top
> + bottom: parent.bottom
> + left: parent.left
> + }
> + width: launcher.shown ? launcher.width : launcher.panelWidth
> + }
>
> """
>
> Why not make width just:
>
> + width: launcher.width
>
> Afterall it only works when launcher.shown is true anyway.

Fixed.

> ==================================================...

Read more...

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> >
> > The branch alone works fine, but if I merge it with latest trunk it get the
> > following wrong behavior:
> > I have an application on foreground. Right from the beginning of a left-edge
> > drag the application window slides rightwards instead of only after the
> > launcher is fully revealed.
>
> Hmm... Can't reproduce. After merging it still seems to be the same for me.

Well, it's also working fine for me now. Let's forget about it then. :)

> >
> > - default: // Rejected
> > + case Rejected:
> > + Q_EMIT draggingChanged(false);
> > + break;
> > + default:
> > // no-op
> > break;
> >
> > Since the default case now deals specifically with invalid states, we could
> > make it issue a qFatal().
>
> How I read it, the default case is still valid for the Recognized state.

Right!

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

One last detail I just spotted:

plugins/Unity/launchermodel.cpp:56:5: warning: unused parameter ‘parent’ [-Wunused-parameter]

review: Needs Fixing
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> plugins/Unity/launchermodel.cpp:56:5: warning: unused parameter ‘parent’
> [-Wunused-parameter]

fixed

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

All good.

Do you think it makes sense to fix those warnings that are output when tst_Launcher.qml is run?

review: Approve
Revision history for this message
Michael Zanetti (mzanetti) wrote :

> Do you think it makes sense to fix those warnings that are output when
> tst_Launcher.qml is run?

Done.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

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