Merge lp:~aacid/unity8/desktopRotatedCamera into lp:unity8
- desktopRotatedCamera
- Merge into trunk
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~aacid/unity8/desktopRotatedCamera | ||||
Merge into: | lp:unity8 | ||||
Diff against target: |
2267 lines (+1060/-168) 18 files modified
data/com.canonical.Unity8.gschema.xml (+11/-0) qml/Components/PhysicalKeysMapper.qml (+24/-0) qml/Launcher/Launcher.qml (+141/-9) qml/Launcher/LauncherDelegate.qml (+54/-20) qml/Launcher/LauncherPanel.qml (+122/-51) qml/Launcher/graphics/launcher-app-focus-ring.svg (+12/-0) qml/Shell.qml (+51/-1) qml/Stages/AbstractStage.qml (+2/-0) qml/Stages/DecoratedWindow.qml (+27/-10) qml/Stages/DesktopStage.qml (+49/-18) qml/Stages/WindowResizeArea.qml (+7/-4) tests/mocks/GSettings.1.0/fake_gsettings.cpp (+64/-0) tests/mocks/GSettings.1.0/fake_gsettings.h (+18/-0) tests/mocks/Unity/Application/ApplicationManager.cpp (+12/-0) tests/mocks/Unity/Launcher/MockLauncherModel.cpp (+5/-0) tests/qmltests/Launcher/tst_Launcher.qml (+244/-18) tests/qmltests/tst_OrientedShell.qml (+13/-1) tests/qmltests/tst_Shell.qml (+204/-36) |
||||
To merge this branch: | bzr merge lp:~aacid/unity8/desktopRotatedCamera | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lukáš Tinkl (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Needs Fixing | |
Unity8 CI Bot | continuous-integration | Needs Fixing | |
Review via email: mp+287137@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-03-10.
Commit message
Desktop stage: Support rotatesWindowCo
Description of the change
* Are there any related MPs required for this MP to build/function as expected?
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
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2205
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2206
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: 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:/
Click here to trigger a rebuild:
https:/
Lukáš Tinkl (lukas-kde) wrote : | # |
Left some inline comments, also seems you want to rotate just the ApplicationWindow inside the delegate, why not do it directly there instead of doing the calculations to take the decoration into account?
Lukáš Tinkl (lukas-kde) wrote : | # |
Also, shouldn't there be some transition/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2206
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Albert Astals Cid (aacid) wrote : | # |
> Left some inline comments, also seems you want to rotate just the
> ApplicationWindow inside the delegate, why not do it directly there instead of
> doing the calculations to take the decoration into account?
Yes, only the ApplicationWindow needs rotating and that's what i'm rotating only, no? I'm not sure what you mean with "there" means as instead of what i'm doing now.
Albert Astals Cid (aacid) wrote : | # |
> Also, shouldn't there be some transition/
The window doesn't really rotate, you move the phone and the window stays "the same" visually
Lukáš Tinkl (lukas-kde) wrote : | # |
> > Left some inline comments, also seems you want to rotate just the
> > ApplicationWindow inside the delegate, why not do it directly there instead
> of
> > doing the calculations to take the decoration into account?
>
> Yes, only the ApplicationWindow needs rotating and that's what i'm rotating
> only, no? I'm not sure what you mean with "there" means as instead of what i'm
> doing now.
Yup sorry, that's what I meant, blaming launchpad diff for not being to show/expand the context...
Albert Astals Cid (aacid) wrote : | # |
> Why not just use "rotation: rotationAngle" instead of constructing the Rotation Transform? The "transformOrigin" is by default Item.Center
Because it doesn't work, see current code http://
You need the correct origin otherwise the rotation sends the item away from the rest of the item
Albert Astals Cid (aacid) wrote : | # |
> What about other states like "maximized", shouldn't we care about them as well?
They do work already, see tryOrientedShell, mako, windowed, start the second camera app and maximize it, then go to invertedlandscape and see how it works fine
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2208
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: 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:/
Click here to trigger a rebuild:
https:/
Daniel d'Andrada (dandrader) wrote : | # |
Maybe we would make camera-app not be fullscreen when in desktop mode (have code somewhere calling cameraApplicati
Daniel d'Andrada (dandrader) wrote : | # |
Good work, by the way. Completely forgot about implementing RotatesWindowCo
Another thing:
"""
{tag: "mako_windowed", deviceName: "mako", orientationAngl
"""
Wouldn't a "manta_windowed" make more sense? (larger display area)
Daniel d'Andrada (dandrader) wrote : | # |
> Maybe we would make camera-app not be fullscreen when in desktop mode (have
> code somewhere calling cameraApplicati
> creating another app.
By the way, that would mimic the magic that will (or already does, don't recall trying) happen on the device.
Albert Astals Cid (aacid) wrote : | # |
> Wouldn't a "manta_windowed" make more sense? (larger display area)
Does it matter? I guess the point is that it works on one it "should" work on all, maybe i can just add all three?
Albert Astals Cid (aacid) wrote : | # |
> Maybe we would make camera-app not be fullscreen when in desktop mode (have code somewhere
> calling cameraApplicati
This has advantage that we kind of test the "same" camera app that we [will] have on the real world, the disadvantage is that we lose the hability to try/test pure fullscreen apps on the destkop stage (which i guess at some point makes sense too).
That's why i decided to go for the duplication case, but can make it the other way if you prefer.
Daniel d'Andrada (dandrader) wrote : | # |
On 26/02/2016 10:36, Albert Astals Cid wrote:
>> Wouldn't a "manta_windowed" make more sense? (larger display area)
> Does it matter? I guess the point is that it works on one it "should" work on all, maybe i can just add all three?
just sugar on top. makes more sense when you look at it or try it out
manually.
Daniel d'Andrada (dandrader) wrote : | # |
On 26/02/2016 10:43, Albert Astals Cid wrote:
> This has advantage that we kind of test the "same" camera app that we [will] have on the real world, the disadvantage is that we lose the hability to try/test pure fullscreen apps on the destkop stage (which i guess at some point makes sense too).
We already have other fullscreen apps there: gallery-app, webbrowser-app
Albert Astals Cid (aacid) wrote : | # |
> We already have other fullscreen apps there: gallery-app, webbrowser-app
Sure, but they do not have rotatesWindowCo
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2208
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2210
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: 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:/
Click here to trigger a rebuild:
https:/
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2210
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 2091. By Lukáš Tinkl
-
fix for fullscreen apps in desktop mode
- 2092. By Lukáš Tinkl
-
similar fix to height...
Lukáš Tinkl (lukas-kde) wrote : | # |
Worked fine from my testing
* Did you perform an exploratory manual test run of the code change and any related functionality?
Yes
* Did CI run pass? If not, please explain why.
Yes, unrelated failures
* Did you make sure that the branch does not contain spurious tags?
Yes
- 2093. By Albert Astals Cid
-
Desktop stage: Support rotatesWindowCo
ntents - 2094. By Albert Astals Cid
-
Make it work on non fullscreen windows too
- 2095. By Albert Astals Cid
-
Add SurfaceManagerC
ontrols - 2096. By Albert Astals Cid
-
These are readonly too (i think)
- 2097. By Albert Astals Cid
-
add the other two windowed variants too
- 2098. By Albert Astals Cid
-
also switch the min/maxwidth/height
- 2099. By Albert Astals Cid
-
Merge makeMakeTryOrie
ntedShellWork - 2100. By Albert Astals Cid
-
account for 180
- 2101. By Albert Astals Cid
-
Merge
- 2102. By Albert Astals Cid
-
Merge
- 2103. By Albert Astals Cid
-
Merge
- 2104. By Albert Astals Cid
-
Change to windowed/not windowed before starting the app
- 2105. By Albert Astals Cid
-
Merge
- 2106. By Albert Astals Cid
-
Merge
- 2107. By Albert Astals Cid
-
"compile"
- 2108. By Albert Astals Cid
-
fix startup of non rotatesWindowCo
ntents apps - 2109. By Albert Astals Cid
-
Revert change infected from other branch
- 2110. By Albert Astals Cid
-
Merge
Unmerged revisions
Preview Diff
1 | === modified file 'data/com.canonical.Unity8.gschema.xml' | |||
2 | --- data/com.canonical.Unity8.gschema.xml 2015-11-24 17:44:18 +0000 | |||
3 | +++ data/com.canonical.Unity8.gschema.xml 2016-03-10 09:37:58 +0000 | |||
4 | @@ -27,6 +27,17 @@ | |||
5 | 27 | <summary>Maximum push needed to overcome edge barrier</summary> | 27 | <summary>Maximum push needed to overcome edge barrier</summary> |
6 | 28 | <description>How much you have to push (in grid units) the mouse against an edge barrier when sensibility is 1.</description> | 28 | <description>How much you have to push (in grid units) the mouse against an edge barrier when sensibility is 1.</description> |
7 | 29 | </key> | 29 | </key> |
8 | 30 | <key type="b" name="autohide-launcher"> | ||
9 | 31 | <default>true</default> | ||
10 | 32 | <summary>Autohide the launcher</summary> | ||
11 | 33 | <description>This will only be applied in windowed mode. In staged mode, the launcher will always hide.</description> | ||
12 | 34 | </key> | ||
13 | 35 | <key type="u" name="launcher-width"> | ||
14 | 36 | <default>8</default> | ||
15 | 37 | <range min="6" max="12"/> | ||
16 | 38 | <summary>Width of the launcher in grid units.</summary> | ||
17 | 39 | <description>Changes the width of the launcher in all usage modes.</description> | ||
18 | 40 | </key> | ||
19 | 30 | </schema> | 41 | </schema> |
20 | 31 | 42 | ||
21 | 32 | <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8"> | 43 | <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8"> |
22 | 33 | 44 | ||
23 | === modified file 'qml/Components/PhysicalKeysMapper.qml' | |||
24 | --- qml/Components/PhysicalKeysMapper.qml 2016-01-13 18:43:34 +0000 | |||
25 | +++ qml/Components/PhysicalKeysMapper.qml 2016-03-10 09:37:58 +0000 | |||
26 | @@ -42,12 +42,15 @@ | |||
27 | 42 | signal screenshotTriggered; | 42 | signal screenshotTriggered; |
28 | 43 | 43 | ||
29 | 44 | readonly property bool altTabPressed: d.altTabPressed | 44 | readonly property bool altTabPressed: d.altTabPressed |
30 | 45 | readonly property bool superPressed: d.superPressed | ||
31 | 46 | readonly property bool superTabPressed: d.superTabPressed | ||
32 | 45 | 47 | ||
33 | 46 | property int powerKeyLongPressTime: 2000 | 48 | property int powerKeyLongPressTime: 2000 |
34 | 47 | 49 | ||
35 | 48 | // For testing. If running windowed (e.g. tryShell), Alt+Tab is taken by the | 50 | // For testing. If running windowed (e.g. tryShell), Alt+Tab is taken by the |
36 | 49 | // running desktop, set this to true to use Ctrl+Tab instead. | 51 | // running desktop, set this to true to use Ctrl+Tab instead. |
37 | 50 | property bool controlInsteadOfAlt: false | 52 | property bool controlInsteadOfAlt: false |
38 | 53 | property bool controlInsteadOfSuper: false | ||
39 | 51 | 54 | ||
40 | 52 | QtObject { | 55 | QtObject { |
41 | 53 | id: d | 56 | id: d |
42 | @@ -59,6 +62,9 @@ | |||
43 | 59 | property bool altPressed: false | 62 | property bool altPressed: false |
44 | 60 | property bool altTabPressed: false | 63 | property bool altTabPressed: false |
45 | 61 | 64 | ||
46 | 65 | property bool superPressed: false | ||
47 | 66 | property bool superTabPressed: false | ||
48 | 67 | |||
49 | 62 | property var powerButtonPressStart: 0 | 68 | property var powerButtonPressStart: 0 |
50 | 63 | 69 | ||
51 | 64 | // We need to eat ALT presses until we know what they're for (Alt+Tab or going to the app?) | 70 | // We need to eat ALT presses until we know what they're for (Alt+Tab or going to the app?) |
52 | @@ -119,11 +125,23 @@ | |||
53 | 119 | event.accepted = true; | 125 | event.accepted = true; |
54 | 120 | d.altPressInjected = false; | 126 | d.altPressInjected = false; |
55 | 121 | } | 127 | } |
56 | 128 | |||
57 | 129 | // Adding MetaModifier here because that's what keyboards do. Pressing Super_L actually gives | ||
58 | 130 | // Super_L + MetaModifier. This helps to make sure we only invoke superPressed if no other | ||
59 | 131 | // Modifier is pressed too. | ||
60 | 132 | } else if (((event.key == Qt.Key_Super_L || event.key == Qt.Key_Super_R) && event.modifiers === Qt.MetaModifier) | ||
61 | 133 | || (root.controlInsteadOfSuper && event.key == Qt.Key_Control) | ||
62 | 134 | ) { | ||
63 | 135 | d.superPressed = true; | ||
64 | 122 | } else if (event.key == Qt.Key_Tab) { | 136 | } else if (event.key == Qt.Key_Tab) { |
65 | 123 | if (d.altPressed && !d.altTabPressed) { | 137 | if (d.altPressed && !d.altTabPressed) { |
66 | 124 | d.altTabPressed = true; | 138 | d.altTabPressed = true; |
67 | 125 | event.accepted = true; | 139 | event.accepted = true; |
68 | 126 | } | 140 | } |
69 | 141 | if (d.superPressed && !d.superTabPressed) { | ||
70 | 142 | d.superTabPressed = true; | ||
71 | 143 | event.accepted = true; | ||
72 | 144 | } | ||
73 | 127 | } | 145 | } |
74 | 128 | } | 146 | } |
75 | 129 | 147 | ||
76 | @@ -154,6 +172,12 @@ | |||
77 | 154 | if (d.altTabPressed) { | 172 | if (d.altTabPressed) { |
78 | 155 | event.accepted = true; | 173 | event.accepted = true; |
79 | 156 | } | 174 | } |
80 | 175 | } else if (event.key == Qt.Key_Super_L || event.key == Qt.Key_Super_R || (root.controlInsteadOfSuper && event.key == Qt.Key_Control)) { | ||
81 | 176 | d.superPressed = false; | ||
82 | 177 | if (d.superTabPressed) { | ||
83 | 178 | d.superTabPressed = false; | ||
84 | 179 | event.accepted = true; | ||
85 | 180 | } | ||
86 | 157 | } | 181 | } |
87 | 158 | } | 182 | } |
88 | 159 | } | 183 | } |
89 | 160 | 184 | ||
90 | === modified file 'qml/Launcher/Launcher.qml' | |||
91 | --- qml/Launcher/Launcher.qml 2016-01-19 15:26:15 +0000 | |||
92 | +++ qml/Launcher/Launcher.qml 2016-03-10 09:37:58 +0000 | |||
93 | @@ -19,21 +19,26 @@ | |||
94 | 19 | import Ubuntu.Components 1.3 | 19 | import Ubuntu.Components 1.3 |
95 | 20 | import Ubuntu.Gestures 0.1 | 20 | import Ubuntu.Gestures 0.1 |
96 | 21 | import Unity.Launcher 0.1 | 21 | import Unity.Launcher 0.1 |
97 | 22 | import GlobalShortcut 1.0 | ||
98 | 22 | 23 | ||
100 | 23 | Item { | 24 | FocusScope { |
101 | 24 | id: root | 25 | id: root |
102 | 25 | 26 | ||
103 | 26 | property bool autohideEnabled: false | 27 | property bool autohideEnabled: false |
104 | 28 | property bool lockedVisible: false | ||
105 | 27 | property bool available: true // can be used to disable all interactions | 29 | property bool available: true // can be used to disable all interactions |
106 | 28 | property alias inverted: panel.inverted | 30 | property alias inverted: panel.inverted |
107 | 29 | property bool shadeBackground: true // can be used to disable background shade when launcher is visible | 31 | property bool shadeBackground: true // can be used to disable background shade when launcher is visible |
108 | 30 | 32 | ||
110 | 31 | property int panelWidth: units.gu(8) | 33 | property int panelWidth: units.gu(10) |
111 | 32 | property int dragAreaWidth: units.gu(1) | 34 | property int dragAreaWidth: units.gu(1) |
112 | 33 | property int minimizeDistance: units.gu(26) | 35 | property int minimizeDistance: units.gu(26) |
113 | 34 | property real progress: dragArea.dragging && dragArea.touchX > panelWidth ? | 36 | property real progress: dragArea.dragging && dragArea.touchX > panelWidth ? |
114 | 35 | (width * (dragArea.touchX-panelWidth) / (width - panelWidth)) : 0 | 37 | (width * (dragArea.touchX-panelWidth) / (width - panelWidth)) : 0 |
115 | 36 | 38 | ||
116 | 39 | property bool superPressed: false | ||
117 | 40 | property bool superTabPressed: false | ||
118 | 41 | |||
119 | 37 | readonly property bool dragging: dragArea.dragging | 42 | readonly property bool dragging: dragArea.dragging |
120 | 38 | readonly property real dragDistance: dragArea.dragging ? dragArea.touchX : 0 | 43 | readonly property real dragDistance: dragArea.dragging ? dragArea.touchX : 0 |
121 | 39 | readonly property real visibleWidth: panel.width + panel.x | 44 | readonly property real visibleWidth: panel.width + panel.x |
122 | @@ -57,12 +62,55 @@ | |||
123 | 57 | } | 62 | } |
124 | 58 | } | 63 | } |
125 | 59 | 64 | ||
126 | 65 | onSuperPressedChanged: { | ||
127 | 66 | if (superPressed) { | ||
128 | 67 | superPressTimer.start(); | ||
129 | 68 | superLongPressTimer.start(); | ||
130 | 69 | } else { | ||
131 | 70 | superPressTimer.stop(); | ||
132 | 71 | superLongPressTimer.stop(); | ||
133 | 72 | launcher.switchToNextState(""); | ||
134 | 73 | panel.shortcutHintsShown = false; | ||
135 | 74 | } | ||
136 | 75 | } | ||
137 | 76 | |||
138 | 77 | onSuperTabPressedChanged: { | ||
139 | 78 | if (superTabPressed) { | ||
140 | 79 | switchToNextState("visible") | ||
141 | 80 | panel.highlightIndex = -1; | ||
142 | 81 | root.focus = true; | ||
143 | 82 | superPressTimer.stop(); | ||
144 | 83 | superLongPressTimer.stop(); | ||
145 | 84 | } else { | ||
146 | 85 | if (panel.highlightIndex == -1) { | ||
147 | 86 | showDashHome(); | ||
148 | 87 | } else if (panel.highlightIndex >= 0){ | ||
149 | 88 | launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId); | ||
150 | 89 | } | ||
151 | 90 | panel.highlightIndex = -2; | ||
152 | 91 | switchToNextState(""); | ||
153 | 92 | root.focus = false; | ||
154 | 93 | } | ||
155 | 94 | } | ||
156 | 95 | |||
157 | 96 | onLockedVisibleChanged: { | ||
158 | 97 | if (lockedVisible && state == "") { | ||
159 | 98 | panel.dismissTimer.stop(); | ||
160 | 99 | fadeOutAnimation.stop(); | ||
161 | 100 | switchToNextState("visible") | ||
162 | 101 | } else if (!lockedVisible && state == "visible") { | ||
163 | 102 | hide(); | ||
164 | 103 | } | ||
165 | 104 | } | ||
166 | 105 | |||
167 | 60 | function hide() { | 106 | function hide() { |
168 | 61 | switchToNextState("") | 107 | switchToNextState("") |
169 | 62 | } | 108 | } |
170 | 63 | 109 | ||
171 | 64 | function fadeOut() { | 110 | function fadeOut() { |
173 | 65 | fadeOutAnimation.start(); | 111 | if (!root.lockedVisible) { |
174 | 112 | fadeOutAnimation.start(); | ||
175 | 113 | } | ||
176 | 66 | } | 114 | } |
177 | 67 | 115 | ||
178 | 68 | function switchToNextState(state) { | 116 | function switchToNextState(state) { |
179 | @@ -90,6 +138,76 @@ | |||
180 | 90 | } | 138 | } |
181 | 91 | } | 139 | } |
182 | 92 | 140 | ||
183 | 141 | function openForKeyboardNavigation() { | ||
184 | 142 | panel.highlightIndex = -1; // The BFB | ||
185 | 143 | root.focus = true; | ||
186 | 144 | switchToNextState("visible") | ||
187 | 145 | } | ||
188 | 146 | |||
189 | 147 | Keys.onPressed: { | ||
190 | 148 | switch (event.key) { | ||
191 | 149 | case Qt.Key_Backtab: | ||
192 | 150 | panel.highlightPrevious(); | ||
193 | 151 | event.accepted = true; | ||
194 | 152 | break; | ||
195 | 153 | case Qt.Key_Up: | ||
196 | 154 | if (root.inverted) { | ||
197 | 155 | panel.highlightNext() | ||
198 | 156 | } else { | ||
199 | 157 | panel.highlightPrevious(); | ||
200 | 158 | } | ||
201 | 159 | event.accepted = true; | ||
202 | 160 | break; | ||
203 | 161 | case Qt.Key_Tab: | ||
204 | 162 | panel.highlightNext(); | ||
205 | 163 | event.accepted = true; | ||
206 | 164 | break; | ||
207 | 165 | case Qt.Key_Down: | ||
208 | 166 | if (root.inverted) { | ||
209 | 167 | panel.highlightPrevious(); | ||
210 | 168 | } else { | ||
211 | 169 | panel.highlightNext(); | ||
212 | 170 | } | ||
213 | 171 | event.accepted = true; | ||
214 | 172 | break; | ||
215 | 173 | case Qt.Key_Right: | ||
216 | 174 | panel.openQuicklist(panel.highlightIndex) | ||
217 | 175 | event.accepted = true; | ||
218 | 176 | break; | ||
219 | 177 | case Qt.Key_Escape: | ||
220 | 178 | panel.highlightIndex = -2 | ||
221 | 179 | // Falling through intentionally | ||
222 | 180 | case Qt.Key_Enter: | ||
223 | 181 | case Qt.Key_Return: | ||
224 | 182 | case Qt.Key_Space: | ||
225 | 183 | if (panel.highlightIndex == -1) { | ||
226 | 184 | showDashHome(); | ||
227 | 185 | } else if (panel.highlightIndex >= 0) { | ||
228 | 186 | launcherApplicationSelected(LauncherModel.get(panel.highlightIndex).appId); | ||
229 | 187 | } | ||
230 | 188 | root.hide(); | ||
231 | 189 | event.accepted = true; | ||
232 | 190 | root.focus = false; | ||
233 | 191 | } | ||
234 | 192 | } | ||
235 | 193 | |||
236 | 194 | Timer { | ||
237 | 195 | id: superPressTimer | ||
238 | 196 | interval: 200 | ||
239 | 197 | onTriggered: { | ||
240 | 198 | switchToNextState("visible") | ||
241 | 199 | } | ||
242 | 200 | } | ||
243 | 201 | |||
244 | 202 | Timer { | ||
245 | 203 | id: superLongPressTimer | ||
246 | 204 | interval: 1000 | ||
247 | 205 | onTriggered: { | ||
248 | 206 | switchToNextState("visible") | ||
249 | 207 | panel.shortcutHintsShown = true; | ||
250 | 208 | } | ||
251 | 209 | } | ||
252 | 210 | |||
253 | 93 | Timer { | 211 | Timer { |
254 | 94 | id: teaseTimer | 212 | id: teaseTimer |
255 | 95 | interval: mode == "teasing" ? 200 : 300 | 213 | interval: mode == "teasing" ? 200 : 300 |
256 | @@ -106,6 +224,13 @@ | |||
257 | 106 | interval: 1 | 224 | interval: 1 |
258 | 107 | property string nextState: "" | 225 | property string nextState: "" |
259 | 108 | onTriggered: { | 226 | onTriggered: { |
260 | 227 | if (root.lockedVisible && nextState == "") { | ||
261 | 228 | // Due to binding updates when switching between modes | ||
262 | 229 | // it could happen that our request to show will be overwritten | ||
263 | 230 | // with a hide request. Rewrite it when we know hiding is not allowed. | ||
264 | 231 | nextState = "visible" | ||
265 | 232 | } | ||
266 | 233 | |||
267 | 109 | // switching to an intermediate state here to make sure all the | 234 | // switching to an intermediate state here to make sure all the |
268 | 110 | // values are restored, even if we were already in the target state | 235 | // values are restored, even if we were already in the target state |
269 | 111 | root.state = "tmp" | 236 | root.state = "tmp" |
270 | @@ -151,7 +276,7 @@ | |||
271 | 151 | 276 | ||
272 | 152 | MouseArea { | 277 | MouseArea { |
273 | 153 | id: launcherDragArea | 278 | id: launcherDragArea |
275 | 154 | enabled: root.available && (root.state == "visible" || root.state == "visibleTemporary") | 279 | enabled: root.available && (root.state == "visible" || root.state == "visibleTemporary") && !root.lockedVisible |
276 | 155 | anchors.fill: panel | 280 | anchors.fill: panel |
277 | 156 | anchors.rightMargin: -units.gu(2) | 281 | anchors.rightMargin: -units.gu(2) |
278 | 157 | drag { | 282 | drag { |
279 | @@ -172,9 +297,10 @@ | |||
280 | 172 | InverseMouseArea { | 297 | InverseMouseArea { |
281 | 173 | id: closeMouseArea | 298 | id: closeMouseArea |
282 | 174 | anchors.fill: panel | 299 | anchors.fill: panel |
284 | 175 | enabled: root.shadeBackground && root.state == "visible" | 300 | enabled: root.shadeBackground && root.state == "visible" && (!root.lockedVisible || panel.highlightIndex >= -1) |
285 | 176 | visible: enabled | 301 | visible: enabled |
286 | 177 | onPressed: { | 302 | onPressed: { |
287 | 303 | panel.highlightIndex = -2 | ||
288 | 178 | root.hide(); | 304 | root.hide(); |
289 | 179 | } | 305 | } |
290 | 180 | } | 306 | } |
291 | @@ -183,7 +309,7 @@ | |||
292 | 183 | id: backgroundShade | 309 | id: backgroundShade |
293 | 184 | anchors.fill: parent | 310 | anchors.fill: parent |
294 | 185 | color: "black" | 311 | color: "black" |
296 | 186 | opacity: root.shadeBackground && root.state == "visible" ? 0.6 : 0 | 312 | opacity: root.shadeBackground && root.state == "visible" && !root.lockedVisible ? 0.6 : 0 |
297 | 187 | 313 | ||
298 | 188 | Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } } | 314 | Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.BriskDuration } } |
299 | 189 | } | 315 | } |
300 | @@ -227,7 +353,7 @@ | |||
301 | 227 | Connections { | 353 | Connections { |
302 | 228 | target: panel.dismissTimer | 354 | target: panel.dismissTimer |
303 | 229 | onTriggered: { | 355 | onTriggered: { |
305 | 230 | if (root.autohideEnabled) { | 356 | if (root.autohideEnabled && !root.lockedVisible) { |
306 | 231 | if (!panel.preventHiding) { | 357 | if (!panel.preventHiding) { |
307 | 232 | root.state = "" | 358 | root.state = "" |
308 | 233 | } else { | 359 | } else { |
309 | @@ -240,11 +366,11 @@ | |||
310 | 240 | property bool animate: true | 366 | property bool animate: true |
311 | 241 | 367 | ||
312 | 242 | onApplicationSelected: { | 368 | onApplicationSelected: { |
314 | 243 | root.state = "" | 369 | root.hide(); |
315 | 244 | launcherApplicationSelected(appId) | 370 | launcherApplicationSelected(appId) |
316 | 245 | } | 371 | } |
317 | 246 | onShowDashHome: { | 372 | onShowDashHome: { |
319 | 247 | root.state = "" | 373 | root.hide(); |
320 | 248 | root.showDashHome(); | 374 | root.showDashHome(); |
321 | 249 | } | 375 | } |
322 | 250 | 376 | ||
323 | @@ -254,6 +380,12 @@ | |||
324 | 254 | } | 380 | } |
325 | 255 | } | 381 | } |
326 | 256 | 382 | ||
327 | 383 | onKbdNavigationCancelled: { | ||
328 | 384 | panel.highlightIndex = -2; | ||
329 | 385 | root.hide(); | ||
330 | 386 | root.focus = false; | ||
331 | 387 | } | ||
332 | 388 | |||
333 | 257 | Behavior on x { | 389 | Behavior on x { |
334 | 258 | enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate; | 390 | enabled: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate; |
335 | 259 | NumberAnimation { | 391 | NumberAnimation { |
336 | 260 | 392 | ||
337 | === modified file 'qml/Launcher/LauncherDelegate.qml' | |||
338 | --- qml/Launcher/LauncherDelegate.qml 2015-11-19 16:55:31 +0000 | |||
339 | +++ qml/Launcher/LauncherDelegate.qml 2016-03-10 09:37:58 +0000 | |||
340 | @@ -20,6 +20,7 @@ | |||
341 | 20 | Item { | 20 | Item { |
342 | 21 | id: root | 21 | id: root |
343 | 22 | 22 | ||
344 | 23 | property int itemIndex: 0 | ||
345 | 23 | property string iconName | 24 | property string iconName |
346 | 24 | property int count: 0 | 25 | property int count: 0 |
347 | 25 | property bool countVisible: false | 26 | property bool countVisible: false |
348 | @@ -29,10 +30,12 @@ | |||
349 | 29 | property real maxAngle: 0 | 30 | property real maxAngle: 0 |
350 | 30 | property bool inverted: false | 31 | property bool inverted: false |
351 | 31 | property bool alerting: false | 32 | property bool alerting: false |
353 | 32 | readonly property alias wiggling: wiggleAnim.running | 33 | property bool highlighted: false |
354 | 34 | property bool shortcutHintShown: false | ||
355 | 33 | 35 | ||
356 | 34 | readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight | 36 | readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight |
357 | 35 | readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight | 37 | readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight |
358 | 38 | readonly property alias wiggling: wiggleAnim.running | ||
359 | 36 | 39 | ||
360 | 37 | property int itemWidth | 40 | property int itemWidth |
361 | 38 | property int itemHeight | 41 | property int itemHeight |
362 | @@ -121,14 +124,25 @@ | |||
363 | 121 | 124 | ||
364 | 122 | Item { | 125 | Item { |
365 | 123 | id: iconItem | 126 | id: iconItem |
367 | 124 | width: parent.itemWidth + units.gu(1) | 127 | width: root.width |
368 | 125 | height: parent.itemHeight + units.gu(1) | 128 | height: parent.itemHeight + units.gu(1) |
369 | 126 | anchors.centerIn: parent | 129 | anchors.centerIn: parent |
370 | 127 | 130 | ||
371 | 131 | Image { | ||
372 | 132 | objectName: "focusRing" | ||
373 | 133 | anchors.centerIn: iconShape | ||
374 | 134 | height: width * 15 / 16 | ||
375 | 135 | width: iconShape.width + units.gu(1) | ||
376 | 136 | source: "graphics/launcher-app-focus-ring.svg" | ||
377 | 137 | sourceSize.width: width | ||
378 | 138 | sourceSize.height: height | ||
379 | 139 | visible: root.highlighted | ||
380 | 140 | } | ||
381 | 141 | |||
382 | 128 | ProportionalShape { | 142 | ProportionalShape { |
383 | 129 | id: iconShape | 143 | id: iconShape |
384 | 130 | anchors.centerIn: parent | 144 | anchors.centerIn: parent |
386 | 131 | width: parent.width - units.gu(2) | 145 | width: root.itemWidth |
387 | 132 | aspect: UbuntuShape.DropShadow | 146 | aspect: UbuntuShape.DropShadow |
388 | 133 | source: Image { | 147 | source: Image { |
389 | 134 | id: iconImage | 148 | id: iconImage |
390 | @@ -144,7 +158,8 @@ | |||
391 | 144 | anchors { | 158 | anchors { |
392 | 145 | right: parent.right | 159 | right: parent.right |
393 | 146 | bottom: parent.bottom | 160 | bottom: parent.bottom |
395 | 147 | margins: units.dp(3) | 161 | rightMargin: (iconItem.width - root.itemWidth) / 2 - units.dp(2) |
396 | 162 | margins: units.dp(5) | ||
397 | 148 | } | 163 | } |
398 | 149 | width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1))) | 164 | width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1))) |
399 | 150 | height: units.gu(2) | 165 | height: units.gu(2) |
400 | @@ -172,16 +187,11 @@ | |||
401 | 172 | id: progressOverlay | 187 | id: progressOverlay |
402 | 173 | objectName: "progressOverlay" | 188 | objectName: "progressOverlay" |
403 | 174 | 189 | ||
411 | 175 | anchors { | 190 | anchors.centerIn: parent |
412 | 176 | left: iconItem.left | 191 | width: root.itemWidth * .8 |
406 | 177 | right: iconItem.right | ||
407 | 178 | verticalCenter: parent.verticalCenter | ||
408 | 179 | leftMargin: units.gu(1.5) | ||
409 | 180 | rightMargin: units.gu(1.5) | ||
410 | 181 | } | ||
413 | 182 | height: units.gu(1) | 192 | height: units.gu(1) |
414 | 183 | visible: root.progress > -1 | 193 | visible: root.progress > -1 |
416 | 184 | color: UbuntuColors.darkGrey | 194 | backgroundColor: UbuntuColors.darkGrey |
417 | 185 | borderSource: "none" | 195 | borderSource: "none" |
418 | 186 | 196 | ||
419 | 187 | Item { | 197 | Item { |
420 | @@ -199,32 +209,56 @@ | |||
421 | 199 | top: parent.top | 209 | top: parent.top |
422 | 200 | bottom: parent.bottom | 210 | bottom: parent.bottom |
423 | 201 | } | 211 | } |
425 | 202 | color: "white" | 212 | backgroundColor: "white" |
426 | 203 | borderSource: "none" | 213 | borderSource: "none" |
427 | 204 | width: progressOverlay.width | 214 | width: progressOverlay.width |
428 | 205 | } | 215 | } |
429 | 206 | } | 216 | } |
430 | 207 | } | 217 | } |
431 | 208 | 218 | ||
434 | 209 | Image { | 219 | Column { |
433 | 210 | objectName: "runningHighlight" | ||
435 | 211 | anchors { | 220 | anchors { |
436 | 212 | left: parent.left | 221 | left: parent.left |
437 | 213 | verticalCenter: parent.verticalCenter | 222 | verticalCenter: parent.verticalCenter |
438 | 214 | } | 223 | } |
442 | 215 | visible: root.itemRunning | 224 | spacing: units.gu(.5) |
443 | 216 | rotation: 180 | 225 | Repeater { |
444 | 217 | source: "graphics/focused_app_arrow.png" | 226 | model: 1 // TODO: This should be "Math.min(3, app.surfaceCount)" once we have multiple surfaces |
445 | 227 | Rectangle { | ||
446 | 228 | objectName: "runningHighlight" + index | ||
447 | 229 | width: units.gu(0.25) | ||
448 | 230 | height: units.gu(.5) | ||
449 | 231 | color: "white" | ||
450 | 232 | visible: root.itemRunning | ||
451 | 233 | } | ||
452 | 234 | } | ||
453 | 218 | } | 235 | } |
454 | 219 | 236 | ||
456 | 220 | Image { | 237 | Rectangle { |
457 | 221 | objectName: "focusedHighlight" | 238 | objectName: "focusedHighlight" |
458 | 222 | anchors { | 239 | anchors { |
459 | 223 | right: parent.right | 240 | right: parent.right |
460 | 224 | verticalCenter: parent.verticalCenter | 241 | verticalCenter: parent.verticalCenter |
461 | 225 | } | 242 | } |
462 | 243 | width: units.gu(0.25) | ||
463 | 244 | height: units.gu(.5) | ||
464 | 245 | color: "white" | ||
465 | 226 | visible: root.itemFocused | 246 | visible: root.itemFocused |
467 | 227 | source: "graphics/focused_app_arrow.png" | 247 | } |
468 | 248 | |||
469 | 249 | Rectangle { | ||
470 | 250 | objectName: "shortcutHint" | ||
471 | 251 | anchors.centerIn: parent | ||
472 | 252 | width: units.gu(3) | ||
473 | 253 | height: width | ||
474 | 254 | color: "#E0292929" | ||
475 | 255 | visible: root.shortcutHintShown | ||
476 | 256 | Label { | ||
477 | 257 | anchors.centerIn: parent | ||
478 | 258 | text: (itemIndex + 1) % 10 | ||
479 | 259 | color: "white" | ||
480 | 260 | font.weight: Font.DemiBold | ||
481 | 261 | } | ||
482 | 228 | } | 262 | } |
483 | 229 | } | 263 | } |
484 | 230 | 264 | ||
485 | 231 | 265 | ||
486 | === modified file 'qml/Launcher/LauncherPanel.qml' | |||
487 | --- qml/Launcher/LauncherPanel.qml 2016-01-11 17:38:19 +0000 | |||
488 | +++ qml/Launcher/LauncherPanel.qml 2016-03-10 09:37:58 +0000 | |||
489 | @@ -19,12 +19,13 @@ | |||
490 | 19 | import Ubuntu.Components.ListItems 1.3 as ListItems | 19 | import Ubuntu.Components.ListItems 1.3 as ListItems |
491 | 20 | import Unity.Launcher 0.1 | 20 | import Unity.Launcher 0.1 |
492 | 21 | import Ubuntu.Components.Popups 1.3 | 21 | import Ubuntu.Components.Popups 1.3 |
493 | 22 | import GlobalShortcut 1.0 | ||
494 | 22 | import "../Components/ListItems" | 23 | import "../Components/ListItems" |
495 | 23 | import "../Components/" | 24 | import "../Components/" |
496 | 24 | 25 | ||
497 | 25 | Rectangle { | 26 | Rectangle { |
498 | 26 | id: root | 27 | id: root |
500 | 27 | color: "#B2000000" | 28 | color: "#E0292929" |
501 | 28 | 29 | ||
502 | 29 | rotation: inverted ? 180 : 0 | 30 | rotation: inverted ? 180 : 0 |
503 | 30 | 31 | ||
504 | @@ -33,11 +34,13 @@ | |||
505 | 33 | property bool dragging: false | 34 | property bool dragging: false |
506 | 34 | property bool moving: launcherListView.moving || launcherListView.flicking | 35 | property bool moving: launcherListView.moving || launcherListView.flicking |
507 | 35 | property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed | 36 | property bool preventHiding: moving || dndArea.draggedIndex >= 0 || quickList.state === "open" || dndArea.pressed |
510 | 36 | || mouseEventEater.containsMouse || dashItem.hovered | 37 | || mouseEventEater.containsMouse || dashItem.hovered |
511 | 37 | property int highlightIndex: -1 | 38 | property int highlightIndex: -2 |
512 | 39 | property bool shortcutHintsShown: false | ||
513 | 38 | 40 | ||
514 | 39 | signal applicationSelected(string appId) | 41 | signal applicationSelected(string appId) |
515 | 40 | signal showDashHome() | 42 | signal showDashHome() |
516 | 43 | signal kbdNavigationCancelled() | ||
517 | 41 | 44 | ||
518 | 42 | onXChanged: { | 45 | onXChanged: { |
519 | 43 | if (quickList.state == "open") { | 46 | if (quickList.state == "open") { |
520 | @@ -45,6 +48,26 @@ | |||
521 | 45 | } | 48 | } |
522 | 46 | } | 49 | } |
523 | 47 | 50 | ||
524 | 51 | function highlightNext() { | ||
525 | 52 | highlightIndex++; | ||
526 | 53 | if (highlightIndex >= launcherListView.count) { | ||
527 | 54 | highlightIndex = -1; | ||
528 | 55 | } | ||
529 | 56 | launcherListView.moveToIndex(Math.max(highlightIndex, 0)); | ||
530 | 57 | } | ||
531 | 58 | function highlightPrevious() { | ||
532 | 59 | highlightIndex--; | ||
533 | 60 | if (highlightIndex <= -2) { | ||
534 | 61 | highlightIndex = launcherListView.count - 1; | ||
535 | 62 | } | ||
536 | 63 | launcherListView.moveToIndex(Math.max(highlightIndex, 0)); | ||
537 | 64 | } | ||
538 | 65 | function openQuicklist(index) { | ||
539 | 66 | quickList.open(index); | ||
540 | 67 | quickList.selectedIndex = 0; | ||
541 | 68 | quickList.focus = true; | ||
542 | 69 | } | ||
543 | 70 | |||
544 | 48 | MouseArea { | 71 | MouseArea { |
545 | 49 | id: mouseEventEater | 72 | id: mouseEventEater |
546 | 50 | anchors.fill: parent | 73 | anchors.fill: parent |
547 | @@ -57,24 +80,16 @@ | |||
548 | 57 | fill: parent | 80 | fill: parent |
549 | 58 | } | 81 | } |
550 | 59 | 82 | ||
552 | 60 | Item { | 83 | Rectangle { |
553 | 61 | objectName: "buttonShowDashHome" | 84 | objectName: "buttonShowDashHome" |
554 | 62 | width: parent.width | 85 | width: parent.width |
566 | 63 | height: units.gu(7) | 86 | height: width * .9 |
567 | 64 | clip: true | 87 | color: UbuntuColors.orange |
568 | 65 | 88 | readonly property bool highlighted: root.highlightIndex == -1; | |
558 | 66 | UbuntuShape { | ||
559 | 67 | anchors { | ||
560 | 68 | fill: parent | ||
561 | 69 | topMargin: -units.gu(2) | ||
562 | 70 | } | ||
563 | 71 | aspect: UbuntuShape.Flat | ||
564 | 72 | backgroundColor: UbuntuColors.orange | ||
565 | 73 | } | ||
569 | 74 | 89 | ||
570 | 75 | Image { | 90 | Image { |
571 | 76 | objectName: "dashItem" | 91 | objectName: "dashItem" |
573 | 77 | width: units.gu(5) | 92 | width: parent.width * .6 |
574 | 78 | height: width | 93 | height: width |
575 | 79 | anchors.centerIn: parent | 94 | anchors.centerIn: parent |
576 | 80 | source: "graphics/home.png" | 95 | source: "graphics/home.png" |
577 | @@ -85,6 +100,14 @@ | |||
578 | 85 | anchors.fill: parent | 100 | anchors.fill: parent |
579 | 86 | onClicked: root.showDashHome() | 101 | onClicked: root.showDashHome() |
580 | 87 | } | 102 | } |
581 | 103 | Rectangle { | ||
582 | 104 | objectName: "bfbFocusHighlight" | ||
583 | 105 | anchors.fill: parent | ||
584 | 106 | border.color: "white" | ||
585 | 107 | border.width: units.dp(1) | ||
586 | 108 | color: "transparent" | ||
587 | 109 | visible: parent.highlighted | ||
588 | 110 | } | ||
589 | 88 | } | 111 | } |
590 | 89 | 112 | ||
591 | 90 | Item { | 113 | Item { |
592 | @@ -102,10 +125,8 @@ | |||
593 | 102 | objectName: "launcherListView" | 125 | objectName: "launcherListView" |
594 | 103 | anchors { | 126 | anchors { |
595 | 104 | fill: parent | 127 | fill: parent |
600 | 105 | topMargin: -extensionSize + units.gu(0.5) | 128 | topMargin: -extensionSize + width * .15 |
601 | 106 | bottomMargin: -extensionSize + units.gu(1) | 129 | bottomMargin: -extensionSize + width * .15 |
598 | 107 | leftMargin: units.gu(0.5) | ||
599 | 108 | rightMargin: units.gu(0.5) | ||
602 | 109 | } | 130 | } |
603 | 110 | topMargin: extensionSize | 131 | topMargin: extensionSize |
604 | 111 | bottomMargin: extensionSize | 132 | bottomMargin: extensionSize |
605 | @@ -140,11 +161,11 @@ | |||
606 | 140 | } | 161 | } |
607 | 141 | 162 | ||
608 | 142 | // The height of the area where icons start getting folded | 163 | // The height of the area where icons start getting folded |
610 | 143 | property int foldingStartHeight: units.gu(6.5) | 164 | property int foldingStartHeight: itemHeight |
611 | 144 | // The height of the area where the items reach the final folding angle | 165 | // The height of the area where the items reach the final folding angle |
612 | 145 | property int foldingStopHeight: foldingStartHeight - itemHeight - spacing | 166 | property int foldingStopHeight: foldingStartHeight - itemHeight - spacing |
615 | 146 | property int itemWidth: units.gu(7) | 167 | property int itemWidth: width * .75 |
616 | 147 | property int itemHeight: units.gu(6.5) | 168 | property int itemHeight: itemWidth * 15 / 16 + units.gu(1) |
617 | 148 | property int clickFlickSpeed: units.gu(60) | 169 | property int clickFlickSpeed: units.gu(60) |
618 | 149 | property int draggedIndex: dndArea.draggedIndex | 170 | property int draggedIndex: dndArea.draggedIndex |
619 | 150 | property real realContentY: contentY - originY + topMargin | 171 | property real realContentY: contentY - originY + topMargin |
620 | @@ -172,12 +193,24 @@ | |||
621 | 172 | 193 | ||
622 | 173 | UbuntuNumberAnimation { | 194 | UbuntuNumberAnimation { |
623 | 174 | id: moveAnimation | 195 | id: moveAnimation |
624 | 196 | objectName: "moveAnimation" | ||
625 | 175 | target: launcherListView | 197 | target: launcherListView |
626 | 176 | property: "contentY" | 198 | property: "contentY" |
627 | 177 | function moveTo(contentY) { | 199 | function moveTo(contentY) { |
628 | 178 | from = launcherListView.contentY; | 200 | from = launcherListView.contentY; |
629 | 179 | to = contentY; | 201 | to = contentY; |
631 | 180 | start(); | 202 | restart(); |
632 | 203 | } | ||
633 | 204 | } | ||
634 | 205 | function moveToIndex(index) { | ||
635 | 206 | var totalItemHeight = launcherListView.itemHeight + launcherListView.spacing | ||
636 | 207 | var itemPosition = index * totalItemHeight; | ||
637 | 208 | var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin | ||
638 | 209 | var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : totalItemHeight | ||
639 | 210 | if (itemPosition + totalItemHeight + distanceToEnd > launcherListView.contentY + launcherListView.originY + launcherListView.topMargin + height) { | ||
640 | 211 | moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd - launcherListView.originY); | ||
641 | 212 | } else if (itemPosition - distanceToEnd < launcherListView.contentY - launcherListView.originY + launcherListView.topMargin) { | ||
642 | 213 | moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin + launcherListView.originY); | ||
643 | 181 | } | 214 | } |
644 | 182 | } | 215 | } |
645 | 183 | 216 | ||
646 | @@ -192,9 +225,10 @@ | |||
647 | 192 | // the right app when running autopilot tests for | 225 | // the right app when running autopilot tests for |
648 | 193 | // multiple apps. | 226 | // multiple apps. |
649 | 194 | readonly property string appId: model.appId | 227 | readonly property string appId: model.appId |
650 | 228 | itemIndex: index | ||
651 | 195 | itemHeight: launcherListView.itemHeight | 229 | itemHeight: launcherListView.itemHeight |
652 | 196 | itemWidth: launcherListView.itemWidth | 230 | itemWidth: launcherListView.itemWidth |
654 | 197 | width: itemWidth | 231 | width: parent.width |
655 | 198 | height: itemHeight | 232 | height: itemHeight |
656 | 199 | iconName: model.icon | 233 | iconName: model.icon |
657 | 200 | count: model.count | 234 | count: model.count |
658 | @@ -204,6 +238,8 @@ | |||
659 | 204 | itemFocused: model.focused | 238 | itemFocused: model.focused |
660 | 205 | inverted: root.inverted | 239 | inverted: root.inverted |
661 | 206 | alerting: model.alerting | 240 | alerting: model.alerting |
662 | 241 | highlighted: root.highlightIndex == index | ||
663 | 242 | shortcutHintShown: root.shortcutHintsShown && index <= 9 | ||
664 | 207 | z: -Math.abs(offset) | 243 | z: -Math.abs(offset) |
665 | 208 | maxAngle: 55 | 244 | maxAngle: 55 |
666 | 209 | property bool dragging: false | 245 | property bool dragging: false |
667 | @@ -241,14 +277,7 @@ | |||
668 | 241 | onAlertingChanged: { | 277 | onAlertingChanged: { |
669 | 242 | if(alerting) { | 278 | if(alerting) { |
670 | 243 | if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) { | 279 | if (!dragging && (launcherListView.peekingIndex === -1 || launcher.visibleWidth > 0)) { |
679 | 244 | var itemPosition = index * launcherListView.itemHeight; | 280 | launcherListView.moveToIndex(index) |
672 | 245 | var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin | ||
673 | 246 | var distanceToEnd = index == 0 || index == launcherListView.count - 1 ? 0 : launcherListView.itemHeight | ||
674 | 247 | if (itemPosition + launcherListView.itemHeight + distanceToEnd > launcherListView.contentY + launcherListView.topMargin + height) { | ||
675 | 248 | moveAnimation.moveTo(itemPosition + launcherListView.itemHeight - launcherListView.topMargin - height + distanceToEnd); | ||
676 | 249 | } else if (itemPosition - distanceToEnd < launcherListView.contentY + launcherListView.topMargin) { | ||
677 | 250 | moveAnimation.moveTo(itemPosition - distanceToEnd - launcherListView.topMargin); | ||
678 | 251 | } | ||
680 | 252 | if (!dragging && launcher.state !== "visible") { | 281 | if (!dragging && launcher.state !== "visible") { |
681 | 253 | peekingAnimation.start() | 282 | peekingAnimation.start() |
682 | 254 | } | 283 | } |
683 | @@ -402,10 +431,7 @@ | |||
684 | 402 | 431 | ||
685 | 403 | if (mouse.button & Qt.RightButton) { // context menu | 432 | if (mouse.button & Qt.RightButton) { // context menu |
686 | 404 | // Opening QuickList | 433 | // Opening QuickList |
691 | 405 | quickList.item = clickedItem; | 434 | quickList.open(index); |
688 | 406 | quickList.model = launcherListView.model.get(index).quickList; | ||
689 | 407 | quickList.appId = launcherListView.model.get(index).appId; | ||
690 | 408 | quickList.state = "open"; | ||
692 | 409 | return; | 435 | return; |
693 | 410 | } | 436 | } |
694 | 411 | 437 | ||
695 | @@ -413,10 +439,8 @@ | |||
696 | 413 | 439 | ||
697 | 414 | // First/last item do the scrolling at more than 12 degrees | 440 | // First/last item do the scrolling at more than 12 degrees |
698 | 415 | if (index == 0 || index == launcherListView.count - 1) { | 441 | if (index == 0 || index == launcherListView.count - 1) { |
703 | 416 | if (clickedItem.angle > 12) { | 442 | if (clickedItem.angle > 12 || clickedItem.angle < -12) { |
704 | 417 | launcherListView.flick(0, -launcherListView.clickFlickSpeed); | 443 | launcherListView.moveToIndex(index); |
701 | 418 | } else if (clickedItem.angle < -12) { | ||
702 | 419 | launcherListView.flick(0, launcherListView.clickFlickSpeed); | ||
705 | 420 | } else { | 444 | } else { |
706 | 421 | root.applicationSelected(LauncherModel.get(index).appId); | 445 | root.applicationSelected(LauncherModel.get(index).appId); |
707 | 422 | } | 446 | } |
708 | @@ -424,10 +448,8 @@ | |||
709 | 424 | } | 448 | } |
710 | 425 | 449 | ||
711 | 426 | // the rest launches apps up to an angle of 30 degrees | 450 | // the rest launches apps up to an angle of 30 degrees |
716 | 427 | if (clickedItem.angle > 30) { | 451 | if (clickedItem.angle > 30 || clickedItem.angle < -30) { |
717 | 428 | launcherListView.flick(0, -launcherListView.clickFlickSpeed); | 452 | launcherListView.moveToIndex(index); |
714 | 429 | } else if (clickedItem.angle < -30) { | ||
715 | 430 | launcherListView.flick(0, launcherListView.clickFlickSpeed); | ||
718 | 431 | } else { | 453 | } else { |
719 | 432 | root.applicationSelected(LauncherModel.get(index).appId); | 454 | root.applicationSelected(LauncherModel.get(index).appId); |
720 | 433 | } | 455 | } |
721 | @@ -481,11 +503,7 @@ | |||
722 | 481 | 503 | ||
723 | 482 | draggedIndex = Math.floor((mouse.y + launcherListView.realContentY) / launcherListView.realItemHeight); | 504 | draggedIndex = Math.floor((mouse.y + launcherListView.realContentY) / launcherListView.realItemHeight); |
724 | 483 | 505 | ||
730 | 484 | // Opening QuickList | 506 | quickList.open(draggedIndex) |
726 | 485 | quickList.item = selectedItem; | ||
727 | 486 | quickList.model = launcherListView.model.get(draggedIndex).quickList; | ||
728 | 487 | quickList.appId = launcherListView.model.get(draggedIndex).appId; | ||
729 | 488 | quickList.state = "open"; | ||
731 | 489 | 507 | ||
732 | 490 | launcherListView.interactive = false | 508 | launcherListView.interactive = false |
733 | 491 | 509 | ||
734 | @@ -644,7 +662,9 @@ | |||
735 | 644 | enabled: quickList.state == "open" || pressed | 662 | enabled: quickList.state == "open" || pressed |
736 | 645 | 663 | ||
737 | 646 | onClicked: { | 664 | onClicked: { |
739 | 647 | quickList.state = "" | 665 | quickList.state = ""; |
740 | 666 | quickList.focus = false; | ||
741 | 667 | root.kbdNavigationCancelled(); | ||
742 | 648 | } | 668 | } |
743 | 649 | 669 | ||
744 | 650 | // Forward for dragging to work when quickList is open | 670 | // Forward for dragging to work when quickList is open |
745 | @@ -693,12 +713,60 @@ | |||
746 | 693 | property var model | 713 | property var model |
747 | 694 | property string appId | 714 | property string appId |
748 | 695 | property var item | 715 | property var item |
749 | 716 | property int selectedIndex: -1 | ||
750 | 717 | |||
751 | 718 | Keys.onPressed: { | ||
752 | 719 | switch (event.key) { | ||
753 | 720 | case Qt.Key_Down: | ||
754 | 721 | selectedIndex++; | ||
755 | 722 | if (selectedIndex >= popoverRepeater.count) { | ||
756 | 723 | selectedIndex = 0; | ||
757 | 724 | } | ||
758 | 725 | event.accepted = true; | ||
759 | 726 | break; | ||
760 | 727 | case Qt.Key_Up: | ||
761 | 728 | selectedIndex--; | ||
762 | 729 | if (selectedIndex < 0) { | ||
763 | 730 | selectedIndex = popoverRepeater.count - 1; | ||
764 | 731 | } | ||
765 | 732 | event.accepted = true; | ||
766 | 733 | break; | ||
767 | 734 | case Qt.Key_Left: | ||
768 | 735 | case Qt.Key_Escape: | ||
769 | 736 | quickList.selectedIndex = -1; | ||
770 | 737 | quickList.focus = false; | ||
771 | 738 | quickList.state = "" | ||
772 | 739 | event.accepted = true; | ||
773 | 740 | break; | ||
774 | 741 | case Qt.Key_Enter: | ||
775 | 742 | case Qt.Key_Return: | ||
776 | 743 | case Qt.Key_Space: | ||
777 | 744 | if (quickList.selectedIndex >= 0) { | ||
778 | 745 | LauncherModel.quickListActionInvoked(quickList.appId, quickList.selectedIndex) | ||
779 | 746 | } | ||
780 | 747 | quickList.selectedIndex = -1; | ||
781 | 748 | quickList.focus = false; | ||
782 | 749 | quickList.state = "" | ||
783 | 750 | root.kbdNavigationCancelled(); | ||
784 | 751 | event.accepted = true; | ||
785 | 752 | break; | ||
786 | 753 | } | ||
787 | 754 | } | ||
788 | 696 | 755 | ||
789 | 697 | // internal | 756 | // internal |
790 | 698 | property int itemCenter: item ? root.mapFromItem(quickList.item).y + (item.height / 2) + quickList.item.offset : units.gu(1) | 757 | property int itemCenter: item ? root.mapFromItem(quickList.item).y + (item.height / 2) + quickList.item.offset : units.gu(1) |
791 | 699 | property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height : | 758 | property int offset: itemCenter + (height/2) + units.gu(1) > parent.height ? -itemCenter - (height/2) - units.gu(1) + parent.height : |
792 | 700 | itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0 | 759 | itemCenter - (height/2) < units.gu(1) ? (height/2) - itemCenter + units.gu(1) : 0 |
793 | 701 | 760 | ||
794 | 761 | function open(index) { | ||
795 | 762 | var itemPosition = index * launcherListView.itemHeight; | ||
796 | 763 | var height = launcherListView.height - launcherListView.topMargin - launcherListView.bottomMargin | ||
797 | 764 | item = launcherListView.itemAt(launcherListView.width / 2, itemPosition + launcherListView.itemHeight / 2); | ||
798 | 765 | quickList.model = launcherListView.model.get(index).quickList; | ||
799 | 766 | quickList.appId = launcherListView.model.get(index).appId; | ||
800 | 767 | quickList.state = "open"; | ||
801 | 768 | } | ||
802 | 769 | |||
803 | 702 | Column { | 770 | Column { |
804 | 703 | id: quickListColumn | 771 | id: quickListColumn |
805 | 704 | width: parent.width | 772 | width: parent.width |
806 | @@ -712,6 +780,7 @@ | |||
807 | 712 | objectName: "quickListEntry" + index | 780 | objectName: "quickListEntry" + index |
808 | 713 | text: (model.clickable ? "" : "<b>") + model.label + (model.clickable ? "" : "</b>") | 781 | text: (model.clickable ? "" : "<b>") + model.label + (model.clickable ? "" : "</b>") |
809 | 714 | highlightWhenPressed: model.clickable | 782 | highlightWhenPressed: model.clickable |
810 | 783 | selected: index === quickList.selectedIndex | ||
811 | 715 | 784 | ||
812 | 716 | // FIXME: This is a workaround for the theme not being context sensitive. I.e. the | 785 | // FIXME: This is a workaround for the theme not being context sensitive. I.e. the |
813 | 717 | // ListItems don't know that they are sitting in a themed Popover where the color | 786 | // ListItems don't know that they are sitting in a themed Popover where the color |
814 | @@ -727,6 +796,8 @@ | |||
815 | 727 | // Unsetting model to prevent showing changing entries during fading out | 796 | // Unsetting model to prevent showing changing entries during fading out |
816 | 728 | // that may happen because of triggering an action. | 797 | // that may happen because of triggering an action. |
817 | 729 | LauncherModel.quickListActionInvoked(quickList.appId, index); | 798 | LauncherModel.quickListActionInvoked(quickList.appId, index); |
818 | 799 | quickList.focus = false; | ||
819 | 800 | root.kbdNavigationCancelled(); | ||
820 | 730 | quickList.model = undefined; | 801 | quickList.model = undefined; |
821 | 731 | } | 802 | } |
822 | 732 | } | 803 | } |
823 | 733 | 804 | ||
824 | === added file 'qml/Launcher/graphics/launcher-app-focus-ring.svg' | |||
825 | --- qml/Launcher/graphics/launcher-app-focus-ring.svg 1970-01-01 00:00:00 +0000 | |||
826 | +++ qml/Launcher/graphics/launcher-app-focus-ring.svg 2016-03-10 09:37:58 +0000 | |||
827 | @@ -0,0 +1,12 @@ | |||
828 | 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
829 | 2 | <svg width="172px" height="163px" viewBox="0 0 172 163" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"> | ||
830 | 3 | <!-- Generator: Sketch 3.4.4 (17249) - http://www.bohemiancoding.com/sketch --> | ||
831 | 4 | <title>Shape</title> | ||
832 | 5 | <desc>Created with Sketch.</desc> | ||
833 | 6 | <defs></defs> | ||
834 | 7 | <g id="•-Launcher" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"> | ||
835 | 8 | <g id="Artboard-9" sketch:type="MSArtboardGroup" transform="translate(-163.000000, -1436.000000)" fill="#E95420"> | ||
836 | 9 | <path d="M221.983432,1440 L221.983432,1440 C195.6127,1440 184.708233,1442.4723 177.107949,1450.10734 C169.476819,1457.77336 167,1468.79245 167,1495.3481 L167,1538.9019 C167,1565.45755 169.476819,1576.47664 177.107949,1584.14266 C184.708233,1591.7777 195.6127,1594.25 221.983432,1594.25 L276.016868,1594.25 C302.387595,1594.25 313.291998,1591.77771 320.892221,1584.14264 C328.523252,1576.47663 331,1565.45769 331,1538.9019 L331,1495.3481 C331,1468.79231 328.523252,1457.77337 320.892221,1450.10736 C313.291998,1442.47229 302.387595,1440 276.016868,1440 L221.983432,1440 Z M221.983432,1436 L276.016868,1436 C302.345315,1436 314.848953,1438.36655 323.727108,1447.2854 C332.633306,1456.23243 335,1468.85167 335,1495.3481 L335,1538.9019 C335,1565.39833 332.633306,1578.01757 323.727108,1586.9646 C314.848953,1595.88345 302.345315,1598.25 276.016868,1598.25 L221.983432,1598.25 C195.654985,1598.25 183.151291,1595.88345 174.273077,1586.96463 C165.366772,1578.0176 163,1565.39822 163,1538.9019 L163,1495.3481 C163,1468.85178 165.366772,1456.2324 174.273077,1447.28537 C183.151291,1438.36655 195.654985,1436 221.983432,1436 L221.983432,1436 Z" id="Shape" sketch:type="MSShapeGroup"></path> | ||
837 | 10 | </g> | ||
838 | 11 | </g> | ||
839 | 12 | </svg> | ||
840 | 0 | \ No newline at end of file | 13 | \ No newline at end of file |
841 | 1 | 14 | ||
842 | === modified file 'qml/Shell.qml' | |||
843 | --- qml/Shell.qml 2016-03-08 20:59:08 +0000 | |||
844 | +++ qml/Shell.qml 2016-03-10 09:37:58 +0000 | |||
845 | @@ -25,6 +25,7 @@ | |||
846 | 25 | import Unity.Connectivity 0.1 | 25 | import Unity.Connectivity 0.1 |
847 | 26 | import Unity.Launcher 0.1 | 26 | import Unity.Launcher 0.1 |
848 | 27 | import GlobalShortcut 1.0 // has to be before Utils, because of WindowKeysFilter | 27 | import GlobalShortcut 1.0 // has to be before Utils, because of WindowKeysFilter |
849 | 28 | import GSettings 1.0 | ||
850 | 28 | import Utils 0.1 | 29 | import Utils 0.1 |
851 | 29 | import Powerd 0.1 | 30 | import Powerd 0.1 |
852 | 30 | import SessionBroadcast 0.1 | 31 | import SessionBroadcast 0.1 |
853 | @@ -187,6 +188,11 @@ | |||
854 | 187 | } | 188 | } |
855 | 188 | } | 189 | } |
856 | 189 | 190 | ||
857 | 191 | GSettings { | ||
858 | 192 | id: settings | ||
859 | 193 | schema.id: "com.canonical.Unity8" | ||
860 | 194 | } | ||
861 | 195 | |||
862 | 190 | Item { | 196 | Item { |
863 | 191 | id: stages | 197 | id: stages |
864 | 192 | objectName: "stages" | 198 | objectName: "stages" |
865 | @@ -343,6 +349,11 @@ | |||
866 | 343 | property: "altTabPressed" | 349 | property: "altTabPressed" |
867 | 344 | value: physicalKeysMapper.altTabPressed | 350 | value: physicalKeysMapper.altTabPressed |
868 | 345 | } | 351 | } |
869 | 352 | Binding { | ||
870 | 353 | target: applicationsDisplayLoader.item | ||
871 | 354 | property: "leftMargin" | ||
872 | 355 | value: shell.usageScenario == "desktop" && !settings.autohideLauncher ? launcher.panelWidth: 0 | ||
873 | 356 | } | ||
874 | 346 | } | 357 | } |
875 | 347 | 358 | ||
876 | 348 | Tutorial { | 359 | Tutorial { |
877 | @@ -373,7 +384,11 @@ | |||
878 | 373 | InputMethod { | 384 | InputMethod { |
879 | 374 | id: inputMethod | 385 | id: inputMethod |
880 | 375 | objectName: "inputMethod" | 386 | objectName: "inputMethod" |
882 | 376 | anchors { fill: parent; topMargin: panel.panelHeight } | 387 | anchors { |
883 | 388 | fill: parent | ||
884 | 389 | topMargin: panel.panelHeight | ||
885 | 390 | leftMargin: launcher.lockedVisible ? launcher.panelWidth : 0 | ||
886 | 391 | } | ||
887 | 377 | z: notifications.useModal || panel.indicators.shown || wizard.active ? overlay.z + 1 : overlay.z - 1 | 392 | z: notifications.useModal || panel.indicators.shown || wizard.active ? overlay.z + 1 : overlay.z - 1 |
888 | 378 | } | 393 | } |
889 | 379 | 394 | ||
890 | @@ -557,6 +572,10 @@ | |||
891 | 557 | && !greeter.hasLockedApp | 572 | && !greeter.hasLockedApp |
892 | 558 | inverted: shell.usageScenario !== "desktop" | 573 | inverted: shell.usageScenario !== "desktop" |
893 | 559 | shadeBackground: !tutorial.running | 574 | shadeBackground: !tutorial.running |
894 | 575 | superPressed: physicalKeysMapper.superPressed | ||
895 | 576 | superTabPressed: physicalKeysMapper.superTabPressed | ||
896 | 577 | panelWidth: units.gu(settings.launcherWidth) | ||
897 | 578 | lockedVisible: shell.usageScenario == "desktop" && !settings.autohideLauncher && !panel.fullscreenMode | ||
898 | 560 | 579 | ||
899 | 561 | onShowDashHome: showHome() | 580 | onShowDashHome: showHome() |
900 | 562 | onDash: showDash() | 581 | onDash: showDash() |
901 | @@ -576,6 +595,37 @@ | |||
902 | 576 | panel.indicators.hide() | 595 | panel.indicators.hide() |
903 | 577 | } | 596 | } |
904 | 578 | } | 597 | } |
905 | 598 | onFocusChanged: { | ||
906 | 599 | if (!focus) { | ||
907 | 600 | applicationsDisplayLoader.focus = true; | ||
908 | 601 | } | ||
909 | 602 | } | ||
910 | 603 | |||
911 | 604 | GlobalShortcut { | ||
912 | 605 | shortcut: Qt.AltModifier | Qt.Key_F1 | ||
913 | 606 | onTriggered: { | ||
914 | 607 | launcher.openForKeyboardNavigation(); | ||
915 | 608 | } | ||
916 | 609 | } | ||
917 | 610 | GlobalShortcut { | ||
918 | 611 | shortcut: Qt.MetaModifier | Qt.Key_0 | ||
919 | 612 | onTriggered: { | ||
920 | 613 | if (LauncherModel.get(9)) { | ||
921 | 614 | activateApplication(LauncherModel.get(9).appId); | ||
922 | 615 | } | ||
923 | 616 | } | ||
924 | 617 | } | ||
925 | 618 | Repeater { | ||
926 | 619 | model: 9 | ||
927 | 620 | GlobalShortcut { | ||
928 | 621 | shortcut: Qt.MetaModifier | (Qt.Key_1 + index) | ||
929 | 622 | onTriggered: { | ||
930 | 623 | if (LauncherModel.get(index)) { | ||
931 | 624 | activateApplication(LauncherModel.get(index).appId); | ||
932 | 625 | } | ||
933 | 626 | } | ||
934 | 627 | } | ||
935 | 628 | } | ||
936 | 579 | } | 629 | } |
937 | 580 | 630 | ||
938 | 581 | Wizard { | 631 | Wizard { |
939 | 582 | 632 | ||
940 | === modified file 'qml/Stages/AbstractStage.qml' | |||
941 | --- qml/Stages/AbstractStage.qml 2016-01-14 13:03:20 +0000 | |||
942 | +++ qml/Stages/AbstractStage.qml 2016-03-10 09:37:58 +0000 | |||
943 | @@ -39,6 +39,8 @@ | |||
944 | 39 | property int shellOrientationAngle | 39 | property int shellOrientationAngle |
945 | 40 | property bool spreadEnabled: true // If false, animations and right edge will be disabled | 40 | property bool spreadEnabled: true // If false, animations and right edge will be disabled |
946 | 41 | property bool suspended | 41 | property bool suspended |
947 | 42 | // A Stage should paint a wallpaper etc over its full size but not use the margins for window placement | ||
948 | 43 | property int leftMargin: 0 | ||
949 | 42 | 44 | ||
950 | 43 | // To be read from outside | 45 | // To be read from outside |
951 | 44 | property var mainApp: null | 46 | property var mainApp: null |
952 | 45 | 47 | ||
953 | === modified file 'qml/Stages/DecoratedWindow.qml' | |||
954 | --- qml/Stages/DecoratedWindow.qml 2015-11-30 18:25:47 +0000 | |||
955 | +++ qml/Stages/DecoratedWindow.qml 2016-03-10 09:37:58 +0000 | |||
956 | @@ -23,8 +23,8 @@ | |||
957 | 23 | FocusScope { | 23 | FocusScope { |
958 | 24 | id: root | 24 | id: root |
959 | 25 | 25 | ||
962 | 26 | width: applicationWindow.width | 26 | width: !counterRotate ? applicationWindow.width : applicationWindow.height |
963 | 27 | height: (decorationShown ? decoration.height : 0) + applicationWindow.height | 27 | height: visibleDecorationHeight + (!counterRotate ? applicationWindow.height : applicationWindow.width) |
964 | 28 | 28 | ||
965 | 29 | property alias window: applicationWindow | 29 | property alias window: applicationWindow |
966 | 30 | property alias application: applicationWindow.application | 30 | property alias application: applicationWindow.application |
967 | @@ -36,15 +36,18 @@ | |||
968 | 36 | property bool highlightShown: false | 36 | property bool highlightShown: false |
969 | 37 | property real shadowOpacity: 1 | 37 | property real shadowOpacity: 1 |
970 | 38 | 38 | ||
972 | 39 | property alias requestedWidth: applicationWindow.requestedWidth | 39 | property real requestedWidth |
973 | 40 | property real requestedHeight | 40 | property real requestedHeight |
974 | 41 | property alias surfaceOrientationAngle: applicationWindow.surfaceOrientationAngle | ||
975 | 42 | readonly property real visibleDecorationHeight: root.decorationShown ? decoration.height : 0 | ||
976 | 43 | readonly property bool counterRotate: surfaceOrientationAngle != 0 && surfaceOrientationAngle != 180 | ||
977 | 41 | 44 | ||
984 | 42 | property alias minimumWidth: applicationWindow.minimumWidth | 45 | readonly property int minimumWidth: !counterRotate ? applicationWindow.minimumWidth : applicationWindow.minimumHeight |
985 | 43 | readonly property int minimumHeight: (root.decorationShown ? decoration.height : 0) + applicationWindow.minimumHeight | 46 | readonly property int minimumHeight: visibleDecorationHeight + (!counterRotate ? applicationWindow.minimumHeight : applicationWindow.minimumWidth) |
986 | 44 | property alias maximumWidth: applicationWindow.maximumWidth | 47 | readonly property int maximumWidth: !counterRotate ? applicationWindow.maximumWidth : applicationWindow.maximumHeight |
987 | 45 | readonly property int maximumHeight: (root.decorationShown ? decoration.height : 0) + applicationWindow.maximumHeight | 48 | readonly property int maximumHeight: visibleDecorationHeight + (!counterRotate ? applicationWindow.maximumHeight : applicationWindow.maximumWidth) |
988 | 46 | property alias widthIncrement: applicationWindow.widthIncrement | 49 | readonly property int widthIncrement: !counterRotate ? applicationWindow.widthIncrement : applicationWindow.heightIncrement |
989 | 47 | property alias heightIncrement: applicationWindow.heightIncrement | 50 | readonly property int heightIncrement: !counterRotate ? applicationWindow.heightIncrement : applicationWindow.widthIncrement |
990 | 48 | 51 | ||
991 | 49 | signal close() | 52 | signal close() |
992 | 50 | signal maximize() | 53 | signal maximize() |
993 | @@ -98,8 +101,22 @@ | |||
994 | 98 | anchors.top: parent.top | 101 | anchors.top: parent.top |
995 | 99 | anchors.topMargin: decoration.height | 102 | anchors.topMargin: decoration.height |
996 | 100 | anchors.left: parent.left | 103 | anchors.left: parent.left |
998 | 101 | requestedHeight: root.requestedHeight - (root.decorationShown ? decoration.height : 0) | 104 | readonly property real requestedHeightMinusDecoration: root.requestedHeight - root.visibleDecorationHeight |
999 | 105 | requestedHeight: !counterRotate ? requestedHeightMinusDecoration : root.requestedWidth | ||
1000 | 106 | requestedWidth: !counterRotate ? root.requestedWidth : requestedHeightMinusDecoration | ||
1001 | 102 | interactive: true | 107 | interactive: true |
1002 | 103 | focus: true | 108 | focus: true |
1003 | 109 | |||
1004 | 110 | transform: Rotation { | ||
1005 | 111 | readonly property int rotationAngle: applicationWindow.application && | ||
1006 | 112 | applicationWindow.application.rotatesWindowContents | ||
1007 | 113 | ? ((360 - applicationWindow.surfaceOrientationAngle) % 360) : 0 | ||
1008 | 114 | readonly property real rotationOrigin: rotationAngle == 90 ? applicationWindow.height / 2 | ||
1009 | 115 | : rotationAngle == 270 ? applicationWindow.width / 2 | ||
1010 | 116 | : 0 | ||
1011 | 117 | origin.x: rotationOrigin | ||
1012 | 118 | origin.y: rotationOrigin | ||
1013 | 119 | angle: rotationAngle | ||
1014 | 120 | } | ||
1015 | 104 | } | 121 | } |
1016 | 105 | } | 122 | } |
1017 | 106 | 123 | ||
1018 | === modified file 'qml/Stages/DesktopStage.qml' | |||
1019 | --- qml/Stages/DesktopStage.qml 2016-02-03 14:00:47 +0000 | |||
1020 | +++ qml/Stages/DesktopStage.qml 2016-03-10 09:37:58 +0000 | |||
1021 | @@ -224,6 +224,7 @@ | |||
1022 | 224 | PanelState.dropShadow = false; | 224 | PanelState.dropShadow = false; |
1023 | 225 | } | 225 | } |
1024 | 226 | 226 | ||
1025 | 227 | |||
1026 | 227 | FocusScope { | 228 | FocusScope { |
1027 | 228 | id: appContainer | 229 | id: appContainer |
1028 | 229 | objectName: "appContainer" | 230 | objectName: "appContainer" |
1029 | @@ -254,14 +255,40 @@ | |||
1030 | 254 | focus: appId === priv.focusedAppId | 255 | focus: appId === priv.focusedAppId |
1031 | 255 | width: decoratedWindow.width | 256 | width: decoratedWindow.width |
1032 | 256 | height: decoratedWindow.height | 257 | height: decoratedWindow.height |
1033 | 258 | |||
1034 | 259 | Connections { | ||
1035 | 260 | target: root | ||
1036 | 261 | onShellOrientationAngleChanged: { | ||
1037 | 262 | // at this point decoratedWindow.surfaceOrientationAngle is the old shellOrientationAngle | ||
1038 | 263 | if (application && application.rotatesWindowContents) { | ||
1039 | 264 | if (state == "normal") { | ||
1040 | 265 | var angleDiff = decoratedWindow.surfaceOrientationAngle - shellOrientationAngle; | ||
1041 | 266 | angleDiff = (360 + angleDiff) % 360; | ||
1042 | 267 | if (angleDiff === 90 || angleDiff === 270) { | ||
1043 | 268 | var aux = decoratedWindow.requestedHeight; | ||
1044 | 269 | decoratedWindow.requestedHeight = decoratedWindow.requestedWidth + decoratedWindow.visibleDecorationHeight; | ||
1045 | 270 | decoratedWindow.requestedWidth = aux - decoratedWindow.visibleDecorationHeight; | ||
1046 | 271 | } | ||
1047 | 272 | } | ||
1048 | 273 | decoratedWindow.surfaceOrientationAngle = shellOrientationAngle; | ||
1049 | 274 | } else { | ||
1050 | 275 | decoratedWindow.surfaceOrientationAngle = 0; | ||
1051 | 276 | } | ||
1052 | 277 | } | ||
1053 | 278 | } | ||
1054 | 279 | Component.onCompleted: { | ||
1055 | 280 | decoratedWindow.surfaceOrientationAngle = shellOrientationAngle; | ||
1056 | 281 | } | ||
1057 | 282 | |||
1058 | 283 | readonly property alias application: decoratedWindow.application | ||
1059 | 284 | readonly property alias minimumWidth: decoratedWindow.minimumWidth | ||
1060 | 285 | readonly property alias minimumHeight: decoratedWindow.minimumHeight | ||
1061 | 286 | readonly property alias maximumWidth: decoratedWindow.maximumWidth | ||
1062 | 287 | readonly property alias maximumHeight: decoratedWindow.maximumHeight | ||
1063 | 288 | readonly property alias widthIncrement: decoratedWindow.widthIncrement | ||
1064 | 289 | readonly property alias heightIncrement: decoratedWindow.heightIncrement | ||
1065 | 257 | property alias requestedWidth: decoratedWindow.requestedWidth | 290 | property alias requestedWidth: decoratedWindow.requestedWidth |
1066 | 258 | property alias requestedHeight: decoratedWindow.requestedHeight | 291 | property alias requestedHeight: decoratedWindow.requestedHeight |
1067 | 259 | property alias minimumWidth: decoratedWindow.minimumWidth | ||
1068 | 260 | property alias minimumHeight: decoratedWindow.minimumHeight | ||
1069 | 261 | property alias maximumWidth: decoratedWindow.maximumWidth | ||
1070 | 262 | property alias maximumHeight: decoratedWindow.maximumHeight | ||
1071 | 263 | property alias widthIncrement: decoratedWindow.widthIncrement | ||
1072 | 264 | property alias heightIncrement: decoratedWindow.heightIncrement | ||
1073 | 265 | 292 | ||
1074 | 266 | QtObject { | 293 | QtObject { |
1075 | 267 | id: appDelegatePrivate | 294 | id: appDelegatePrivate |
1076 | @@ -274,6 +301,7 @@ | |||
1077 | 274 | readonly property alias maximizedLeft: appDelegatePrivate.maximizedLeft | 301 | readonly property alias maximizedLeft: appDelegatePrivate.maximizedLeft |
1078 | 275 | readonly property alias maximizedRight: appDelegatePrivate.maximizedRight | 302 | readonly property alias maximizedRight: appDelegatePrivate.maximizedRight |
1079 | 276 | readonly property alias minimized: appDelegatePrivate.minimized | 303 | readonly property alias minimized: appDelegatePrivate.minimized |
1080 | 304 | readonly property alias fullscreen: decoratedWindow.fullscreen | ||
1081 | 277 | 305 | ||
1082 | 278 | readonly property string appId: model.appId | 306 | readonly property string appId: model.appId |
1083 | 279 | property bool animationsEnabled: true | 307 | property bool animationsEnabled: true |
1084 | @@ -293,6 +321,7 @@ | |||
1085 | 293 | visible: !visuallyMinimized && | 321 | visible: !visuallyMinimized && |
1086 | 294 | !greeter.fullyShown && | 322 | !greeter.fullyShown && |
1087 | 295 | (priv.foregroundMaximizedAppZ === -1 || priv.foregroundMaximizedAppZ <= z) || | 323 | (priv.foregroundMaximizedAppZ === -1 || priv.foregroundMaximizedAppZ <= z) || |
1088 | 324 | decoratedWindow.fullscreen || | ||
1089 | 296 | (spread.state == "altTab" && index === spread.highlightedIndex) | 325 | (spread.state == "altTab" && index === spread.highlightedIndex) |
1090 | 297 | 326 | ||
1091 | 298 | Binding { | 327 | Binding { |
1092 | @@ -351,10 +380,11 @@ | |||
1093 | 351 | states: [ | 380 | states: [ |
1094 | 352 | State { | 381 | State { |
1095 | 353 | name: "fullscreen"; when: decoratedWindow.fullscreen | 382 | name: "fullscreen"; when: decoratedWindow.fullscreen |
1096 | 354 | extend: "maximized" | ||
1097 | 355 | PropertyChanges { | 383 | PropertyChanges { |
1098 | 356 | target: appDelegate; | 384 | target: appDelegate; |
1100 | 357 | y: -PanelState.panelHeight | 385 | x: rotation == 0 ? 0 : (parent.width - width) / 2 + (shellOrientationAngle == 90 ? -PanelState.panelHeight : PanelState.panelHeight) |
1101 | 386 | y: rotation == 0 ? -PanelState.panelHeight : (parent.height - height) / 2 | ||
1102 | 387 | requestedWidth: appContainer.width; requestedHeight: appContainer.height; | ||
1103 | 358 | } | 388 | } |
1104 | 359 | }, | 389 | }, |
1105 | 360 | State { | 390 | State { |
1106 | @@ -371,21 +401,21 @@ | |||
1107 | 371 | name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized | 401 | name: "maximized"; when: appDelegate.maximized && !appDelegate.minimized |
1108 | 372 | PropertyChanges { | 402 | PropertyChanges { |
1109 | 373 | target: appDelegate; | 403 | target: appDelegate; |
1112 | 374 | x: 0; y: 0; | 404 | x: root.leftMargin; y: 0; |
1113 | 375 | requestedWidth: root.width; requestedHeight: root.height; | 405 | requestedWidth: appContainer.width - root.leftMargin; requestedHeight: appContainer.height; |
1114 | 376 | visuallyMinimized: false; | 406 | visuallyMinimized: false; |
1115 | 377 | visuallyMaximized: true | 407 | visuallyMaximized: true |
1116 | 378 | } | 408 | } |
1117 | 379 | }, | 409 | }, |
1118 | 380 | State { | 410 | State { |
1119 | 381 | name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized | 411 | name: "maximizedLeft"; when: appDelegate.maximizedLeft && !appDelegate.minimized |
1122 | 382 | PropertyChanges { target: appDelegate; x: 0; y: PanelState.panelHeight; | 412 | PropertyChanges { target: appDelegate; x: root.leftMargin; y: PanelState.panelHeight; |
1123 | 383 | requestedWidth: root.width/2; requestedHeight: root.height - PanelState.panelHeight } | 413 | requestedWidth: (appContainer.width - root.leftMargin)/2; requestedHeight: appContainer.height - PanelState.panelHeight } |
1124 | 384 | }, | 414 | }, |
1125 | 385 | State { | 415 | State { |
1126 | 386 | name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized | 416 | name: "maximizedRight"; when: appDelegate.maximizedRight && !appDelegate.minimized |
1129 | 387 | PropertyChanges { target: appDelegate; x: root.width/2; y: PanelState.panelHeight; | 417 | PropertyChanges { target: appDelegate; x: (appContainer.width + root.leftMargin)/2; y: PanelState.panelHeight; |
1130 | 388 | requestedWidth: root.width/2; requestedHeight: root.height - PanelState.panelHeight } | 418 | requestedWidth: (appContainer.width - root.leftMargin)/2; requestedHeight: appContainer.height - PanelState.panelHeight } |
1131 | 389 | }, | 419 | }, |
1132 | 390 | State { | 420 | State { |
1133 | 391 | name: "minimized"; when: appDelegate.minimized | 421 | name: "minimized"; when: appDelegate.minimized |
1134 | @@ -448,8 +478,9 @@ | |||
1135 | 448 | minHeight: units.gu(10) | 478 | minHeight: units.gu(10) |
1136 | 449 | borderThickness: units.gu(2) | 479 | borderThickness: units.gu(2) |
1137 | 450 | windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing | 480 | windowId: model.appId // FIXME: Change this to point to windowId once we have such a thing |
1140 | 451 | screenWidth: root.width | 481 | screenWidth: appContainer.width |
1141 | 452 | screenHeight: root.height | 482 | screenHeight: appContainer.height |
1142 | 483 | leftMargin: root.leftMargin | ||
1143 | 453 | 484 | ||
1144 | 454 | onPressed: { ApplicationManager.focusApplication(model.appId) } | 485 | onPressed: { ApplicationManager.focusApplication(model.appId) } |
1145 | 455 | } | 486 | } |
1146 | @@ -475,7 +506,7 @@ | |||
1147 | 475 | 506 | ||
1148 | 476 | BlurLayer { | 507 | BlurLayer { |
1149 | 477 | id: blurLayer | 508 | id: blurLayer |
1151 | 478 | anchors.fill: parent | 509 | anchors.fill: appContainer |
1152 | 479 | source: appContainer | 510 | source: appContainer |
1153 | 480 | visible: false | 511 | visible: false |
1154 | 481 | } | 512 | } |
1155 | @@ -527,7 +558,7 @@ | |||
1156 | 527 | DesktopSpread { | 558 | DesktopSpread { |
1157 | 528 | id: spread | 559 | id: spread |
1158 | 529 | objectName: "spread" | 560 | objectName: "spread" |
1160 | 530 | anchors.fill: parent | 561 | anchors.fill: appContainer |
1161 | 531 | workspace: appContainer | 562 | workspace: appContainer |
1162 | 532 | focus: state == "altTab" | 563 | focus: state == "altTab" |
1163 | 533 | altTabPressed: root.altTabPressed | 564 | altTabPressed: root.altTabPressed |
1164 | 534 | 565 | ||
1165 | === modified file 'qml/Stages/WindowResizeArea.qml' | |||
1166 | --- qml/Stages/WindowResizeArea.qml 2016-02-03 14:00:47 +0000 | |||
1167 | +++ qml/Stages/WindowResizeArea.qml 2016-03-10 09:37:58 +0000 | |||
1168 | @@ -40,6 +40,7 @@ | |||
1169 | 40 | property int defaultHeight: units.gu(50) | 40 | property int defaultHeight: units.gu(50) |
1170 | 41 | property int screenWidth: 0 | 41 | property int screenWidth: 0 |
1171 | 42 | property int screenHeight: 0 | 42 | property int screenHeight: 0 |
1172 | 43 | property int leftMargin: 0 | ||
1173 | 43 | 44 | ||
1174 | 44 | QtObject { | 45 | QtObject { |
1175 | 45 | id: priv | 46 | id: priv |
1176 | @@ -72,10 +73,12 @@ | |||
1177 | 72 | var windowGeometry = windowStateStorage.getGeometry(root.windowId, | 73 | var windowGeometry = windowStateStorage.getGeometry(root.windowId, |
1178 | 73 | Qt.rect(target.x, target.y, defaultWidth, defaultHeight)); | 74 | Qt.rect(target.x, target.y, defaultWidth, defaultHeight)); |
1179 | 74 | 75 | ||
1184 | 75 | target.requestedWidth = Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth); | 76 | target.requestedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); }); |
1185 | 76 | target.requestedHeight = Math.min(Math.max(windowGeometry.height, d.minimumHeight), root.screenHeight - PanelState.panelHeight); | 77 | target.requestedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight), |
1186 | 77 | target.x = Math.max(Math.min(windowGeometry.x, root.screenWidth - target.requestedWidth), 0) | 78 | root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); }); |
1187 | 78 | target.y = Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight) | 79 | target.x = Qt.binding(function() { return Math.max(Math.min(windowGeometry.x, root.screenWidth - root.leftMargin - target.requestedWidth), |
1188 | 80 | (target.fullscreen ? 0 : root.leftMargin)); }); | ||
1189 | 81 | target.y = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight); }); | ||
1190 | 79 | 82 | ||
1191 | 80 | var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal) | 83 | var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal) |
1192 | 81 | if (windowState === WindowStateStorage.WindowStateMaximized) { | 84 | if (windowState === WindowStateStorage.WindowStateMaximized) { |
1193 | 82 | 85 | ||
1194 | === modified file 'tests/mocks/GSettings.1.0/fake_gsettings.cpp' | |||
1195 | --- tests/mocks/GSettings.1.0/fake_gsettings.cpp 2015-09-29 20:19:56 +0000 | |||
1196 | +++ tests/mocks/GSettings.1.0/fake_gsettings.cpp 2016-03-10 09:37:58 +0000 | |||
1197 | @@ -22,6 +22,8 @@ | |||
1198 | 22 | 22 | ||
1199 | 23 | GSettingsControllerQml::GSettingsControllerQml() | 23 | GSettingsControllerQml::GSettingsControllerQml() |
1200 | 24 | : m_usageMode("Staged") | 24 | : m_usageMode("Staged") |
1201 | 25 | , m_autohideLauncher(false) | ||
1202 | 26 | , m_launcherWidth(8) | ||
1203 | 25 | { | 27 | { |
1204 | 26 | } | 28 | } |
1205 | 27 | 29 | ||
1206 | @@ -88,6 +90,32 @@ | |||
1207 | 88 | } | 90 | } |
1208 | 89 | } | 91 | } |
1209 | 90 | 92 | ||
1210 | 93 | bool GSettingsControllerQml::autohideLauncher() const | ||
1211 | 94 | { | ||
1212 | 95 | return m_autohideLauncher; | ||
1213 | 96 | } | ||
1214 | 97 | |||
1215 | 98 | void GSettingsControllerQml::setAutohideLauncher(bool autohideLauncher) | ||
1216 | 99 | { | ||
1217 | 100 | if (m_autohideLauncher != autohideLauncher) { | ||
1218 | 101 | m_autohideLauncher = autohideLauncher; | ||
1219 | 102 | Q_EMIT autohideLauncherChanged(autohideLauncher); | ||
1220 | 103 | } | ||
1221 | 104 | } | ||
1222 | 105 | |||
1223 | 106 | int GSettingsControllerQml::launcherWidth() const | ||
1224 | 107 | { | ||
1225 | 108 | return m_launcherWidth; | ||
1226 | 109 | } | ||
1227 | 110 | |||
1228 | 111 | void GSettingsControllerQml::setLauncherWidth(int launcherWidth) | ||
1229 | 112 | { | ||
1230 | 113 | if (m_launcherWidth != launcherWidth) { | ||
1231 | 114 | m_launcherWidth = launcherWidth; | ||
1232 | 115 | Q_EMIT launcherWidthChanged(launcherWidth); | ||
1233 | 116 | } | ||
1234 | 117 | } | ||
1235 | 118 | |||
1236 | 91 | GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) { | 119 | GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) { |
1237 | 92 | } | 120 | } |
1238 | 93 | 121 | ||
1239 | @@ -129,6 +157,10 @@ | |||
1240 | 129 | this, &GSettingsQml::lockedOutTimeChanged); | 157 | this, &GSettingsQml::lockedOutTimeChanged); |
1241 | 130 | connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::lifecycleExemptAppidsChanged, | 158 | connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::lifecycleExemptAppidsChanged, |
1242 | 131 | this, &GSettingsQml::lifecycleExemptAppidsChanged); | 159 | this, &GSettingsQml::lifecycleExemptAppidsChanged); |
1243 | 160 | connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::autohideLauncherChanged, | ||
1244 | 161 | this, &GSettingsQml::autohideLauncherChanged); | ||
1245 | 162 | connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::launcherWidthChanged, | ||
1246 | 163 | this, &GSettingsQml::launcherWidthChanged); | ||
1247 | 132 | } | 164 | } |
1248 | 133 | 165 | ||
1249 | 134 | GSettingsSchemaQml * GSettingsQml::schema() const { | 166 | GSettingsSchemaQml * GSettingsQml::schema() const { |
1250 | @@ -192,9 +224,41 @@ | |||
1251 | 192 | } | 224 | } |
1252 | 193 | } | 225 | } |
1253 | 194 | 226 | ||
1254 | 227 | bool GSettingsQml::autohideLauncher() const | ||
1255 | 228 | { | ||
1256 | 229 | if (m_schema->id() == "com.canonical.Unity8") { | ||
1257 | 230 | return GSettingsControllerQml::instance()->autohideLauncher(); | ||
1258 | 231 | } else { | ||
1259 | 232 | return false; | ||
1260 | 233 | } | ||
1261 | 234 | } | ||
1262 | 235 | |||
1263 | 236 | int GSettingsQml::launcherWidth() const | ||
1264 | 237 | { | ||
1265 | 238 | if (m_schema->id() == "com.canonical.Unity8") { | ||
1266 | 239 | return GSettingsControllerQml::instance()->launcherWidth(); | ||
1267 | 240 | } else { | ||
1268 | 241 | return false; | ||
1269 | 242 | } | ||
1270 | 243 | } | ||
1271 | 244 | |||
1272 | 195 | void GSettingsQml::setLifecycleExemptAppids(const QStringList &appIds) | 245 | void GSettingsQml::setLifecycleExemptAppids(const QStringList &appIds) |
1273 | 196 | { | 246 | { |
1274 | 197 | if (m_schema->id() == "com.canonical.qtmir") { | 247 | if (m_schema->id() == "com.canonical.qtmir") { |
1275 | 198 | GSettingsControllerQml::instance()->setLifecycleExemptAppids(appIds); | 248 | GSettingsControllerQml::instance()->setLifecycleExemptAppids(appIds); |
1276 | 199 | } | 249 | } |
1277 | 200 | } | 250 | } |
1278 | 251 | |||
1279 | 252 | void GSettingsQml::setAutohideLauncher(bool autohideLauncher) | ||
1280 | 253 | { | ||
1281 | 254 | if (m_schema->id() == "com.canonical.Unity8") { | ||
1282 | 255 | GSettingsControllerQml::instance()->setAutohideLauncher(autohideLauncher); | ||
1283 | 256 | } | ||
1284 | 257 | } | ||
1285 | 258 | |||
1286 | 259 | void GSettingsQml::setLauncherWidth(int launcherWidth) | ||
1287 | 260 | { | ||
1288 | 261 | if (m_schema->id() == "com.canonical.Unity8") { | ||
1289 | 262 | GSettingsControllerQml::instance()->setLauncherWidth(launcherWidth); | ||
1290 | 263 | } | ||
1291 | 264 | } | ||
1292 | 201 | 265 | ||
1293 | === modified file 'tests/mocks/GSettings.1.0/fake_gsettings.h' | |||
1294 | --- tests/mocks/GSettings.1.0/fake_gsettings.h 2015-09-29 20:19:56 +0000 | |||
1295 | +++ tests/mocks/GSettings.1.0/fake_gsettings.h 2016-03-10 09:37:58 +0000 | |||
1296 | @@ -50,6 +50,8 @@ | |||
1297 | 50 | Q_PROPERTY(QString usageMode READ usageMode WRITE setUsageMode NOTIFY usageModeChanged) | 50 | Q_PROPERTY(QString usageMode READ usageMode WRITE setUsageMode NOTIFY usageModeChanged) |
1298 | 51 | Q_PROPERTY(qint64 lockedOutTime READ lockedOutTime WRITE setLockedOutTime NOTIFY lockedOutTimeChanged) | 51 | Q_PROPERTY(qint64 lockedOutTime READ lockedOutTime WRITE setLockedOutTime NOTIFY lockedOutTimeChanged) |
1299 | 52 | Q_PROPERTY(QStringList lifecycleExemptAppids READ lifecycleExemptAppids WRITE setLifecycleExemptAppids NOTIFY lifecycleExemptAppidsChanged) | 52 | Q_PROPERTY(QStringList lifecycleExemptAppids READ lifecycleExemptAppids WRITE setLifecycleExemptAppids NOTIFY lifecycleExemptAppidsChanged) |
1300 | 53 | Q_PROPERTY(bool autohideLauncher READ autohideLauncher WRITE setAutohideLauncher NOTIFY autohideLauncherChanged) | ||
1301 | 54 | Q_PROPERTY(int launcherWidth READ launcherWidth WRITE setLauncherWidth NOTIFY launcherWidthChanged) | ||
1302 | 53 | 55 | ||
1303 | 54 | public: | 56 | public: |
1304 | 55 | GSettingsQml(QObject *parent = nullptr); | 57 | GSettingsQml(QObject *parent = nullptr); |
1305 | @@ -59,11 +61,15 @@ | |||
1306 | 59 | QString usageMode() const; | 61 | QString usageMode() const; |
1307 | 60 | qint64 lockedOutTime() const; | 62 | qint64 lockedOutTime() const; |
1308 | 61 | QStringList lifecycleExemptAppids() const; | 63 | QStringList lifecycleExemptAppids() const; |
1309 | 64 | bool autohideLauncher() const; | ||
1310 | 65 | int launcherWidth() const; | ||
1311 | 62 | 66 | ||
1312 | 63 | void setPictureUri(const QString &str); | 67 | void setPictureUri(const QString &str); |
1313 | 64 | void setUsageMode(const QString &usageMode); | 68 | void setUsageMode(const QString &usageMode); |
1314 | 65 | void setLockedOutTime(qint64 timestamp); | 69 | void setLockedOutTime(qint64 timestamp); |
1315 | 66 | void setLifecycleExemptAppids(const QStringList &appIds); | 70 | void setLifecycleExemptAppids(const QStringList &appIds); |
1316 | 71 | void setAutohideLauncher(bool autohideLauncher); | ||
1317 | 72 | void setLauncherWidth(int launcherWidth); | ||
1318 | 67 | 73 | ||
1319 | 68 | Q_SIGNALS: | 74 | Q_SIGNALS: |
1320 | 69 | void schemaChanged(); | 75 | void schemaChanged(); |
1321 | @@ -71,6 +77,8 @@ | |||
1322 | 71 | void usageModeChanged(const QString&); | 77 | void usageModeChanged(const QString&); |
1323 | 72 | void lockedOutTimeChanged(qint64); | 78 | void lockedOutTimeChanged(qint64); |
1324 | 73 | void lifecycleExemptAppidsChanged(const QStringList &); | 79 | void lifecycleExemptAppidsChanged(const QStringList &); |
1325 | 80 | void autohideLauncherChanged(bool); | ||
1326 | 81 | void launcherWidthChanged(int launcherWidth); | ||
1327 | 74 | 82 | ||
1328 | 75 | private: | 83 | private: |
1329 | 76 | GSettingsSchemaQml* m_schema; | 84 | GSettingsSchemaQml* m_schema; |
1330 | @@ -98,11 +106,19 @@ | |||
1331 | 98 | QStringList lifecycleExemptAppids() const; | 106 | QStringList lifecycleExemptAppids() const; |
1332 | 99 | Q_INVOKABLE void setLifecycleExemptAppids(const QStringList &appIds); | 107 | Q_INVOKABLE void setLifecycleExemptAppids(const QStringList &appIds); |
1333 | 100 | 108 | ||
1334 | 109 | bool autohideLauncher() const; | ||
1335 | 110 | Q_INVOKABLE void setAutohideLauncher(bool autohideLauncher); | ||
1336 | 111 | |||
1337 | 112 | int launcherWidth() const; | ||
1338 | 113 | Q_INVOKABLE void setLauncherWidth(int launcherWidth); | ||
1339 | 114 | |||
1340 | 101 | Q_SIGNALS: | 115 | Q_SIGNALS: |
1341 | 102 | void pictureUriChanged(const QString&); | 116 | void pictureUriChanged(const QString&); |
1342 | 103 | void usageModeChanged(const QString&); | 117 | void usageModeChanged(const QString&); |
1343 | 104 | void lockedOutTimeChanged(qint64 timestamp); | 118 | void lockedOutTimeChanged(qint64 timestamp); |
1344 | 105 | void lifecycleExemptAppidsChanged(const QStringList&); | 119 | void lifecycleExemptAppidsChanged(const QStringList&); |
1345 | 120 | void autohideLauncherChanged(bool autohideLauncher); | ||
1346 | 121 | void launcherWidthChanged(int launcherWidth); | ||
1347 | 106 | 122 | ||
1348 | 107 | private: | 123 | private: |
1349 | 108 | GSettingsControllerQml(); | 124 | GSettingsControllerQml(); |
1350 | @@ -111,6 +127,8 @@ | |||
1351 | 111 | QString m_usageMode; | 127 | QString m_usageMode; |
1352 | 112 | qint64 m_lockedOutTime; | 128 | qint64 m_lockedOutTime; |
1353 | 113 | QStringList m_lifecycleExemptAppids; | 129 | QStringList m_lifecycleExemptAppids; |
1354 | 130 | bool m_autohideLauncher; | ||
1355 | 131 | int m_launcherWidth; | ||
1356 | 114 | 132 | ||
1357 | 115 | static GSettingsControllerQml* s_controllerInstance; | 133 | static GSettingsControllerQml* s_controllerInstance; |
1358 | 116 | QList<GSettingsQml *> m_registeredGSettings; | 134 | QList<GSettingsQml *> m_registeredGSettings; |
1359 | 117 | 135 | ||
1360 | === modified file 'tests/mocks/Unity/Application/ApplicationManager.cpp' | |||
1361 | --- tests/mocks/Unity/Application/ApplicationManager.cpp 2015-12-03 18:10:39 +0000 | |||
1362 | +++ tests/mocks/Unity/Application/ApplicationManager.cpp 2016-03-10 09:37:58 +0000 | |||
1363 | @@ -345,6 +345,18 @@ | |||
1364 | 345 | m_availableApplications.append(application); | 345 | m_availableApplications.append(application); |
1365 | 346 | 346 | ||
1366 | 347 | application = new ApplicationInfo(this); | 347 | application = new ApplicationInfo(this); |
1367 | 348 | application->setAppId("camera-app2"); | ||
1368 | 349 | application->setName("Camera2"); | ||
1369 | 350 | application->setScreenshotId("camera"); | ||
1370 | 351 | application->setIconId("camera"); | ||
1371 | 352 | application->setSupportedOrientations(Qt::PortraitOrientation | ||
1372 | 353 | | Qt::LandscapeOrientation | ||
1373 | 354 | | Qt::InvertedPortraitOrientation | ||
1374 | 355 | | Qt::InvertedLandscapeOrientation); | ||
1375 | 356 | application->setRotatesWindowContents(true); | ||
1376 | 357 | m_availableApplications.append(application); | ||
1377 | 358 | |||
1378 | 359 | application = new ApplicationInfo(this); | ||
1379 | 348 | application->setAppId("gallery-app"); | 360 | application->setAppId("gallery-app"); |
1380 | 349 | application->setName("Gallery"); | 361 | application->setName("Gallery"); |
1381 | 350 | application->setScreenshotId("gallery"); | 362 | application->setScreenshotId("gallery"); |
1382 | 351 | 363 | ||
1383 | === modified file 'tests/mocks/Unity/Launcher/MockLauncherModel.cpp' | |||
1384 | --- tests/mocks/Unity/Launcher/MockLauncherModel.cpp 2015-11-04 11:29:16 +0000 | |||
1385 | +++ tests/mocks/Unity/Launcher/MockLauncherModel.cpp 2016-03-10 09:37:58 +0000 | |||
1386 | @@ -25,15 +25,20 @@ | |||
1387 | 25 | MockLauncherItem *item = new MockLauncherItem("dialer-app", "/usr/share/applications/dialer-app.desktop", "Dialer", "dialer-app", this); | 25 | MockLauncherItem *item = new MockLauncherItem("dialer-app", "/usr/share/applications/dialer-app.desktop", "Dialer", "dialer-app", this); |
1388 | 26 | item->setProgress(0); | 26 | item->setProgress(0); |
1389 | 27 | item->setPinned(true); | 27 | item->setPinned(true); |
1390 | 28 | item->setRunning(true); | ||
1391 | 28 | item->setFocused(true); | 29 | item->setFocused(true); |
1392 | 29 | m_list.append(item); | 30 | m_list.append(item); |
1393 | 30 | item = new MockLauncherItem("camera-app", "/usr/share/applications/camera-app.desktop", "Camera", "camera", this); | 31 | item = new MockLauncherItem("camera-app", "/usr/share/applications/camera-app.desktop", "Camera", "camera", this); |
1394 | 31 | item->setProgress(10); | 32 | item->setProgress(10); |
1395 | 32 | item->setPinned(true); | 33 | item->setPinned(true); |
1396 | 33 | m_list.append(item); | 34 | m_list.append(item); |
1397 | 35 | item = new MockLauncherItem("camera-app2", "/usr/share/applications/camera-app2.desktop", "Camera2", "camera", this); | ||
1398 | 36 | item->setPinned(true); | ||
1399 | 37 | m_list.append(item); | ||
1400 | 34 | item = new MockLauncherItem("gallery-app", "/usr/share/applications/gallery-app.desktop", "Gallery", "gallery", this); | 38 | item = new MockLauncherItem("gallery-app", "/usr/share/applications/gallery-app.desktop", "Gallery", "gallery", this); |
1401 | 35 | item->setProgress(50); | 39 | item->setProgress(50); |
1402 | 36 | item->setCountVisible(true); | 40 | item->setCountVisible(true); |
1403 | 41 | item->setRunning(true); | ||
1404 | 37 | item->setAlerting(false); | 42 | item->setAlerting(false); |
1405 | 38 | m_list.append(item); | 43 | m_list.append(item); |
1406 | 39 | item = new MockLauncherItem("music-app", "/usr/share/applications/music-app.desktop", "Music", "soundcloud", this); | 44 | item = new MockLauncherItem("music-app", "/usr/share/applications/music-app.desktop", "Music", "soundcloud", this); |
1407 | 40 | 45 | ||
1408 | === modified file 'tests/qmltests/Launcher/tst_Launcher.qml' | |||
1409 | --- tests/qmltests/Launcher/tst_Launcher.qml 2016-01-19 15:36:15 +0000 | |||
1410 | +++ tests/qmltests/Launcher/tst_Launcher.qml 2016-03-10 09:37:58 +0000 | |||
1411 | @@ -28,12 +28,13 @@ | |||
1412 | 28 | launcher. */ | 28 | launcher. */ |
1413 | 29 | Item { | 29 | Item { |
1414 | 30 | id: root | 30 | id: root |
1417 | 31 | width: units.gu(50) | 31 | width: units.gu(140) |
1418 | 32 | height: units.gu(55) | 32 | height: units.gu(70) |
1419 | 33 | 33 | ||
1420 | 34 | Loader { | 34 | Loader { |
1421 | 35 | id: launcherLoader | 35 | id: launcherLoader |
1422 | 36 | anchors.fill: parent | 36 | anchors.fill: parent |
1423 | 37 | focus: true | ||
1424 | 37 | property bool itemDestroyed: false | 38 | property bool itemDestroyed: false |
1425 | 38 | sourceComponent: Component { | 39 | sourceComponent: Component { |
1426 | 39 | Launcher { | 40 | Launcher { |
1427 | @@ -68,6 +69,7 @@ | |||
1428 | 68 | 69 | ||
1429 | 69 | Component.onCompleted: { | 70 | Component.onCompleted: { |
1430 | 70 | launcherLoader.itemDestroyed = false; | 71 | launcherLoader.itemDestroyed = false; |
1431 | 72 | launcherLoader.focus = true | ||
1432 | 71 | edgeBarrierControls.target = testCase.findChild(this, "edgeBarrierController"); | 73 | edgeBarrierControls.target = testCase.findChild(this, "edgeBarrierController"); |
1433 | 72 | } | 74 | } |
1434 | 73 | Component.onDestruction: { | 75 | Component.onDestruction: { |
1435 | @@ -77,11 +79,40 @@ | |||
1436 | 77 | } | 79 | } |
1437 | 78 | } | 80 | } |
1438 | 79 | 81 | ||
1439 | 82 | Binding { | ||
1440 | 83 | target: launcherLoader.item | ||
1441 | 84 | property: "lockedVisible" | ||
1442 | 85 | value: lockedVisibleCheckBox.checked | ||
1443 | 86 | } | ||
1444 | 87 | Binding { | ||
1445 | 88 | target: launcherLoader.item | ||
1446 | 89 | property: "panelWidth" | ||
1447 | 90 | value: units.gu(Math.round(widthSlider.value)) | ||
1448 | 91 | } | ||
1449 | 92 | |||
1450 | 80 | ColumnLayout { | 93 | ColumnLayout { |
1451 | 81 | anchors { bottom: parent.bottom; right: parent.right; margins: units.gu(1) } | 94 | anchors { bottom: parent.bottom; right: parent.right; margins: units.gu(1) } |
1452 | 82 | spacing: units.gu(1) | 95 | spacing: units.gu(1) |
1453 | 83 | width: childrenRect.width | 96 | width: childrenRect.width |
1454 | 84 | 97 | ||
1455 | 98 | RowLayout { | ||
1456 | 99 | CheckBox { | ||
1457 | 100 | id: lockedVisibleCheckBox | ||
1458 | 101 | checked: false | ||
1459 | 102 | } | ||
1460 | 103 | Label { | ||
1461 | 104 | text: "Launcher always visible" | ||
1462 | 105 | } | ||
1463 | 106 | } | ||
1464 | 107 | |||
1465 | 108 | Slider { | ||
1466 | 109 | id: widthSlider | ||
1467 | 110 | Layout.fillWidth: true | ||
1468 | 111 | minimumValue: 6 | ||
1469 | 112 | maximumValue: 12 | ||
1470 | 113 | value: 10 | ||
1471 | 114 | } | ||
1472 | 115 | |||
1473 | 85 | MouseTouchEmulationCheckbox {} | 116 | MouseTouchEmulationCheckbox {} |
1474 | 86 | 117 | ||
1475 | 87 | EdgeBarrierControls { | 118 | EdgeBarrierControls { |
1476 | @@ -102,6 +133,15 @@ | |||
1477 | 102 | Layout.fillWidth: true | 133 | Layout.fillWidth: true |
1478 | 103 | } | 134 | } |
1479 | 104 | 135 | ||
1480 | 136 | Button { | ||
1481 | 137 | text: "open for kbd navigation" | ||
1482 | 138 | onClicked: { | ||
1483 | 139 | launcherLoader.item.openForKeyboardNavigation() | ||
1484 | 140 | launcherLoader.item.forceActiveFocus();// = true | ||
1485 | 141 | } | ||
1486 | 142 | Layout.fillWidth: true | ||
1487 | 143 | } | ||
1488 | 144 | |||
1489 | 105 | Row { | 145 | Row { |
1490 | 106 | spacing: units.gu(1) | 146 | spacing: units.gu(1) |
1491 | 107 | 147 | ||
1492 | @@ -206,10 +246,6 @@ | |||
1493 | 206 | // growing while populating it with icons etc. | 246 | // growing while populating it with icons etc. |
1494 | 207 | tryCompare(listView, "flicking", false); | 247 | tryCompare(listView, "flicking", false); |
1495 | 208 | 248 | ||
1496 | 209 | // Make sure noone changed the height of the window. The issue this test case | ||
1497 | 210 | // is verifying only happens on certain heights of the Launcher | ||
1498 | 211 | compare(root.height, units.gu(55)); | ||
1499 | 212 | |||
1500 | 213 | compare(listView.contentY, -listView.topMargin, "Launcher did not start up with first item unfolded"); | 249 | compare(listView.contentY, -listView.topMargin, "Launcher did not start up with first item unfolded"); |
1501 | 214 | 250 | ||
1502 | 215 | // Now do check that snapping is in fact enabled | 251 | // Now do check that snapping is in fact enabled |
1503 | @@ -266,13 +302,32 @@ | |||
1504 | 266 | 302 | ||
1505 | 267 | function positionLauncherListAtBeginning() { | 303 | function positionLauncherListAtBeginning() { |
1506 | 268 | var listView = testCase.findChild(launcherLoader.item, "launcherListView"); | 304 | var listView = testCase.findChild(launcherLoader.item, "launcherListView"); |
1508 | 269 | listView.contentY = -listView.topMargin; | 305 | var moveAnimation = findInvisibleChild(listView, "moveAnimation") |
1509 | 306 | |||
1510 | 307 | listView.moveToIndex(0); | ||
1511 | 308 | |||
1512 | 309 | waitForRendering(listView); | ||
1513 | 310 | tryCompare(moveAnimation, "running", false); | ||
1514 | 270 | } | 311 | } |
1515 | 271 | function positionLauncherListAtEnd() { | 312 | function positionLauncherListAtEnd() { |
1516 | 272 | var listView = testCase.findChild(launcherLoader.item, "launcherListView"); | 313 | var listView = testCase.findChild(launcherLoader.item, "launcherListView"); |
1520 | 273 | if ((listView.contentHeight + listView.topMargin + listView.bottomMargin) > listView.height) { | 314 | var moveAnimation = findInvisibleChild(listView, "moveAnimation") |
1521 | 274 | listView.contentY = listView.topMargin + listView.contentHeight | 315 | |
1522 | 275 | - listView.height; | 316 | listView.moveToIndex(listView.count -1); |
1523 | 317 | |||
1524 | 318 | waitForRendering(listView); | ||
1525 | 319 | tryCompare(moveAnimation, "running", false); | ||
1526 | 320 | } | ||
1527 | 321 | |||
1528 | 322 | function assertFocusOnIndex(index) { | ||
1529 | 323 | var launcherListView = findChild(launcher, "launcherListView"); | ||
1530 | 324 | var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight"); | ||
1531 | 325 | |||
1532 | 326 | waitForRendering(launcher); | ||
1533 | 327 | compare(bfbFocusHighlight.visible, index === -1); | ||
1534 | 328 | for (var i = 0; i < launcherListView.count; i++) { | ||
1535 | 329 | var focusRing = findChild(findChild(launcher, "launcherDelegate" + i), "focusRing") | ||
1536 | 330 | compare(focusRing.visible, index === i); | ||
1537 | 276 | } | 331 | } |
1538 | 277 | } | 332 | } |
1539 | 278 | 333 | ||
1540 | @@ -290,10 +345,10 @@ | |||
1541 | 290 | dragLauncherIntoView() | 345 | dragLauncherIntoView() |
1542 | 291 | 346 | ||
1543 | 292 | // tapping on the center of the screen should dismiss the launcher | 347 | // tapping on the center of the screen should dismiss the launcher |
1545 | 293 | mouseClick(launcher) | 348 | mouseClick(launcher, panel.width + units.gu(5), launcher.height / 2) |
1546 | 294 | 349 | ||
1547 | 295 | // should eventually get fully retracted (hidden) | 350 | // should eventually get fully retracted (hidden) |
1549 | 296 | tryCompare(panel, "x", -launcher.panelWidth, 1000) | 351 | tryCompare(panel, "x", -launcher.panelWidth, 2000) |
1550 | 297 | } | 352 | } |
1551 | 298 | 353 | ||
1552 | 299 | /* If I click on the icon of an application on the launcher | 354 | /* If I click on the icon of an application on the launcher |
1553 | @@ -377,6 +432,7 @@ | |||
1554 | 377 | wait(100) | 432 | wait(100) |
1555 | 378 | compare(launcher.maxPanelX, -launcher.panelWidth, "Launcher moved even if it shouldn't") | 433 | compare(launcher.maxPanelX, -launcher.panelWidth, "Launcher moved even if it shouldn't") |
1556 | 379 | } | 434 | } |
1557 | 435 | |||
1558 | 380 | waitUntilLauncherDisappears(); | 436 | waitUntilLauncherDisappears(); |
1559 | 381 | launcher.available = true; | 437 | launcher.available = true; |
1560 | 382 | } | 438 | } |
1561 | @@ -400,6 +456,8 @@ | |||
1562 | 400 | dragLauncherIntoView(); | 456 | dragLauncherIntoView(); |
1563 | 401 | var launcherListView = findChild(launcher, "launcherListView"); | 457 | var launcherListView = findChild(launcher, "launcherListView"); |
1564 | 402 | for (var i = 0; i < launcherListView.count; ++i) { | 458 | for (var i = 0; i < launcherListView.count; ++i) { |
1565 | 459 | launcherListView.moveToIndex(i); | ||
1566 | 460 | waitForRendering(launcherListView); | ||
1567 | 403 | var delegate = findChild(launcherListView, "launcherDelegate" + i) | 461 | var delegate = findChild(launcherListView, "launcherDelegate" + i) |
1568 | 404 | compare(findChild(delegate, "countEmblem").visible, LauncherModel.get(i).countVisible) | 462 | compare(findChild(delegate, "countEmblem").visible, LauncherModel.get(i).countVisible) |
1569 | 405 | // Intentionally allow type coercion (string/number) | 463 | // Intentionally allow type coercion (string/number) |
1570 | @@ -421,7 +479,7 @@ | |||
1571 | 421 | var launcherListView = findChild(launcher, "launcherListView"); | 479 | var launcherListView = findChild(launcher, "launcherListView"); |
1572 | 422 | for (var i = 0; i < launcherListView.count; ++i) { | 480 | for (var i = 0; i < launcherListView.count; ++i) { |
1573 | 423 | var delegate = findChild(launcherListView, "launcherDelegate" + i) | 481 | var delegate = findChild(launcherListView, "launcherDelegate" + i) |
1575 | 424 | compare(findChild(delegate, "runningHighlight").visible, LauncherModel.get(i).running) | 482 | compare(findChild(delegate, "runningHighlight0").visible, LauncherModel.get(i).running) |
1576 | 425 | } | 483 | } |
1577 | 426 | } | 484 | } |
1578 | 427 | 485 | ||
1579 | @@ -460,6 +518,7 @@ | |||
1580 | 460 | launcher.lastSelectedApplication = ""; | 518 | launcher.lastSelectedApplication = ""; |
1581 | 461 | dragLauncherIntoView(); | 519 | dragLauncherIntoView(); |
1582 | 462 | var listView = findChild(launcher, "launcherListView"); | 520 | var listView = findChild(launcher, "launcherListView"); |
1583 | 521 | var moveAnimation = findInvisibleChild(listView, "moveAnimation") | ||
1584 | 463 | 522 | ||
1585 | 464 | // flicking is unreliable. sometimes it works, sometimes the | 523 | // flicking is unreliable. sometimes it works, sometimes the |
1586 | 465 | // list view moves just a tiny bit or not at all, making tests fail. | 524 | // list view moves just a tiny bit or not at all, making tests fail. |
1587 | @@ -470,12 +529,14 @@ | |||
1588 | 470 | } else { | 529 | } else { |
1589 | 471 | positionLauncherListAtEnd(); | 530 | positionLauncherListAtEnd(); |
1590 | 472 | } | 531 | } |
1591 | 473 | tryCompare(listView, "flicking", false); | ||
1592 | 474 | |||
1593 | 475 | var oldY = listView.contentY; | 532 | var oldY = listView.contentY; |
1594 | 476 | 533 | ||
1595 | 477 | mouseClick(listView, listView.width / 2, data.clickY); | 534 | mouseClick(listView, listView.width / 2, data.clickY); |
1597 | 478 | tryCompare(listView, "flicking", false); | 535 | |
1598 | 536 | if (data.expectFlick) { | ||
1599 | 537 | tryCompare(moveAnimation, "running", true); | ||
1600 | 538 | } | ||
1601 | 539 | tryCompare(moveAnimation, "running", false); | ||
1602 | 479 | 540 | ||
1603 | 480 | if (data.expectFlick) { | 541 | if (data.expectFlick) { |
1604 | 481 | verify(listView.contentY != oldY); | 542 | verify(listView.contentY != oldY); |
1605 | @@ -764,14 +825,15 @@ | |||
1606 | 764 | function test_launcher_dismiss() { | 825 | function test_launcher_dismiss() { |
1607 | 765 | dragLauncherIntoView(); | 826 | dragLauncherIntoView(); |
1608 | 766 | verify(launcher.state == "visible"); | 827 | verify(launcher.state == "visible"); |
1610 | 767 | mouseClick(root); | 828 | |
1611 | 829 | mouseClick(root, root.width / 2, units.gu(1)); | ||
1612 | 768 | waitUntilLauncherDisappears(); | 830 | waitUntilLauncherDisappears(); |
1613 | 769 | verify(launcher.state == ""); | 831 | verify(launcher.state == ""); |
1614 | 770 | 832 | ||
1615 | 771 | // and repeat, as a test for regression in lpbug#1531339 | 833 | // and repeat, as a test for regression in lpbug#1531339 |
1616 | 772 | dragLauncherIntoView(); | 834 | dragLauncherIntoView(); |
1617 | 773 | verify(launcher.state == "visible"); | 835 | verify(launcher.state == "visible"); |
1619 | 774 | mouseClick(root); | 836 | mouseClick(root, root.width / 2, units.gu(1)); |
1620 | 775 | waitUntilLauncherDisappears(); | 837 | waitUntilLauncherDisappears(); |
1621 | 776 | verify(launcher.state == ""); | 838 | verify(launcher.state == ""); |
1622 | 777 | } | 839 | } |
1623 | @@ -1044,5 +1106,169 @@ | |||
1624 | 1044 | LauncherModel.setCountVisible(LauncherModel.get(1).appId, 0) | 1106 | LauncherModel.setCountVisible(LauncherModel.get(1).appId, 0) |
1625 | 1045 | LauncherModel.setCount(LauncherModel.get(1).appId, oldCount) | 1107 | LauncherModel.setCount(LauncherModel.get(1).appId, oldCount) |
1626 | 1046 | } | 1108 | } |
1627 | 1109 | |||
1628 | 1110 | function test_longpressSuperKeyShowsHints() { | ||
1629 | 1111 | var shortCutHint0 = findChild(findChild(launcher, "launcherDelegate0"), "shortcutHint"); | ||
1630 | 1112 | |||
1631 | 1113 | tryCompare(shortCutHint0, "visible", false); | ||
1632 | 1114 | |||
1633 | 1115 | launcher.superPressed = true; | ||
1634 | 1116 | tryCompare(launcher, "state", "visible"); | ||
1635 | 1117 | tryCompare(shortCutHint0, "visible", true); | ||
1636 | 1118 | |||
1637 | 1119 | launcher.superPressed = false; | ||
1638 | 1120 | tryCompare(launcher, "state", ""); | ||
1639 | 1121 | tryCompare(shortCutHint0, "visible", false); | ||
1640 | 1122 | } | ||
1641 | 1123 | |||
1642 | 1124 | function test_keyboardNavigation() { | ||
1643 | 1125 | var bfbFocusHighlight = findChild(launcher, "bfbFocusHighlight"); | ||
1644 | 1126 | var quickList = findChild(launcher, "quickList"); | ||
1645 | 1127 | var launcherPanel = findChild(launcher, "launcherPanel"); | ||
1646 | 1128 | var launcherListView = findChild(launcher, "launcherListView"); | ||
1647 | 1129 | var last = launcherListView.count - 1; | ||
1648 | 1130 | |||
1649 | 1131 | compare(bfbFocusHighlight.visible, false); | ||
1650 | 1132 | |||
1651 | 1133 | launcher.openForKeyboardNavigation(); | ||
1652 | 1134 | tryCompare(launcherPanel, "x", 0); | ||
1653 | 1135 | waitForRendering(launcher); | ||
1654 | 1136 | |||
1655 | 1137 | assertFocusOnIndex(-1); | ||
1656 | 1138 | |||
1657 | 1139 | // Down should go down | ||
1658 | 1140 | keyClick(Qt.Key_Down); | ||
1659 | 1141 | assertFocusOnIndex(0); | ||
1660 | 1142 | |||
1661 | 1143 | // Tab should go down | ||
1662 | 1144 | keyClick(Qt.Key_Tab); | ||
1663 | 1145 | assertFocusOnIndex(1); | ||
1664 | 1146 | |||
1665 | 1147 | // Up should go up | ||
1666 | 1148 | keyClick(Qt.Key_Up); | ||
1667 | 1149 | assertFocusOnIndex(0); | ||
1668 | 1150 | |||
1669 | 1151 | // Backtab should go up | ||
1670 | 1152 | keyClick(Qt.Key_Backtab); | ||
1671 | 1153 | assertFocusOnIndex(-1); // BFB | ||
1672 | 1154 | |||
1673 | 1155 | // The list should wrap around | ||
1674 | 1156 | keyClick(Qt.Key_Up); | ||
1675 | 1157 | assertFocusOnIndex(last); | ||
1676 | 1158 | |||
1677 | 1159 | keyClick(Qt.Key_Down); | ||
1678 | 1160 | waitForRendering(launcher); | ||
1679 | 1161 | keyClick(Qt.Key_Down); | ||
1680 | 1162 | assertFocusOnIndex(0); // Back to Top | ||
1681 | 1163 | |||
1682 | 1164 | // Right opens the quicklist | ||
1683 | 1165 | keyClick(Qt.Key_Right); | ||
1684 | 1166 | assertFocusOnIndex(0); // Navigating the quicklist... the launcher focus should not move | ||
1685 | 1167 | tryCompare(quickList, "visible", true); | ||
1686 | 1168 | tryCompare(quickList, "selectedIndex", 0) | ||
1687 | 1169 | |||
1688 | 1170 | // Down should move down the quicklist | ||
1689 | 1171 | keyClick(Qt.Key_Down); | ||
1690 | 1172 | tryCompare(quickList, "selectedIndex", 1) | ||
1691 | 1173 | |||
1692 | 1174 | // The quicklist should wrap around too | ||
1693 | 1175 | keyClick(Qt.Key_Down); | ||
1694 | 1176 | keyClick(Qt.Key_Down); | ||
1695 | 1177 | keyClick(Qt.Key_Down); | ||
1696 | 1178 | tryCompare(quickList, "selectedIndex", 0) | ||
1697 | 1179 | |||
1698 | 1180 | // Left gets us back to the launcher | ||
1699 | 1181 | keyClick(Qt.Key_Left); | ||
1700 | 1182 | assertFocusOnIndex(0); | ||
1701 | 1183 | tryCompare(quickList, "visible", false); | ||
1702 | 1184 | |||
1703 | 1185 | // Launcher navigation should still work | ||
1704 | 1186 | // Go bar to top by wrapping around | ||
1705 | 1187 | keyClick(Qt.Key_Down); | ||
1706 | 1188 | assertFocusOnIndex(1); | ||
1707 | 1189 | } | ||
1708 | 1190 | |||
1709 | 1191 | function test_selectQuicklistItemByKeyboard() { | ||
1710 | 1192 | launcher.openForKeyboardNavigation(); | ||
1711 | 1193 | waitForRendering(launcher); | ||
1712 | 1194 | |||
1713 | 1195 | signalSpy.clear(); | ||
1714 | 1196 | signalSpy.signalName = "quickListTriggered" | ||
1715 | 1197 | |||
1716 | 1198 | keyClick(Qt.Key_Down); // Down to launcher item 0 | ||
1717 | 1199 | keyClick(Qt.Key_Down); // Down to launcher item 1 | ||
1718 | 1200 | keyClick(Qt.Key_Right); // Into quicklist | ||
1719 | 1201 | keyClick(Qt.Key_Down); // Down to quicklist item 1 | ||
1720 | 1202 | keyClick(Qt.Key_Down); // Down to quicklist item 2 | ||
1721 | 1203 | keyClick(Qt.Key_Enter); // Trigger it | ||
1722 | 1204 | |||
1723 | 1205 | compare(signalSpy.count, 1, "Quicklist signal wasn't triggered") | ||
1724 | 1206 | compare(signalSpy.signalArguments[0][0], LauncherModel.get(1).appId) | ||
1725 | 1207 | compare(signalSpy.signalArguments[0][1], 2) | ||
1726 | 1208 | assertFocusOnIndex(-2); | ||
1727 | 1209 | } | ||
1728 | 1210 | |||
1729 | 1211 | function test_hideNotWorkingWhenLockedOut_data() { | ||
1730 | 1212 | return [ | ||
1731 | 1213 | {tag: "locked visible", locked: true}, | ||
1732 | 1214 | {tag: "no locked visible", locked: false}, | ||
1733 | 1215 | ] | ||
1734 | 1216 | } | ||
1735 | 1217 | |||
1736 | 1218 | function test_hideNotWorkingWhenLockedOut(data) { | ||
1737 | 1219 | launcher.lockedVisible = data.locked; | ||
1738 | 1220 | if (data.locked) { | ||
1739 | 1221 | tryCompare(launcher, "state", "visible"); | ||
1740 | 1222 | } else { | ||
1741 | 1223 | tryCompare(launcher, "state", ""); | ||
1742 | 1224 | } | ||
1743 | 1225 | |||
1744 | 1226 | launcher.hide(); | ||
1745 | 1227 | waitForRendering(launcher); | ||
1746 | 1228 | if (data.locked) { | ||
1747 | 1229 | verify(launcher.state == "visible"); | ||
1748 | 1230 | } else { | ||
1749 | 1231 | verify(launcher.state == ""); | ||
1750 | 1232 | } | ||
1751 | 1233 | } | ||
1752 | 1234 | |||
1753 | 1235 | function test_cancelKbdNavigationWitMouse_data() { | ||
1754 | 1236 | return [ | ||
1755 | 1237 | {tag: "locked out - no quicklist", autohide: false, withQuickList: false }, | ||
1756 | 1238 | {tag: "locked out - with quicklist", autohide: false, withQuickList: true }, | ||
1757 | 1239 | {tag: "autohide - no quicklist", autohide: true, withQuickList: false }, | ||
1758 | 1240 | {tag: "autohide - with quicklist", autohide: true, withQuickList: true }, | ||
1759 | 1241 | ] | ||
1760 | 1242 | } | ||
1761 | 1243 | |||
1762 | 1244 | function test_cancelKbdNavigationWitMouse(data) { | ||
1763 | 1245 | launcher.autohideEnabled = data.autohide; | ||
1764 | 1246 | launcher.openForKeyboardNavigation(); | ||
1765 | 1247 | waitForRendering(launcher); | ||
1766 | 1248 | |||
1767 | 1249 | var launcherPanel = findChild(launcher, "launcherPanel"); | ||
1768 | 1250 | tryCompare(launcherPanel, "x", 0); | ||
1769 | 1251 | |||
1770 | 1252 | var quickList = findChild(launcher, "quickList"); | ||
1771 | 1253 | |||
1772 | 1254 | keyClick(Qt.Key_Down); // Down to launcher item 0 | ||
1773 | 1255 | keyClick(Qt.Key_Down); // Down to launcher item 1 | ||
1774 | 1256 | |||
1775 | 1257 | if (data.withQuickList) { | ||
1776 | 1258 | keyClick(Qt.Key_Right); // Into quicklist | ||
1777 | 1259 | tryCompare(quickList, "visible", true) | ||
1778 | 1260 | } | ||
1779 | 1261 | waitForRendering(launcher) | ||
1780 | 1262 | |||
1781 | 1263 | mouseClick(root); | ||
1782 | 1264 | |||
1783 | 1265 | if (data.autohide) { | ||
1784 | 1266 | tryCompare(launcher, "state", ""); | ||
1785 | 1267 | } else { | ||
1786 | 1268 | tryCompare(launcher, "state", "visible"); | ||
1787 | 1269 | } | ||
1788 | 1270 | |||
1789 | 1271 | assertFocusOnIndex(-2); | ||
1790 | 1272 | } | ||
1791 | 1047 | } | 1273 | } |
1792 | 1048 | } | 1274 | } |
1793 | 1049 | 1275 | ||
1794 | === modified file 'tests/qmltests/tst_OrientedShell.qml' | |||
1795 | --- tests/qmltests/tst_OrientedShell.qml 2016-01-28 11:31:48 +0000 | |||
1796 | +++ tests/qmltests/tst_OrientedShell.qml 2016-03-10 09:37:58 +0000 | |||
1797 | @@ -26,6 +26,7 @@ | |||
1798 | 26 | import Unity.InputInfo 0.1 | 26 | import Unity.InputInfo 0.1 |
1799 | 27 | 27 | ||
1800 | 28 | import "../../qml" | 28 | import "../../qml" |
1801 | 29 | import "Stages" | ||
1802 | 29 | 30 | ||
1803 | 30 | Rectangle { | 31 | Rectangle { |
1804 | 31 | id: root | 32 | id: root |
1805 | @@ -406,6 +407,8 @@ | |||
1806 | 406 | } | 407 | } |
1807 | 407 | } | 408 | } |
1808 | 408 | } | 409 | } |
1809 | 410 | |||
1810 | 411 | SurfaceManagerControls { textColor: "white" } | ||
1811 | 409 | } | 412 | } |
1812 | 410 | } | 413 | } |
1813 | 411 | 414 | ||
1814 | @@ -551,8 +554,11 @@ | |||
1815 | 551 | function test_appRotatesWindowContents_data() { | 554 | function test_appRotatesWindowContents_data() { |
1816 | 552 | return [ | 555 | return [ |
1817 | 553 | {tag: "mako", deviceName: "mako", orientationAngleAfterRotation: 90}, | 556 | {tag: "mako", deviceName: "mako", orientationAngleAfterRotation: 90}, |
1818 | 557 | {tag: "mako_windowed", deviceName: "mako", orientationAngleAfterRotation: 90, windowed: true}, | ||
1819 | 554 | {tag: "manta", deviceName: "manta", orientationAngleAfterRotation: 90}, | 558 | {tag: "manta", deviceName: "manta", orientationAngleAfterRotation: 90}, |
1821 | 555 | {tag: "flo", deviceName: "flo", orientationAngleAfterRotation: 180} | 559 | {tag: "manta_windowed", deviceName: "manta", orientationAngleAfterRotation: 90, windowed: true}, |
1822 | 560 | {tag: "flo", deviceName: "flo", orientationAngleAfterRotation: 180}, | ||
1823 | 561 | {tag: "flo_windowed", deviceName: "flo", orientationAngleAfterRotation: 180, windowed: true} | ||
1824 | 556 | ]; | 562 | ]; |
1825 | 557 | } | 563 | } |
1826 | 558 | function test_appRotatesWindowContents(data) { | 564 | function test_appRotatesWindowContents(data) { |
1827 | @@ -560,6 +566,12 @@ | |||
1828 | 560 | var cameraApp = ApplicationManager.startApplication("camera-app"); | 566 | var cameraApp = ApplicationManager.startApplication("camera-app"); |
1829 | 561 | verify(cameraApp); | 567 | verify(cameraApp); |
1830 | 562 | 568 | ||
1831 | 569 | if (data.windowed) { | ||
1832 | 570 | usageModeSelector.selectWindowed(); | ||
1833 | 571 | } else { | ||
1834 | 572 | usageModeSelector.selectStaged(); | ||
1835 | 573 | } | ||
1836 | 574 | |||
1837 | 563 | // ensure the mock camera-app is as we expect | 575 | // ensure the mock camera-app is as we expect |
1838 | 564 | compare(cameraApp.fullscreen, true); | 576 | compare(cameraApp.fullscreen, true); |
1839 | 565 | compare(cameraApp.rotatesWindowContents, true); | 577 | compare(cameraApp.rotatesWindowContents, true); |
1840 | 566 | 578 | ||
1841 | === modified file 'tests/qmltests/tst_Shell.qml' | |||
1842 | --- tests/qmltests/tst_Shell.qml 2016-02-12 00:11:28 +0000 | |||
1843 | +++ tests/qmltests/tst_Shell.qml 2016-03-10 09:37:58 +0000 | |||
1844 | @@ -26,6 +26,7 @@ | |||
1845 | 26 | import Unity.Connectivity 0.1 | 26 | import Unity.Connectivity 0.1 |
1846 | 27 | import Unity.Indicators 0.1 | 27 | import Unity.Indicators 0.1 |
1847 | 28 | import Unity.Notifications 1.0 | 28 | import Unity.Notifications 1.0 |
1848 | 29 | import Unity.Launcher 0.1 | ||
1849 | 29 | import Unity.Test 0.1 | 30 | import Unity.Test 0.1 |
1850 | 30 | import Powerd 0.1 | 31 | import Powerd 0.1 |
1851 | 31 | import Wizard 0.1 as Wizard | 32 | import Wizard 0.1 as Wizard |
1852 | @@ -121,10 +122,6 @@ | |||
1853 | 121 | Component.onDestruction: { | 122 | Component.onDestruction: { |
1854 | 122 | shellLoader.itemDestroyed = true; | 123 | shellLoader.itemDestroyed = true; |
1855 | 123 | } | 124 | } |
1856 | 124 | Component.onCompleted: { | ||
1857 | 125 | var keyMapper = testCase.findChild(__shell, "physicalKeysMapper"); | ||
1858 | 126 | keyMapper.controlInsteadOfAlt = true; | ||
1859 | 127 | } | ||
1860 | 128 | } | 125 | } |
1861 | 129 | } | 126 | } |
1862 | 130 | } | 127 | } |
1863 | @@ -213,6 +210,31 @@ | |||
1864 | 213 | checked: true | 210 | checked: true |
1865 | 214 | color: "white" | 211 | color: "white" |
1866 | 215 | } | 212 | } |
1867 | 213 | ListItem.ItemSelector { | ||
1868 | 214 | id: ctrlModifier | ||
1869 | 215 | anchors { left: parent.left; right: parent.right } | ||
1870 | 216 | activeFocusOnPress: false | ||
1871 | 217 | text: "Ctrl key as" | ||
1872 | 218 | model: ["Ctrl", "Alt", "Super"] | ||
1873 | 219 | onSelectedIndexChanged: { | ||
1874 | 220 | var keyMapper = testCase.findChild(shellContainer, "physicalKeysMapper"); | ||
1875 | 221 | keyMapper.controlInsteadOfAlt = selectedIndex == 1; | ||
1876 | 222 | keyMapper.controlInsteadOfSuper = selectedIndex == 2; | ||
1877 | 223 | } | ||
1878 | 224 | } | ||
1879 | 225 | |||
1880 | 226 | Row { | ||
1881 | 227 | anchors { left: parent.left; right: parent.right } | ||
1882 | 228 | CheckBox { | ||
1883 | 229 | id: autohideLauncherCheckbox | ||
1884 | 230 | onCheckedChanged: { | ||
1885 | 231 | GSettingsController.setAutohideLauncher(checked) | ||
1886 | 232 | } | ||
1887 | 233 | } | ||
1888 | 234 | Label { | ||
1889 | 235 | text: "Autohide launcher" | ||
1890 | 236 | } | ||
1891 | 237 | } | ||
1892 | 216 | 238 | ||
1893 | 217 | Label { text: "Applications"; font.bold: true } | 239 | Label { text: "Applications"; font.bold: true } |
1894 | 218 | 240 | ||
1895 | @@ -912,6 +934,7 @@ | |||
1896 | 912 | function dragLauncherIntoView() { | 934 | function dragLauncherIntoView() { |
1897 | 913 | var launcher = findChild(shell, "launcher"); | 935 | var launcher = findChild(shell, "launcher"); |
1898 | 914 | var launcherPanel = findChild(launcher, "launcherPanel"); | 936 | var launcherPanel = findChild(launcher, "launcherPanel"); |
1899 | 937 | waitForRendering(launcher); | ||
1900 | 915 | verify(launcherPanel.x = - launcherPanel.width); | 938 | verify(launcherPanel.x = - launcherPanel.width); |
1901 | 916 | 939 | ||
1902 | 917 | var touchStartX = 2; | 940 | var touchStartX = 2; |
1903 | @@ -1441,7 +1464,7 @@ | |||
1904 | 1441 | 1464 | ||
1905 | 1442 | // Do a quick alt-tab and see if focus changes | 1465 | // Do a quick alt-tab and see if focus changes |
1906 | 1443 | tryCompare(app3.session.lastSurface, "activeFocus", true) | 1466 | tryCompare(app3.session.lastSurface, "activeFocus", true) |
1908 | 1444 | keyClick(Qt.Key_Tab, Qt.ControlModifier) | 1467 | keyClick(Qt.Key_Tab, Qt.AltModifier) |
1909 | 1445 | tryCompare(app2.session.lastSurface, "activeFocus", true) | 1468 | tryCompare(app2.session.lastSurface, "activeFocus", true) |
1910 | 1446 | 1469 | ||
1911 | 1447 | var desktopSpread = findChild(shell, "spread") | 1470 | var desktopSpread = findChild(shell, "spread") |
1912 | @@ -1449,12 +1472,12 @@ | |||
1913 | 1449 | tryCompare(desktopSpread, "state", "") | 1472 | tryCompare(desktopSpread, "state", "") |
1914 | 1450 | 1473 | ||
1915 | 1451 | // Just press Alt, make sure the spread comes up | 1474 | // Just press Alt, make sure the spread comes up |
1917 | 1452 | keyPress(Qt.Key_Control); | 1475 | keyPress(Qt.Key_Alt); |
1918 | 1453 | keyClick(Qt.Key_Tab); | 1476 | keyClick(Qt.Key_Tab); |
1919 | 1454 | tryCompare(desktopSpread, "state", "altTab") | 1477 | tryCompare(desktopSpread, "state", "altTab") |
1920 | 1455 | 1478 | ||
1921 | 1456 | // Release control, check if spread disappears | 1479 | // Release control, check if spread disappears |
1923 | 1457 | keyRelease(Qt.Key_Control) | 1480 | keyRelease(Qt.Key_Alt) |
1924 | 1458 | tryCompare(desktopSpread, "state", "") | 1481 | tryCompare(desktopSpread, "state", "") |
1925 | 1459 | 1482 | ||
1926 | 1460 | // Focus should have switched back now | 1483 | // Focus should have switched back now |
1927 | @@ -1482,7 +1505,7 @@ | |||
1928 | 1482 | tryCompare(desktopSpread, "state", "") | 1505 | tryCompare(desktopSpread, "state", "") |
1929 | 1483 | 1506 | ||
1930 | 1484 | // Just press Alt, make sure the spread comes up | 1507 | // Just press Alt, make sure the spread comes up |
1932 | 1485 | keyPress(Qt.Key_Control); | 1508 | keyPress(Qt.Key_Alt); |
1933 | 1486 | keyClick(Qt.Key_Tab); | 1509 | keyClick(Qt.Key_Tab); |
1934 | 1487 | tryCompare(desktopSpread, "state", "altTab") | 1510 | tryCompare(desktopSpread, "state", "altTab") |
1935 | 1488 | tryCompare(spreadRepeater, "highlightedIndex", 1) | 1511 | tryCompare(spreadRepeater, "highlightedIndex", 1) |
1936 | @@ -1503,7 +1526,7 @@ | |||
1937 | 1503 | tryCompare(spreadRepeater, "highlightedIndex", 0) | 1526 | tryCompare(spreadRepeater, "highlightedIndex", 0) |
1938 | 1504 | 1527 | ||
1939 | 1505 | // Release control, check if spread disappears | 1528 | // Release control, check if spread disappears |
1941 | 1506 | keyRelease(Qt.Key_Control) | 1529 | keyRelease(Qt.Key_Alt) |
1942 | 1507 | tryCompare(desktopSpread, "state", "") | 1530 | tryCompare(desktopSpread, "state", "") |
1943 | 1508 | 1531 | ||
1944 | 1509 | // Make sure that after wrapping around once, we have the same one focused as at the beginning | 1532 | // Make sure that after wrapping around once, we have the same one focused as at the beginning |
1945 | @@ -1516,7 +1539,7 @@ | |||
1946 | 1516 | var spreadRepeater = findInvisibleChild(shell, "spreadRepeater"); | 1539 | var spreadRepeater = findInvisibleChild(shell, "spreadRepeater"); |
1947 | 1517 | verify(spreadRepeater !== null); | 1540 | verify(spreadRepeater !== null); |
1948 | 1518 | 1541 | ||
1950 | 1519 | keyPress(Qt.Key_Control) | 1542 | keyPress(Qt.Key_Alt) |
1951 | 1520 | keyClick(Qt.Key_Tab); | 1543 | keyClick(Qt.Key_Tab); |
1952 | 1521 | tryCompare(spreadRepeater, "highlightedIndex", 1); | 1544 | tryCompare(spreadRepeater, "highlightedIndex", 1); |
1953 | 1522 | 1545 | ||
1954 | @@ -1538,7 +1561,7 @@ | |||
1955 | 1538 | keyClick(Qt.Key_Backtab); | 1561 | keyClick(Qt.Key_Backtab); |
1956 | 1539 | tryCompare(spreadRepeater, "highlightedIndex", 1); | 1562 | tryCompare(spreadRepeater, "highlightedIndex", 1); |
1957 | 1540 | 1563 | ||
1959 | 1541 | keyRelease(Qt.Key_Control); | 1564 | keyRelease(Qt.Key_Alt); |
1960 | 1542 | } | 1565 | } |
1961 | 1543 | 1566 | ||
1962 | 1544 | function test_highlightFollowsMouse() { | 1567 | function test_highlightFollowsMouse() { |
1963 | @@ -1547,7 +1570,7 @@ | |||
1964 | 1547 | var spreadRepeater = findInvisibleChild(shell, "spreadRepeater"); | 1570 | var spreadRepeater = findInvisibleChild(shell, "spreadRepeater"); |
1965 | 1548 | verify(spreadRepeater !== null); | 1571 | verify(spreadRepeater !== null); |
1966 | 1549 | 1572 | ||
1968 | 1550 | keyPress(Qt.Key_Control) | 1573 | keyPress(Qt.Key_Alt) |
1969 | 1551 | keyClick(Qt.Key_Tab); | 1574 | keyClick(Qt.Key_Tab); |
1970 | 1552 | 1575 | ||
1971 | 1553 | tryCompare(spreadRepeater, "highlightedIndex", 1); | 1576 | tryCompare(spreadRepeater, "highlightedIndex", 1); |
1972 | @@ -1566,7 +1589,7 @@ | |||
1973 | 1566 | 1589 | ||
1974 | 1567 | verify(y < 4000); | 1590 | verify(y < 4000); |
1975 | 1568 | 1591 | ||
1977 | 1569 | keyRelease(Qt.Key_Control); | 1592 | keyRelease(Qt.Key_Alt); |
1978 | 1570 | } | 1593 | } |
1979 | 1571 | 1594 | ||
1980 | 1572 | function test_closeFromSpread() { | 1595 | function test_closeFromSpread() { |
1981 | @@ -1575,7 +1598,7 @@ | |||
1982 | 1575 | var spreadRepeater = findInvisibleChild(shell, "spreadRepeater"); | 1598 | var spreadRepeater = findInvisibleChild(shell, "spreadRepeater"); |
1983 | 1576 | verify(spreadRepeater !== null); | 1599 | verify(spreadRepeater !== null); |
1984 | 1577 | 1600 | ||
1986 | 1578 | keyPress(Qt.Key_Control) | 1601 | keyPress(Qt.Key_Alt) |
1987 | 1579 | keyClick(Qt.Key_Tab); | 1602 | keyClick(Qt.Key_Tab); |
1988 | 1580 | 1603 | ||
1989 | 1581 | appRemovedSpy.clear(); | 1604 | appRemovedSpy.clear(); |
1990 | @@ -1602,7 +1625,7 @@ | |||
1991 | 1602 | tryCompare(appRemovedSpy, "count", 1) | 1625 | tryCompare(appRemovedSpy, "count", 1) |
1992 | 1603 | compare(appRemovedSpy.signalArguments[0][0], closedAppId); | 1626 | compare(appRemovedSpy.signalArguments[0][0], closedAppId); |
1993 | 1604 | 1627 | ||
1995 | 1605 | keyRelease(Qt.Key_Control); | 1628 | keyRelease(Qt.Key_Alt); |
1996 | 1606 | } | 1629 | } |
1997 | 1607 | 1630 | ||
1998 | 1608 | function test_selectFromSpreadWithMouse_data() { | 1631 | function test_selectFromSpreadWithMouse_data() { |
1999 | @@ -1622,7 +1645,7 @@ | |||
2000 | 1622 | var spreadRepeater = findInvisibleChild(shell, "spreadRepeater"); | 1645 | var spreadRepeater = findInvisibleChild(shell, "spreadRepeater"); |
2001 | 1623 | verify(spreadRepeater !== null); | 1646 | verify(spreadRepeater !== null); |
2002 | 1624 | 1647 | ||
2004 | 1625 | keyPress(Qt.Key_Control) | 1648 | keyPress(Qt.Key_Alt) |
2005 | 1626 | keyClick(Qt.Key_Tab); | 1649 | keyClick(Qt.Key_Tab); |
2006 | 1627 | 1650 | ||
2007 | 1628 | var focusAppId = ApplicationManager.get(2).appId; | 1651 | var focusAppId = ApplicationManager.get(2).appId; |
2008 | @@ -1649,7 +1672,7 @@ | |||
2009 | 1649 | tryCompare(stage, "state", ""); | 1672 | tryCompare(stage, "state", ""); |
2010 | 1650 | tryCompare(ApplicationManager, "focusedApplicationId", focusAppId); | 1673 | tryCompare(ApplicationManager, "focusedApplicationId", focusAppId); |
2011 | 1651 | 1674 | ||
2013 | 1652 | keyRelease(Qt.Key_Control); | 1675 | keyRelease(Qt.Key_Alt); |
2014 | 1653 | } | 1676 | } |
2015 | 1654 | 1677 | ||
2016 | 1655 | function test_progressiveAutoScrolling() { | 1678 | function test_progressiveAutoScrolling() { |
2017 | @@ -1658,7 +1681,7 @@ | |||
2018 | 1658 | var appRepeater = findInvisibleChild(shell, "appRepeater"); | 1681 | var appRepeater = findInvisibleChild(shell, "appRepeater"); |
2019 | 1659 | verify(appRepeater !== null); | 1682 | verify(appRepeater !== null); |
2020 | 1660 | 1683 | ||
2022 | 1661 | keyPress(Qt.Key_Control) | 1684 | keyPress(Qt.Key_Alt) |
2023 | 1662 | keyClick(Qt.Key_Tab); | 1685 | keyClick(Qt.Key_Tab); |
2024 | 1663 | 1686 | ||
2025 | 1664 | var spreadFlickable = findChild(shell, "spreadFlickable") | 1687 | var spreadFlickable = findChild(shell, "spreadFlickable") |
2026 | @@ -1669,7 +1692,7 @@ | |||
2027 | 1669 | var x = 0; | 1692 | var x = 0; |
2028 | 1670 | var y = shell.height * .5 | 1693 | var y = shell.height * .5 |
2029 | 1671 | mouseMove(shell, x, y) | 1694 | mouseMove(shell, x, y) |
2031 | 1672 | while (x <= spreadFlickable.width) { | 1695 | while (x <= shell.width) { |
2032 | 1673 | x+=10; | 1696 | x+=10; |
2033 | 1674 | mouseMove(shell, x, y) | 1697 | mouseMove(shell, x, y) |
2034 | 1675 | wait(0); // spin the loop so bindings get evaluated | 1698 | wait(0); // spin the loop so bindings get evaluated |
2035 | @@ -1684,7 +1707,7 @@ | |||
2036 | 1684 | } | 1707 | } |
2037 | 1685 | tryCompare(spreadFlickable, "contentX", 0); | 1708 | tryCompare(spreadFlickable, "contentX", 0); |
2038 | 1686 | 1709 | ||
2040 | 1687 | keyRelease(Qt.Key_Control); | 1710 | keyRelease(Qt.Key_Alt); |
2041 | 1688 | } | 1711 | } |
2042 | 1689 | 1712 | ||
2043 | 1690 | // This makes sure the hoverMouseArea is set to invisible AND disabled | 1713 | // This makes sure the hoverMouseArea is set to invisible AND disabled |
2044 | @@ -1696,13 +1719,13 @@ | |||
2045 | 1696 | tryCompare(hoverMouseArea, "enabled", false) | 1719 | tryCompare(hoverMouseArea, "enabled", false) |
2046 | 1697 | tryCompare(hoverMouseArea, "visible", false) | 1720 | tryCompare(hoverMouseArea, "visible", false) |
2047 | 1698 | 1721 | ||
2049 | 1699 | keyPress(Qt.Key_Control) | 1722 | keyPress(Qt.Key_Alt) |
2050 | 1700 | keyClick(Qt.Key_Tab); | 1723 | keyClick(Qt.Key_Tab); |
2051 | 1701 | 1724 | ||
2052 | 1702 | tryCompare(hoverMouseArea, "enabled", true) | 1725 | tryCompare(hoverMouseArea, "enabled", true) |
2053 | 1703 | tryCompare(hoverMouseArea, "visible", true) | 1726 | tryCompare(hoverMouseArea, "visible", true) |
2054 | 1704 | 1727 | ||
2056 | 1705 | keyRelease(Qt.Key_Control) | 1728 | keyRelease(Qt.Key_Alt) |
2057 | 1706 | 1729 | ||
2058 | 1707 | tryCompare(hoverMouseArea, "enabled", false) | 1730 | tryCompare(hoverMouseArea, "enabled", false) |
2059 | 1708 | tryCompare(hoverMouseArea, "visible", false) | 1731 | tryCompare(hoverMouseArea, "visible", false) |
2060 | @@ -1719,7 +1742,7 @@ | |||
2061 | 1719 | var appRepeater = findInvisibleChild(shell, "appRepeater"); | 1742 | var appRepeater = findInvisibleChild(shell, "appRepeater"); |
2062 | 1720 | verify(appRepeater !== null); | 1743 | verify(appRepeater !== null); |
2063 | 1721 | 1744 | ||
2065 | 1722 | keyPress(Qt.Key_Control) | 1745 | keyPress(Qt.Key_Alt) |
2066 | 1723 | keyClick(Qt.Key_Tab); | 1746 | keyClick(Qt.Key_Tab); |
2067 | 1724 | 1747 | ||
2068 | 1725 | tryCompare(spreadRepeater, "highlightedIndex", 1); | 1748 | tryCompare(spreadRepeater, "highlightedIndex", 1); |
2069 | @@ -1740,33 +1763,46 @@ | |||
2070 | 1740 | 1763 | ||
2071 | 1741 | verify(y < 4000); | 1764 | verify(y < 4000); |
2072 | 1742 | 1765 | ||
2077 | 1743 | keyRelease(Qt.Key_Control); | 1766 | keyRelease(Qt.Key_Alt); |
2078 | 1744 | } | 1767 | } |
2079 | 1745 | 1768 | ||
2080 | 1746 | function test_focusAppFromLauncherExitsSpread() { | 1769 | function test_focusAppFromLauncherExitsSpread_data() { |
2081 | 1770 | return [ | ||
2082 | 1771 | {tag: "autohide launcher", launcherLocked: false }, | ||
2083 | 1772 | {tag: "locked launcher", launcherLocked: true } | ||
2084 | 1773 | ] | ||
2085 | 1774 | } | ||
2086 | 1775 | |||
2087 | 1776 | function test_focusAppFromLauncherExitsSpread(data) { | ||
2088 | 1747 | loadDesktopShellWithApps() | 1777 | loadDesktopShellWithApps() |
2090 | 1748 | 1778 | var launcher = findChild(shell, "launcher"); | |
2091 | 1749 | var desktopSpread = findChild(shell, "spread"); | 1779 | var desktopSpread = findChild(shell, "spread"); |
2092 | 1750 | var launcher = findChild(shell, "launcher"); | ||
2093 | 1751 | var bfb = findChild(launcher, "buttonShowDashHome"); | 1780 | var bfb = findChild(launcher, "buttonShowDashHome"); |
2094 | 1752 | 1781 | ||
2096 | 1753 | keyPress(Qt.Key_Control) | 1782 | GSettingsController.setAutohideLauncher(!data.launcherLocked); |
2097 | 1783 | waitForRendering(shell); | ||
2098 | 1784 | |||
2099 | 1785 | keyPress(Qt.Key_Alt) | ||
2100 | 1754 | keyClick(Qt.Key_Tab); | 1786 | keyClick(Qt.Key_Tab); |
2101 | 1755 | 1787 | ||
2102 | 1756 | tryCompare(desktopSpread, "state", "altTab") | 1788 | tryCompare(desktopSpread, "state", "altTab") |
2103 | 1757 | 1789 | ||
2108 | 1758 | revealLauncherByEdgePushWithMouse(); | 1790 | if (!data.launcherLocked) { |
2109 | 1759 | tryCompare(launcher, "x", 0); | 1791 | revealLauncherByEdgePushWithMouse(); |
2110 | 1760 | mouseMove(bfb, bfb.width / 2, bfb.height / 2) | 1792 | tryCompare(launcher, "x", 0); |
2111 | 1761 | waitForRendering(shell) | 1793 | mouseMove(bfb, bfb.width / 2, bfb.height / 2) |
2112 | 1794 | waitForRendering(shell) | ||
2113 | 1795 | } | ||
2114 | 1762 | 1796 | ||
2115 | 1763 | mouseClick(bfb, bfb.width / 2, bfb.height / 2) | 1797 | mouseClick(bfb, bfb.width / 2, bfb.height / 2) |
2117 | 1764 | tryCompare(launcher, "state", "") | 1798 | if (!data.launcherLocked) { |
2118 | 1799 | tryCompare(launcher, "state", "") | ||
2119 | 1800 | } | ||
2120 | 1765 | tryCompare(desktopSpread, "state", "") | 1801 | tryCompare(desktopSpread, "state", "") |
2121 | 1766 | 1802 | ||
2122 | 1767 | tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash") | 1803 | tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash") |
2123 | 1768 | 1804 | ||
2125 | 1769 | keyRelease(Qt.Key_Control); | 1805 | keyRelease(Qt.Key_Alt); |
2126 | 1770 | } | 1806 | } |
2127 | 1771 | 1807 | ||
2128 | 1772 | // regression test for http://pad.lv/1443319 | 1808 | // regression test for http://pad.lv/1443319 |
2129 | @@ -1989,6 +2025,138 @@ | |||
2130 | 1989 | } | 2025 | } |
2131 | 1990 | } | 2026 | } |
2132 | 1991 | 2027 | ||
2133 | 2028 | function test_superTabToCycleLauncher_data() { | ||
2134 | 2029 | return [ | ||
2135 | 2030 | {tag: "autohide launcher", launcherLocked: false}, | ||
2136 | 2031 | {tag: "locked launcher", launcherLocked: true} | ||
2137 | 2032 | ] | ||
2138 | 2033 | } | ||
2139 | 2034 | |||
2140 | 2035 | function test_superTabToCycleLauncher(data) { | ||
2141 | 2036 | loadShell("desktop"); | ||
2142 | 2037 | shell.usageScenario = "desktop"; | ||
2143 | 2038 | GSettingsController.setAutohideLauncher(!data.launcherLocked); | ||
2144 | 2039 | waitForRendering(shell); | ||
2145 | 2040 | |||
2146 | 2041 | var launcher = findChild(shell, "launcher"); | ||
2147 | 2042 | var launcherPanel = findChild(launcher, "launcherPanel"); | ||
2148 | 2043 | var firstAppInLauncher = LauncherModel.get(0).appId; | ||
2149 | 2044 | |||
2150 | 2045 | compare(launcher.state, data.launcherLocked ? "visible": ""); | ||
2151 | 2046 | compare(launcherPanel.highlightIndex, -2); | ||
2152 | 2047 | compare(ApplicationManager.focusedApplicationId, "unity8-dash"); | ||
2153 | 2048 | |||
2154 | 2049 | // Use Super + Tab Tab to cycle to the first entry in the launcher | ||
2155 | 2050 | keyPress(Qt.Key_Super_L, Qt.MetaModifier); | ||
2156 | 2051 | keyClick(Qt.Key_Tab); | ||
2157 | 2052 | tryCompare(launcher, "state", "visible"); | ||
2158 | 2053 | tryCompare(launcherPanel, "highlightIndex", -1); | ||
2159 | 2054 | keyClick(Qt.Key_Tab); | ||
2160 | 2055 | tryCompare(launcherPanel, "highlightIndex", 0); | ||
2161 | 2056 | keyRelease(Qt.Key_Super_L, Qt.MetaModifier); | ||
2162 | 2057 | tryCompare(launcher, "state", data.launcherLocked ? "visible" : ""); | ||
2163 | 2058 | tryCompare(launcherPanel, "highlightIndex", -2); | ||
2164 | 2059 | tryCompare(ApplicationManager, "focusedApplicationId", firstAppInLauncher); | ||
2165 | 2060 | |||
2166 | 2061 | // Now go back to the dash | ||
2167 | 2062 | keyPress(Qt.Key_Super_L, Qt.MetaModifier); | ||
2168 | 2063 | keyClick(Qt.Key_Tab); | ||
2169 | 2064 | tryCompare(launcher, "state", "visible"); | ||
2170 | 2065 | tryCompare(launcherPanel, "highlightIndex", -1); | ||
2171 | 2066 | keyRelease(Qt.Key_Super_L, Qt.MetaModifier); | ||
2172 | 2067 | tryCompare(launcher, "state", data.launcherLocked ? "visible" : ""); | ||
2173 | 2068 | tryCompare(launcherPanel, "highlightIndex", -2); | ||
2174 | 2069 | tryCompare(ApplicationManager, "focusedApplicationId", "unity8-dash"); | ||
2175 | 2070 | } | ||
2176 | 2071 | |||
2177 | 2072 | function test_longpressSuperOpensLauncher() { | ||
2178 | 2073 | loadShell("desktop"); | ||
2179 | 2074 | var launcher = findChild(shell, "launcher"); | ||
2180 | 2075 | var shortcutHint = findChild(findChild(launcher, "launcherDelegate0"), "shortcutHint") | ||
2181 | 2076 | |||
2182 | 2077 | compare(launcher.state, ""); | ||
2183 | 2078 | keyPress(Qt.Key_Super_L, Qt.MetaModifier); | ||
2184 | 2079 | tryCompare(launcher, "state", "visible"); | ||
2185 | 2080 | tryCompare(shortcutHint, "visible", true); | ||
2186 | 2081 | |||
2187 | 2082 | keyRelease(Qt.Key_Super_L, Qt.MetaModifier); | ||
2188 | 2083 | tryCompare(launcher, "state", ""); | ||
2189 | 2084 | tryCompare(shortcutHint, "visible", false); | ||
2190 | 2085 | } | ||
2191 | 2086 | |||
2192 | 2087 | function test_metaNumberLaunchesFromLauncher_data() { | ||
2193 | 2088 | return [ | ||
2194 | 2089 | {tag: "Meta+1", key: Qt.Key_1, index: 0}, | ||
2195 | 2090 | {tag: "Meta+2", key: Qt.Key_2, index: 1}, | ||
2196 | 2091 | {tag: "Meta+4", key: Qt.Key_5, index: 4}, | ||
2197 | 2092 | {tag: "Meta+0", key: Qt.Key_0, index: 9}, | ||
2198 | 2093 | ] | ||
2199 | 2094 | } | ||
2200 | 2095 | |||
2201 | 2096 | function test_metaNumberLaunchesFromLauncher(data) { | ||
2202 | 2097 | loadShell("desktop"); | ||
2203 | 2098 | var launcher = findChild(shell, "launcher"); | ||
2204 | 2099 | var appId = LauncherModel.get(data.index).appId; | ||
2205 | 2100 | waitForRendering(shell); | ||
2206 | 2101 | |||
2207 | 2102 | keyClick(data.key, Qt.MetaModifier); | ||
2208 | 2103 | tryCompare(ApplicationManager, "focusedApplicationId", appId); | ||
2209 | 2104 | } | ||
2210 | 2105 | |||
2211 | 2106 | function test_altF1OpensLauncherForKeyboardNavigation() { | ||
2212 | 2107 | loadShell("desktop"); | ||
2213 | 2108 | waitForRendering(shell); | ||
2214 | 2109 | var launcher = findChild(shell, "launcher"); | ||
2215 | 2110 | |||
2216 | 2111 | keyClick(Qt.Key_F1, Qt.AltModifier); | ||
2217 | 2112 | tryCompare(launcher, "state", "visible"); | ||
2218 | 2113 | tryCompare(launcher, "focus", true) | ||
2219 | 2114 | } | ||
2220 | 2115 | |||
2221 | 2116 | function test_lockedOutLauncherAddsMarginsToMaximized() { | ||
2222 | 2117 | loadShell("desktop"); | ||
2223 | 2118 | shell.usageScenario = "desktop"; | ||
2224 | 2119 | waitForRendering(shell); | ||
2225 | 2120 | var appContainer = findChild(shell, "appContainer"); | ||
2226 | 2121 | var launcher = findChild(shell, "launcher"); | ||
2227 | 2122 | |||
2228 | 2123 | var app = ApplicationManager.startApplication("music-app"); | ||
2229 | 2124 | waitUntilAppWindowIsFullyLoaded(app); | ||
2230 | 2125 | var appDelegate = findChild(appContainer, "appDelegate_music-app"); | ||
2231 | 2126 | appDelegate.maximize(); | ||
2232 | 2127 | tryCompare(appDelegate, "visuallyMaximized", true); | ||
2233 | 2128 | waitForRendering(shell); | ||
2234 | 2129 | |||
2235 | 2130 | GSettingsController.setAutohideLauncher(true); | ||
2236 | 2131 | waitForRendering(shell) | ||
2237 | 2132 | var hiddenSize = appDelegate.width; | ||
2238 | 2133 | |||
2239 | 2134 | GSettingsController.setAutohideLauncher(false); | ||
2240 | 2135 | waitForRendering(shell) | ||
2241 | 2136 | var shownSize = appDelegate.width; | ||
2242 | 2137 | |||
2243 | 2138 | compare(shownSize + launcher.panelWidth, hiddenSize); | ||
2244 | 2139 | } | ||
2245 | 2140 | |||
2246 | 2141 | function test_fullscreenAppHidesLockedOutLauncher() { | ||
2247 | 2142 | loadShell("desktop"); | ||
2248 | 2143 | shell.usageScenario = "desktop"; | ||
2249 | 2144 | |||
2250 | 2145 | var launcher = findChild(shell, "launcher"); | ||
2251 | 2146 | var launcherPanel = findChild(launcher, "launcherPanel"); | ||
2252 | 2147 | |||
2253 | 2148 | GSettingsController.setAutohideLauncher(false); | ||
2254 | 2149 | waitForRendering(shell) | ||
2255 | 2150 | |||
2256 | 2151 | tryCompare(launcher, "lockedVisible", true); | ||
2257 | 2152 | |||
2258 | 2153 | var cameraApp = ApplicationManager.startApplication("camera-app"); | ||
2259 | 2154 | waitUntilAppWindowIsFullyLoaded(cameraApp); | ||
2260 | 2155 | |||
2261 | 2156 | tryCompare(launcher, "lockedVisible", false); | ||
2262 | 2157 | } | ||
2263 | 2158 | |||
2264 | 2159 | |||
2265 | 1992 | function test_inputEventsOnEdgesEndUpInAppSurface_data() { | 2160 | function test_inputEventsOnEdgesEndUpInAppSurface_data() { |
2266 | 1993 | return [ | 2161 | return [ |
2267 | 1994 | { tag: "phone", repeaterName: "spreadRepeater" }, | 2162 | { tag: "phone", repeaterName: "spreadRepeater" }, |
PASSED: Continuous integration, rev:2205 /unity8- jenkins. ubuntu. com/job/ lp-unity8- 1-ci/481/ /unity8- jenkins. ubuntu. com/job/ build/643 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= vivid+overlay/ 209 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= xenial/ 209 /unity8- jenkins. ubuntu. com/job/ build-0- fetch/666 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= vivid+overlay/ 684 /unity8- jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 684 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 680 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= vivid+overlay/ 680/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial/ 680 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial/ 680/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 680 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= vivid+overlay/ 680/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial/ 680 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial/ 680/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 680 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= vivid+overlay/ 680/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial/ 680 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial/ 680/artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: 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:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-unity8- 1-ci/481/ rebuild
https:/