Merge lp:~azzar1/unity8/launcher-tooltips into lp:unity8
- launcher-tooltips
- Merge into trunk
Status: | Superseded |
---|---|
Proposed branch: | lp:~azzar1/unity8/launcher-tooltips |
Merge into: | lp:unity8 |
Prerequisite: | lp:~azzar1/unity8/remove-UbuntuShapeForItem |
Diff against target: |
333 lines (+242/-3) 5 files modified
debian/control (+1/-0) qml/Launcher/LauncherDelegate.qml (+1/-0) qml/Launcher/LauncherPanel.qml (+79/-3) qml/Launcher/Tooltip.qml (+72/-0) tests/qmltests/Launcher/tst_Launcher.qml (+89/-0) |
To merge this branch: | bzr merge lp:~azzar1/unity8/launcher-tooltips |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity8 CI Bot | continuous-integration | Needs Fixing | |
Michael Zanetti (community) | Needs Fixing | ||
Lukáš Tinkl (community) | Needs Fixing | ||
Albert Astals Cid (community) | Needs Fixing | ||
Review via email:
|
This proposal supersedes a proposal from 2016-09-21.
Commit message
Implement launcher tooltips.
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
Yes, lp:~azzar1/unity8/remove-UbuntuShapeForItem. But it has been merged in this branch and listed as a prerequiste.
* Did you perform an exploratory manual test run of your code change and any related functionality?
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?
Yes, alexm approved them
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Andrea Azzarone (azzar1) wrote : | # |
> I don't think you need the ShaderEffectSource for the source of the
> UbuntuShape. Should be enough to just do something like
>
> UbuntuShape {
> id: tooltipShape
> ...
> backgroundColor: theme.palette.
>
> Image {
> ...
> source: "graphics/
> rotation: 90
> }
>
> Label {
> id: tooltipLabel
> ...
> }
> }
>
> No need for the extra Rectangle at all IMO.
Done!
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2613
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2614
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Albert Astals Cid (aacid) wrote : | # |
qml/Launcher/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michael Zanetti (mzanetti) wrote : | # |
This looks very good to me now.
* Tested
* I wonder why jenkins doesn't run on this branch... Something wrong with andyrock's group setup in LP? Tests passing locally here though.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michael Zanetti (mzanetti) wrote : | # |
Sorry, missed albert's comment.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Andrea Azzarone (azzar1) wrote : | # |
Done.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Lukáš Tinkl (lukas-kde) wrote : | # |
Text conflict in debian/changelog
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2616
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Andrea Azzarone (azzar1) wrote : | # |
> Text conflict in debian/changelog
Fixed
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2617
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Lukáš Tinkl (lukas-kde) wrote : | # |
CI failing (in https:/
qmltestrunner.
Needs fixing imo
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Michael Zanetti (mzanetti) wrote : | # |
Also it is missing a dependency to the qml state machine
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2617
https:/
Executed test runs:
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2618
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2618
https:/
Executed test runs:
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2619
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2621. By Andrea Azzarone
-
Add a delay in mouseMove.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2620
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2621
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2622. By Andrea Azzarone
-
Refactor the way we deal with tooltip delay timer.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2622
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2623. By Andrea Azzarone
-
Use revealByPush.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2623
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2624. By Andrea Azzarone
-
waitForRenderin
g(launcher) when using revealyByEdgePush - 2625. By Andrea Azzarone
-
Add deps to qml-module-
qtqml-statemach ine.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2625
https:/
Executed test runs:
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2625
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
SUCCESS: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2626. By Andrea Azzarone
-
Revert change to revealByEdgePush
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2626
https:/
Executed test runs:
Click here to trigger a rebuild:
https:/
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2626
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2627. By Andrea Azzarone
-
Disable the tests.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2627
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2628. By Andrea Azzarone
-
Disable enableHovered to debug test failures.
- 2629. By Andrea Azzarone
-
Re-enable tooltips and tests.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2628
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2630. By Andrea Azzarone
-
Resync with lp:~azzar1/unity8/remove-UbuntuShapeForItem
- 2631. By Andrea Azzarone
-
Mark hoveredItem and itemCenter as readonly
- 2632. By Andrea Azzarone
-
Avoid type conversion.
- 2633. By Andrea Azzarone
-
Merge with trunk.
- 2634. By Andrea Azzarone
-
Fix broken test.
Unmerged revisions
Preview Diff
1 | === modified file 'debian/control' |
2 | --- debian/control 2016-10-04 15:02:29 +0000 |
3 | +++ debian/control 2016-10-20 10:01:30 +0000 |
4 | @@ -48,6 +48,7 @@ |
5 | python3-all:any, |
6 | python3-setuptools, |
7 | qml-module-qt-labs-folderlistmodel, |
8 | + qml-module-qtqml-statemachine, |
9 | qml-module-qtmultimedia (>= 5.4.1-1ubuntu19~overlay2), |
10 | qml-module-qtquick-layouts, |
11 | qml-module-qtquick-xmllistmodel, |
12 | |
13 | === modified file 'qml/Launcher/LauncherDelegate.qml' |
14 | --- qml/Launcher/LauncherDelegate.qml 2016-06-03 11:13:46 +0000 |
15 | +++ qml/Launcher/LauncherDelegate.qml 2016-10-20 10:01:30 +0000 |
16 | @@ -22,6 +22,7 @@ |
17 | |
18 | property int itemIndex: 0 |
19 | property string iconName |
20 | + property string name |
21 | property int count: 0 |
22 | property bool countVisible: false |
23 | property int progress: -1 |
24 | |
25 | === modified file 'qml/Launcher/LauncherPanel.qml' |
26 | --- qml/Launcher/LauncherPanel.qml 2016-10-20 10:01:28 +0000 |
27 | +++ qml/Launcher/LauncherPanel.qml 2016-10-20 10:01:30 +0000 |
28 | @@ -15,6 +15,7 @@ |
29 | */ |
30 | |
31 | import QtQuick 2.4 |
32 | +import QtQml.StateMachine 1.0 as DSM |
33 | import Ubuntu.Components 1.3 |
34 | import Unity.Launcher 0.1 |
35 | import Ubuntu.Components.Popups 1.3 |
36 | @@ -32,7 +33,7 @@ |
37 | property bool dragging: false |
38 | property bool moving: launcherListView.moving || launcherListView.flicking |
39 | property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed |
40 | - || mouseEventEater.containsMouse || dashItem.hovered |
41 | + || dndArea.containsMouse || dashItem.hovered |
42 | property int highlightIndex: -2 |
43 | property bool shortcutHintsShown: false |
44 | |
45 | @@ -41,7 +42,7 @@ |
46 | signal kbdNavigationCancelled() |
47 | |
48 | onXChanged: { |
49 | - if (quickList.state == "open") { |
50 | + if (quickList.state === "open") { |
51 | quickList.state = "" |
52 | } |
53 | } |
54 | @@ -70,7 +71,6 @@ |
55 | id: mouseEventEater |
56 | anchors.fill: parent |
57 | acceptedButtons: Qt.AllButtons |
58 | - hoverEnabled: true |
59 | onWheel: wheel.accepted = true; |
60 | } |
61 | |
62 | @@ -226,6 +226,7 @@ |
63 | // the right app when running autopilot tests for |
64 | // multiple apps. |
65 | readonly property string appId: model.appId |
66 | + name: model.name |
67 | itemIndex: index |
68 | itemHeight: launcherListView.itemHeight |
69 | itemWidth: launcherListView.itemWidth |
70 | @@ -399,6 +400,7 @@ |
71 | id: dndArea |
72 | objectName: "dndArea" |
73 | acceptedButtons: Qt.LeftButton | Qt.RightButton |
74 | + hoverEnabled: true |
75 | anchors { |
76 | fill: parent |
77 | topMargin: launcherListView.topMargin |
78 | @@ -828,4 +830,78 @@ |
79 | } |
80 | } |
81 | } |
82 | + |
83 | + Tooltip { |
84 | + id: tooltipShape |
85 | + objectName: "tooltipShape" |
86 | + |
87 | + visible: tooltipShownState.active |
88 | + rotation: root.rotation |
89 | + y: itemCenter - (height / 2) |
90 | + |
91 | + anchors { |
92 | + left: root.inverted ? undefined : parent.right |
93 | + right: root.inverted ? parent.left : undefined |
94 | + margins: units.gu(1) |
95 | + } |
96 | + |
97 | + property var hoveredItem: dndArea.containsMouse ? launcherListView.itemAt(dndArea.mouseX, dndArea.mouseY + launcherListView.realContentY) : null |
98 | + property int itemCenter: hoveredItem ? root.mapFromItem(hoveredItem, 0, 0).y + (hoveredItem.height / 2) + hoveredItem.offset : 0 |
99 | + |
100 | + text: hoveredItem ? hoveredItem.name : "" |
101 | + } |
102 | + |
103 | + DSM.StateMachine { |
104 | + id: tooltipStateMachine |
105 | + initialState: tooltipHiddenState |
106 | + running: true |
107 | + |
108 | + DSM.State { |
109 | + id: tooltipHiddenState |
110 | + |
111 | + DSM.SignalTransition { |
112 | + targetState: tooltipShownState |
113 | + signal: tooltipShape.hoveredItemChanged |
114 | + // !dndArea.pressed allows us to filter out touch input events |
115 | + guard: tooltipShape.hoveredItem != null && !dndArea.pressed && !root.moving |
116 | + } |
117 | + } |
118 | + |
119 | + DSM.State { |
120 | + id: tooltipShownState |
121 | + |
122 | + DSM.SignalTransition { |
123 | + targetState: tooltipHiddenState |
124 | + signal: tooltipShape.hoveredItemChanged |
125 | + guard: tooltipShape.hoveredItem == null |
126 | + } |
127 | + |
128 | + DSM.SignalTransition { |
129 | + targetState: tooltipDismissedState |
130 | + signal: dndArea.onPressed |
131 | + } |
132 | + |
133 | + DSM.SignalTransition { |
134 | + targetState: tooltipDismissedState |
135 | + signal: quickList.stateChanged |
136 | + guard: quickList.state === "open" |
137 | + } |
138 | + } |
139 | + |
140 | + DSM.State { |
141 | + id: tooltipDismissedState |
142 | + |
143 | + DSM.SignalTransition { |
144 | + targetState: tooltipHiddenState |
145 | + signal: dndArea.positionChanged |
146 | + guard: quickList.state != "open" && !dndArea.pressed && !dndArea.moving |
147 | + } |
148 | + |
149 | + DSM.SignalTransition { |
150 | + targetState: tooltipHiddenState |
151 | + signal: dndArea.exited |
152 | + guard: quickList.state != "open" |
153 | + } |
154 | + } |
155 | + } |
156 | } |
157 | |
158 | === added file 'qml/Launcher/Tooltip.qml' |
159 | --- qml/Launcher/Tooltip.qml 1970-01-01 00:00:00 +0000 |
160 | +++ qml/Launcher/Tooltip.qml 2016-10-20 10:01:30 +0000 |
161 | @@ -0,0 +1,72 @@ |
162 | +/* |
163 | + * Copyright (C) 2016 Canonical, Ltd. |
164 | + * |
165 | + * This program is free software; you can redistribute it and/or modify |
166 | + * it under the terms of the GNU General Public License as published by |
167 | + * the Free Software Foundation; version 3. |
168 | + * |
169 | + * This program is distributed in the hope that it will be useful, |
170 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
171 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
172 | + * GNU General Public License for more details. |
173 | + * |
174 | + * You should have received a copy of the GNU General Public License |
175 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
176 | + */ |
177 | + |
178 | +import QtQuick 2.4 |
179 | +import Ubuntu.Components 1.3 |
180 | + |
181 | +UbuntuShape { |
182 | + id: root |
183 | + |
184 | + // This property holds the delay (milliseconds) after which the tool tip is shown. |
185 | + // A tooltip with a negative delay is shown immediately. The default value is 500 ms. |
186 | + property int delay: 500 |
187 | + |
188 | + // This property holds the text shown on the tool tip. |
189 | + property alias text: label.text |
190 | + |
191 | + aspect: UbuntuShape.Flat |
192 | + color: theme.palette.normal.background |
193 | + width: label.implicitWidth + units.gu(4) |
194 | + height: label.implicitHeight + units.gu(2) |
195 | + opacity: 0 |
196 | + |
197 | + Image { |
198 | + anchors { |
199 | + right: parent.left |
200 | + rightMargin: -units.dp(4) |
201 | + verticalCenter: parent.verticalCenter |
202 | + } |
203 | + source: "graphics/quicklist_tooltip.png" |
204 | + rotation: 90 |
205 | + } |
206 | + |
207 | + Label { |
208 | + id: label |
209 | + anchors.centerIn: parent |
210 | + color: theme.palette.normal.backgroundText |
211 | + } |
212 | + |
213 | + states: [ |
214 | + State { |
215 | + name: "visible" |
216 | + when: root.visible |
217 | + PropertyChanges { |
218 | + target: root |
219 | + opacity: 0.95 |
220 | + } |
221 | + } |
222 | + ] |
223 | + |
224 | + transitions: [ |
225 | + Transition { |
226 | + from: ""; to: "visible" |
227 | + SequentialAnimation { |
228 | + PauseAnimation { duration: root.delay } |
229 | + UbuntuNumberAnimation { target: root; property: "opacity"; duration: UbuntuAnimation.BriskDuration } |
230 | + } |
231 | + } |
232 | + ] |
233 | +} |
234 | \ No newline at end of file |
235 | |
236 | === modified file 'tests/qmltests/Launcher/tst_Launcher.qml' |
237 | --- tests/qmltests/Launcher/tst_Launcher.qml 2016-08-01 11:23:49 +0000 |
238 | +++ tests/qmltests/Launcher/tst_Launcher.qml 2016-10-20 10:01:30 +0000 |
239 | @@ -1353,5 +1353,94 @@ |
240 | mouseWheel(launcherPanel, launcherPanel.width/2, launcherPanel.height/2, Qt.RightButton); |
241 | tryCompare(clickThroughSpy, "count", 0); |
242 | } |
243 | + |
244 | + function test_tooltip() { |
245 | + launcher.lockedVisible = true; |
246 | + revealByEdgePush(); |
247 | + |
248 | + var item = findChild(launcher, "launcherDelegate0"); |
249 | + var tooltipShape = findChild(launcher, "tooltipShape"); |
250 | + |
251 | + // Initial state |
252 | + tryCompare(tooltipShape, "visible", false); |
253 | + tryCompare(tooltipShape, "opacity", .0); |
254 | + |
255 | + // Move the mouse on the launcher icon |
256 | + mouseMove(item, item.width / 2, item.height / 2, 10); |
257 | + mouseMove(item, item.width / 2 + 1, item.height / 2, 10); |
258 | + tryCompare(tooltipShape, "visible", true); |
259 | + tryCompare(tooltipShape, "opacity", .95); |
260 | + |
261 | + // Move the mouse away |
262 | + mouseMove(root, root.width, root.height / 2, 10); |
263 | + tryCompare(tooltipShape, "visible", false); |
264 | + tryCompare(tooltipShape, "opacity", .0); |
265 | + } |
266 | + |
267 | + function test_quicklist_dismisses_tooltip() { |
268 | + launcher.lockedVisible = true; |
269 | + revealByEdgePush(); |
270 | + |
271 | + var item = findChild(launcher, "launcherDelegate0"); |
272 | + var tooltipShape = findChild(launcher, "tooltipShape"); |
273 | + var quickListShape = findChild(launcher, "quickListShape"); |
274 | + |
275 | + // Initial state |
276 | + tryCompare(tooltipShape, "visible", false); |
277 | + tryCompare(tooltipShape, "opacity", .0); |
278 | + |
279 | + // Move the mouse on the launcher icon |
280 | + mouseMove(item, item.width / 2, item.height / 2, 10); |
281 | + mouseMove(item, item.width / 2 + 1, item.height / 2, 10); |
282 | + tryCompare(tooltipShape, "visible", true); |
283 | + tryCompare(tooltipShape, "opacity", .95); |
284 | + |
285 | + // Right click to show the quicklist |
286 | + mouseClick(item, item.width / 2, item.height / 2, Qt.RightButton); |
287 | + tryCompare(quickListShape, "visible", true); |
288 | + tryCompare(tooltipShape, "visible", false); |
289 | + tryCompare(tooltipShape, "opacity", .0); |
290 | + |
291 | + // Left click hides the quicklist, tooltip is still dismissed |
292 | + mouseClick(item, item.width / 2, item.height / 2, Qt.LefftButton); |
293 | + tryCompare(quickListShape, "visible", false); |
294 | + tryCompare(tooltipShape, "visible", false); |
295 | + tryCompare(tooltipShape, "opacity", .0); |
296 | + |
297 | + // Mouse motion should should show tooltip again |
298 | + mouseMove(item, item.width / 2, item.height / 2, 10); |
299 | + mouseMove(item, item.width / 2 + 1, item.height / 2, 10); |
300 | + tryCompare(tooltipShape, "visible", true); |
301 | + tryCompare(tooltipShape, "opacity", .95); |
302 | + } |
303 | + |
304 | + function test_click_dismisses_tooltip() { |
305 | + launcher.lockedVisible = true; |
306 | + revealByEdgePush(); |
307 | + |
308 | + var item = findChild(launcher, "launcherDelegate0"); |
309 | + var tooltipShape = findChild(launcher, "tooltipShape"); |
310 | + |
311 | + // Initial state |
312 | + tryCompare(tooltipShape, "visible", false); |
313 | + tryCompare(tooltipShape, "opacity", .0); |
314 | + |
315 | + // Move the mouse on the launcher icon |
316 | + mouseMove(item, item.width / 2, item.height / 2, 10); |
317 | + mouseMove(item, item.width / 2 + 1, item.height / 2, 10); |
318 | + tryCompare(tooltipShape, "visible", true); |
319 | + tryCompare(tooltipShape, "opacity", .95); |
320 | + |
321 | + // Left click should dismiss the tooltip |
322 | + mouseClick(item, item.width / 2 + 1, item.height / 2, Qt.LeftButton); |
323 | + tryCompare(tooltipShape, "visible", false); |
324 | + tryCompare(tooltipShape, "opacity", .0); |
325 | + |
326 | + // Mouse motion should should show tooltip again |
327 | + mouseMove(item, item.width / 2, item.height / 2, 10); |
328 | + mouseMove(item, item.width / 2 + 1, item.height / 2, 10); |
329 | + tryCompare(tooltipShape, "visible", true); |
330 | + tryCompare(tooltipShape, "opacity", .95); |
331 | + } |
332 | } |
333 | } |
I don't think you need the ShaderEffectSource for the source of the UbuntuShape. Should be enough to just do something like
UbuntuShape {
backgroundColo r: theme.palette. normal. background
id: tooltipShape
...
Image { quicklist_ tooltip. png"
rotation: 90
...
source: "graphics/
}
Label {
id: tooltipLabel
...
}
}
No need for the extra Rectangle at all IMO.