Merge lp:~mzanetti/unity8/reveal-launcher-with-mouse-hover into lp:unity8

Proposed by Michael Zanetti on 2015-02-06
Status: Merged
Approved by: Albert Astals Cid on 2015-02-23
Approved revision: 1600
Merged at revision: 1623
Proposed branch: lp:~mzanetti/unity8/reveal-launcher-with-mouse-hover
Merge into: lp:unity8
Diff against target: 76 lines (+40/-3)
1 file modified
qml/Launcher/Launcher.qml (+40/-3)
To merge this branch: bzr merge lp:~mzanetti/unity8/reveal-launcher-with-mouse-hover
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing on 2015-02-23
Albert Astals Cid (community) 2015-02-06 Approve on 2015-02-23
Review via email: mp+248913@code.launchpad.net

Commit Message

enable revealing the launcher by hitting the left edge using the mouse

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected? Please list.

no

 * Did you perform an exploratory manual test run of your code change and any related functionality?

yes

 * Did you make sure that your branch does not contain spurious tags?

yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?

n/a

 * If you changed the UI, has there been a design review?

n/a

To post a comment you must log in.
1595. By Michael Zanetti on 2015-02-06

fix comment

Albert Astals Cid (aacid) wrote :

launcher tests are failing

review: Needs Fixing
1596. By Michael Zanetti on 2015-02-11

merge trunk

1597. By Michael Zanetti on 2015-02-11

disable the MouseArea in case we revealed the launcher by a touch drag

Michael Zanetti (mzanetti) wrote :

> launcher tests are failing

fixed

Albert Astals Cid (aacid) wrote :

 - interval: 5000
 + interval: 500

Seems rather extreme, is that something that should depend on mouse vs touch or similar?

review: Needs Information
Michael Zanetti (mzanetti) wrote :

> - interval: 5000
> + interval: 500
>
> Seems rather extreme, is that something that should depend on mouse vs touch
> or similar?

Note that the timer is not used for touch any more at all. The launcher doesn't auto-hide any more if you drag it in via touch. It should, however, auto-hide when you reveal it by a mouse hover event, and in that case it should also disappear very quickly when the mouse leaves the launcher. Unity7 seems to have 500ms there too, so I used that value.

Albert Astals Cid (aacid) wrote :

Ok then I'll abstain, i guess i need unity8 running in destkop mode that i don't and i'm sure others have so it'll be easier for them to review/test

review: Abstain
Albert Astals Cid (aacid) wrote :

The launcher is hidden immediately after moving the mouse out, i increased the interval to 5000 just to be sure, and it still hides immediately

review: Needs Fixing
1598. By Michael Zanetti on 2015-02-19

fix the timer usage

Michael Zanetti (mzanetti) wrote :

> The launcher is hidden immediately after moving the mouse out, i increased the
> interval to 5000 just to be sure, and it still hides immediately

fixed. thanks!

Albert Astals Cid (aacid) wrote :

aacid: how hard would it be to get a unittest for the hide thing you just fixed
mzanetto: quite hard, because we can't have mouse events atm, needs changes in our uqmlscene

Albert Astals Cid (aacid) wrote :

Clicking on the laucnher items after revealing with hover doesn't seem to work

review: Needs Fixing
1599. By Michael Zanetti on 2015-02-19

merge trunk

1600. By Michael Zanetti on 2015-02-23

fix enabled condition

Albert Astals Cid (aacid) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
Yes

 * Did CI run pass?
No, known broken tests

 * Did you make sure that the branch does not contain spurious tags?
Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Launcher/Launcher.qml'
2--- qml/Launcher/Launcher.qml 2015-02-01 22:13:02 +0000
3+++ qml/Launcher/Launcher.qml 2015-02-23 10:15:33 +0000
4@@ -93,10 +93,10 @@
5 Timer {
6 id: dismissTimer
7 objectName: "dismissTimer"
8- interval: 5000
9+ interval: 500
10 onTriggered: {
11 if (root.autohideEnabled) {
12- if (!panel.preventHiding) {
13+ if (!panel.preventHiding && !hoverArea.containsMouse) {
14 root.state = ""
15 } else {
16 dismissTimer.restart()
17@@ -159,7 +159,7 @@
18
19 MouseArea {
20 id: launcherDragArea
21- enabled: root.available && root.state == "visible"
22+ enabled: root.available && (root.state == "visible" || root.state == "visibleTemporary")
23 anchors.fill: panel
24 anchors.rightMargin: -units.gu(2)
25 drag {
26@@ -245,6 +245,33 @@
27 }
28 }
29
30+ // TODO: This should be replaced by some mechanism that reveals the launcher
31+ // after a certain resistance has been overcome, like unity7 does. However,
32+ // as we don't get relative mouse coordinates yet, this will do for now.
33+ MouseArea {
34+ id: hoverArea
35+ anchors { fill: panel; rightMargin: -1 }
36+ hoverEnabled: true
37+ propagateComposedEvents: true
38+ onContainsMouseChanged: {
39+ if (containsMouse) {
40+ root.switchToNextState("visibleTemporary");
41+ } else {
42+ dismissTimer.restart();
43+ }
44+ }
45+ onPressed: mouse.accepted = false;
46+
47+ // We need to eat touch events here in order to make sure that
48+ // we don't trigger both, the dragArea and the hoverArea
49+ MultiPointTouchArea {
50+ anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
51+ width: units.dp(1)
52+ mouseEnabled: false
53+ enabled: parent.enabled
54+ }
55+ }
56+
57 EdgeDragArea {
58 id: dragArea
59 objectName: "launcherDragArea"
60@@ -300,6 +327,16 @@
61 target: panel
62 x: -root.x // so we never go past panelWidth, even when teased by tutorial
63 }
64+ PropertyChanges { target: hoverArea; enabled: false }
65+ },
66+ State {
67+ name: "visibleTemporary"
68+ extend: "visible"
69+ PropertyChanges {
70+ target: root
71+ autohideEnabled: true
72+ }
73+ PropertyChanges { target: hoverArea; enabled: true }
74 },
75 State {
76 name: "teasing"

Subscribers

People subscribed via source and target branches