Merge lp:~nick-dedekind/unity8/menus.local.global into lp:unity8
- menus.local.global
- Merge into trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp:~nick-dedekind/unity8/menus.local.global |
Merge into: | lp:unity8 |
Prerequisite: | lp:~nick-dedekind/unity8/menu.overflow |
Diff against target: |
733 lines (+234/-111) 13 files modified
data/com.canonical.Unity8.gschema.xml (+5/-0) qml/Panel/Panel.qml (+96/-57) qml/Panel/PanelBar.qml (+1/-2) qml/Panel/PanelItemRow.qml (+8/-28) qml/Panel/PanelMenu.qml (+2/-3) qml/Shell.qml (+4/-1) qml/Stage/DecoratedWindow.qml (+6/-4) qml/Stage/Stage.qml (+2/-0) tests/mocks/GSettings.1.0/fake_gsettings.cpp (+33/-0) tests/mocks/GSettings.1.0/fake_gsettings.h (+9/-0) tests/qmltests/Panel/tst_Panel.qml (+53/-15) tests/qmltests/Stage/tst_DesktopStage.qml (+1/-0) tests/qmltests/tst_Shell.qml (+14/-1) |
To merge this branch: | bzr merge lp:~nick-dedekind/unity8/menus.local.global |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Lukáš Tinkl (community) | Needs Fixing | ||
Unity8 CI Bot | continuous-integration | Approve | |
Review via email: mp+315556@code.launchpad.net |
Commit message
Added global menu support.
Description of the change
* Are there any related MPs required for this MP to build/function as expected? Please list.
No
* Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
* 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?
No. need to confirm defualt for global/LIM option.
- 2785. By Nick Dedekind
-
merged with parent
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2785
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Albert Astals Cid (aacid) wrote : | # |
Text conflict in data/com.
Text conflict in plugins/
Text conflict in plugins/
Text conflict in qml/Stage/
Text conflict in tests/mocks/
Text conflict in tests/mocks/
Text conflict in tests/mocks/
Text conflict in tests/mocks/
Text conflict in tests/qmltests/
9 conflicts encountered.
- 2786. By Nick Dedekind
-
merged with parent
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:2786
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 2787. By Nick Dedekind
-
fixed tests
Unity8 CI Bot (unity8-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:2787
https:/
Executed test runs:
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 : | # |
Just a couple of minor issues inline, otherwise the code looks good; haven't tested yet
Albert Astals Cid (aacid) wrote : | # |
Text conflict in qml/Stage/Stage.qml
1 conflicts encountered
Albert Astals Cid (aacid) wrote : | # |
A month without merging → WiP
Unmerged revisions
- 2787. By Nick Dedekind
-
fixed tests
- 2786. By Nick Dedekind
-
merged with parent
- 2785. By Nick Dedekind
-
merged with parent
- 2784. By Nick Dedekind
-
shader for long title names
- 2783. By Nick Dedekind
-
fixed animation duration
- 2782. By Nick Dedekind
-
merged with parent
- 2781. By Nick Dedekind
-
Global/LI Menus
- 2780. By Nick Dedekind
-
merged with parent
- 2779. By Nick Dedekind
-
global menus
Preview Diff
1 | === modified file 'data/com.canonical.Unity8.gschema.xml' | |||
2 | --- data/com.canonical.Unity8.gschema.xml 2016-12-10 14:06:18 +0000 | |||
3 | +++ data/com.canonical.Unity8.gschema.xml 2017-01-26 14:02:24 +0000 | |||
4 | @@ -58,6 +58,11 @@ | |||
5 | 58 | <summary>The uri to the app store</summary> | 58 | <summary>The uri to the app store</summary> |
6 | 59 | <description>This will be used whenever the user triggers an action to open the app store.</description> | 59 | <description>This will be used whenever the user triggers an action to open the app store.</description> |
7 | 60 | </key> | 60 | </key> |
8 | 61 | <key type="b" name="enable-global-menus"> | ||
9 | 62 | <default>true</default> | ||
10 | 63 | <summary>Enable/disable global application menus.</summary> | ||
11 | 64 | <description>When this is enabled, the application menus will always be shown in the top panel. Otherwise they will appear in the window decoration.</description> | ||
12 | 65 | </key> | ||
13 | 61 | </schema> | 66 | </schema> |
14 | 62 | 67 | ||
15 | 63 | <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8"> | 68 | <schema path="/com/canonical/unity8/greeter/" id="com.canonical.Unity8.Greeter" gettext-domain="unity8"> |
16 | 64 | 69 | ||
17 | === modified file 'qml/Panel/Panel.qml' | |||
18 | --- qml/Panel/Panel.qml 2017-01-26 14:02:23 +0000 | |||
19 | +++ qml/Panel/Panel.qml 2017-01-26 14:02:24 +0000 | |||
20 | @@ -1,4 +1,4 @@ | |||
22 | 1 | /* | 1 | /* |
23 | 2 | * Copyright (C) 2013-2016 Canonical, Ltd. | 2 | * Copyright (C) 2013-2016 Canonical, Ltd. |
24 | 3 | * | 3 | * |
25 | 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
26 | @@ -15,6 +15,7 @@ | |||
27 | 15 | */ | 15 | */ |
28 | 16 | 16 | ||
29 | 17 | import QtQuick 2.4 | 17 | import QtQuick 2.4 |
30 | 18 | import QtGraphicalEffects 1.0 | ||
31 | 18 | import Ubuntu.Components 1.3 | 19 | import Ubuntu.Components 1.3 |
32 | 19 | import Ubuntu.Layouts 1.0 | 20 | import Ubuntu.Layouts 1.0 |
33 | 20 | import Unity.Application 0.1 | 21 | import Unity.Application 0.1 |
34 | @@ -41,6 +42,7 @@ | |||
35 | 41 | property real expandedPanelHeight: units.gu(7) | 42 | property real expandedPanelHeight: units.gu(7) |
36 | 42 | property real indicatorMenuWidth: width | 43 | property real indicatorMenuWidth: width |
37 | 43 | property real applicationMenuWidth: width | 44 | property real applicationMenuWidth: width |
38 | 45 | property bool globalMenus: true | ||
39 | 44 | 46 | ||
40 | 45 | property alias applicationMenus: __applicationMenus | 47 | property alias applicationMenus: __applicationMenus |
41 | 46 | property alias indicators: __indicators | 48 | property alias indicators: __indicators |
42 | @@ -87,7 +89,9 @@ | |||
43 | 87 | PanelState.decorationsAlwaysVisible | 89 | PanelState.decorationsAlwaysVisible |
44 | 88 | 90 | ||
45 | 89 | property bool showPointerMenu: revealControls && | 91 | property bool showPointerMenu: revealControls && |
47 | 90 | (PanelState.decorationsVisible || mode == "staged") | 92 | (PanelState.decorationsVisible || root.globalMenus || mode == "staged") |
48 | 93 | |||
49 | 94 | property bool showPointerMenuApplicationTitle: showPointerMenu && !showWindowDecorationControls | ||
50 | 91 | 95 | ||
51 | 92 | property bool enablePointerMenu: revealControls && | 96 | property bool enablePointerMenu: revealControls && |
52 | 93 | applicationMenus.available && | 97 | applicationMenus.available && |
53 | @@ -178,59 +182,95 @@ | |||
54 | 178 | } | 182 | } |
55 | 179 | } | 183 | } |
56 | 180 | 184 | ||
77 | 181 | Row { | 185 | WindowControlButtons { |
78 | 182 | anchors.fill: parent | 186 | id: windowControlButtons |
79 | 183 | spacing: units.gu(2) | 187 | objectName: "panelWindowControlButtons" |
80 | 184 | 188 | height: parent.height | |
81 | 185 | // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/ | 189 | |
82 | 186 | // cf. https://bugreports.qt.io/browse/QTBUG-32909 | 190 | opacity: d.showWindowDecorationControls ? 1 : 0 |
83 | 187 | WindowControlButtons { | 191 | visible: opacity !== 0 |
84 | 188 | id: windowControlButtons | 192 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
85 | 189 | objectName: "panelWindowControlButtons" | 193 | |
86 | 190 | height: indicators.minimizedPanelHeight | 194 | active: PanelState.decorationsVisible || PanelState.decorationsAlwaysVisible |
87 | 191 | opacity: d.showWindowDecorationControls ? 1 : 0 | 195 | windowIsMaximized: true |
88 | 192 | visible: opacity != 0 | 196 | onCloseClicked: PanelState.closeClicked() |
89 | 193 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } | 197 | onMinimizeClicked: PanelState.minimizeClicked() |
90 | 194 | 198 | onMaximizeClicked: PanelState.restoreClicked() | |
91 | 195 | active: PanelState.decorationsVisible || PanelState.decorationsAlwaysVisible | 199 | closeButtonShown: PanelState.closeButtonShown |
92 | 196 | windowIsMaximized: true | 200 | } |
93 | 197 | onCloseClicked: PanelState.closeClicked() | 201 | |
94 | 198 | onMinimizeClicked: PanelState.minimizeClicked() | 202 | Label { |
95 | 199 | onMaximizeClicked: PanelState.restoreClicked() | 203 | id: titleLabel |
96 | 200 | closeButtonShown: PanelState.closeButtonShown | 204 | anchors.verticalCenter: parent.verticalCenter |
97 | 205 | anchors.left: parent.left | ||
98 | 206 | anchors.leftMargin: units.gu(1) | ||
99 | 207 | |||
100 | 208 | maximumLineCount: 1 | ||
101 | 209 | fontSize: "medium" | ||
102 | 210 | font.weight: Font.Medium | ||
103 | 211 | text: PanelState.title | ||
104 | 212 | visible: false | ||
105 | 213 | } | ||
106 | 214 | |||
107 | 215 | LinearGradient { | ||
108 | 216 | id: titleGradient | ||
109 | 217 | objectName: "panelTitle" | ||
110 | 218 | width: titleLabel.width | ||
111 | 219 | height: titleLabel.height | ||
112 | 220 | anchors.verticalCenter: parent.verticalCenter | ||
113 | 221 | anchors.left: parent.left | ||
114 | 222 | anchors.leftMargin: units.gu(1) | ||
115 | 223 | |||
116 | 224 | source: titleLabel | ||
117 | 225 | gradient: Gradient { | ||
118 | 226 | GradientStop { position: 0; color: theme.palette.selected.backgroundText } | ||
119 | 227 | GradientStop { position: 0.7; color: theme.palette.selected.backgroundText } | ||
120 | 228 | GradientStop { position: 1; color: "transparent" } | ||
121 | 201 | } | 229 | } |
154 | 202 | 230 | start: Qt.point(0, 0) | |
155 | 203 | Loader { | 231 | end: Qt.point(endpoint, 0) |
156 | 204 | id: menuBarLoader | 232 | |
157 | 205 | height: parent.height | 233 | property real endpoint: d.showPointerMenuApplicationTitle ? menuBarLoader.anchors.leftMargin : |
158 | 206 | enabled: d.enablePointerMenu | 234 | parent.width - __indicators.barWidth |
159 | 207 | opacity: d.showPointerMenu ? 1 : 0 | 235 | |
160 | 208 | visible: opacity != 0 | 236 | opacity: d.showTouchMenu || d.showPointerMenuApplicationTitle ? 1 : 0 |
161 | 209 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } | 237 | visible: opacity !== 0 |
162 | 210 | active: __applicationMenus.model | 238 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
163 | 211 | 239 | } | |
164 | 212 | width: parent.width - windowControlButtons.width - units.gu(2) - __indicators.barWidth | 240 | |
165 | 213 | 241 | Loader { | |
166 | 214 | property bool menusRequested: menuBarLoader.item ? menuBarLoader.item.showRequested : false | 242 | id: menuBarLoader |
167 | 215 | 243 | anchors.left: parent.left | |
168 | 216 | sourceComponent: MenuBar { | 244 | anchors.leftMargin: d.showPointerMenuApplicationTitle ? units.gu(8) : (windowControlButtons.width + units.gu(2)) |
169 | 217 | id: bar | 245 | height: parent.height |
170 | 218 | objectName: "menuBar" | 246 | enabled: d.enablePointerMenu |
171 | 219 | anchors.left: parent.left | 247 | active: __applicationMenus.model |
172 | 220 | anchors.margins: units.gu(1) | 248 | |
173 | 221 | height: menuBarLoader.height | 249 | opacity: d.showPointerMenu ? 1 : 0 |
174 | 222 | enableKeyFilter: valid && PanelState.decorationsVisible | 250 | visible: opacity !== 0 |
175 | 223 | unityMenuModel: __applicationMenus.model | 251 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
176 | 224 | 252 | ||
177 | 225 | Connections { | 253 | width: parent.width - anchors.leftMargin - __indicators.barWidth |
178 | 226 | target: __applicationMenus | 254 | |
179 | 227 | onShownChanged: bar.dismiss(); | 255 | property bool menusRequested: menuBarLoader.item ? menuBarLoader.item.showRequested : false |
180 | 228 | } | 256 | |
181 | 229 | 257 | sourceComponent: MenuBar { | |
182 | 230 | Connections { | 258 | id: bar |
183 | 231 | target: __indicators | 259 | objectName: "menuBar" |
184 | 232 | onShownChanged: bar.dismiss(); | 260 | anchors.left: parent.left |
185 | 233 | } | 261 | anchors.margins: units.gu(1) |
186 | 262 | height: menuBarLoader.height | ||
187 | 263 | enableKeyFilter: valid && PanelState.decorationsVisible | ||
188 | 264 | unityMenuModel: __applicationMenus.model | ||
189 | 265 | |||
190 | 266 | Connections { | ||
191 | 267 | target: __applicationMenus | ||
192 | 268 | onShownChanged: bar.dismiss(); | ||
193 | 269 | } | ||
194 | 270 | |||
195 | 271 | Connections { | ||
196 | 272 | target: __indicators | ||
197 | 273 | onShownChanged: bar.dismiss(); | ||
198 | 234 | } | 274 | } |
199 | 235 | } | 275 | } |
200 | 236 | } | 276 | } |
201 | @@ -259,6 +299,7 @@ | |||
202 | 259 | enableHint: !callHint.active && !fullscreenMode | 299 | enableHint: !callHint.active && !fullscreenMode |
203 | 260 | showOnClick: false | 300 | showOnClick: false |
204 | 261 | panelColor: panelAreaBackground.color | 301 | panelColor: panelAreaBackground.color |
205 | 302 | barWidth: Math.max(titleLabel.width, units.gu(10)) | ||
206 | 262 | 303 | ||
207 | 263 | onShowTapped: { | 304 | onShowTapped: { |
208 | 264 | if (callHint.active) { | 305 | if (callHint.active) { |
209 | @@ -266,8 +307,7 @@ | |||
210 | 266 | } | 307 | } |
211 | 267 | } | 308 | } |
212 | 268 | 309 | ||
215 | 269 | showRowTitle: !expanded | 310 | showRow: expanded |
214 | 270 | rowTitle: PanelState.title | ||
216 | 271 | rowItemDelegate: ActionItem { | 311 | rowItemDelegate: ActionItem { |
217 | 272 | id: actionItem | 312 | id: actionItem |
218 | 273 | property int ownIndex: index | 313 | property int ownIndex: index |
219 | @@ -300,7 +340,6 @@ | |||
220 | 300 | 340 | ||
221 | 301 | enabled: d.enableTouchMenus | 341 | enabled: d.enableTouchMenus |
222 | 302 | opacity: d.showTouchMenu ? 1 : 0 | 342 | opacity: d.showTouchMenu ? 1 : 0 |
223 | 303 | visible: opacity != 0 | ||
224 | 304 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } | 343 | Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } } |
225 | 305 | 344 | ||
226 | 306 | onEnabledChanged: { | 345 | onEnabledChanged: { |
227 | 307 | 346 | ||
228 | === modified file 'qml/Panel/PanelBar.qml' | |||
229 | --- qml/Panel/PanelBar.qml 2017-01-16 08:51:52 +0000 | |||
230 | +++ qml/Panel/PanelBar.qml 2017-01-26 14:02:24 +0000 | |||
231 | @@ -30,8 +30,7 @@ | |||
232 | 30 | property real lateralPosition: -1 | 30 | property real lateralPosition: -1 |
233 | 31 | property int alignment: Qt.AlignRight | 31 | property int alignment: Qt.AlignRight |
234 | 32 | 32 | ||
237 | 33 | property alias showRowTitle: row.showRowTitle | 33 | property alias showRow: row.showRow |
236 | 34 | property alias rowTitle: row.rowTitle | ||
238 | 35 | property alias rowItemDelegate: row.delegate | 34 | property alias rowItemDelegate: row.delegate |
239 | 36 | 35 | ||
240 | 37 | implicitWidth: flickable.contentWidth | 36 | implicitWidth: flickable.contentWidth |
241 | 38 | 37 | ||
242 | === modified file 'qml/Panel/PanelItemRow.qml' | |||
243 | --- qml/Panel/PanelItemRow.qml 2017-01-10 00:44:47 +0000 | |||
244 | +++ qml/Panel/PanelItemRow.qml 2017-01-26 14:02:24 +0000 | |||
245 | @@ -16,29 +16,28 @@ | |||
246 | 16 | 16 | ||
247 | 17 | import QtQuick 2.4 | 17 | import QtQuick 2.4 |
248 | 18 | import Ubuntu.Components 1.3 | 18 | import Ubuntu.Components 1.3 |
249 | 19 | import QtGraphicalEffects 1.0 | ||
250 | 19 | import "../Components" | 20 | import "../Components" |
251 | 20 | 21 | ||
252 | 21 | Item { | 22 | Item { |
253 | 22 | id: root | 23 | id: root |
255 | 23 | implicitWidth: showRowTitle && !expanded ? rowTitle != "" ? rowLabel.width : 0 : row.width | 24 | implicitWidth: row.width |
256 | 24 | implicitHeight: units.gu(3) | 25 | implicitHeight: units.gu(3) |
257 | 25 | 26 | ||
260 | 26 | property bool showRowTitle: false | 27 | property bool showRow: true |
259 | 27 | property alias rowTitle: rowLabel.text | ||
261 | 28 | property QtObject model: null | 28 | property QtObject model: null |
262 | 29 | property real overFlowWidth: width | 29 | property real overFlowWidth: width |
263 | 30 | property bool expanded: false | 30 | property bool expanded: false |
264 | 31 | readonly property alias currentItem: row.currentItem | ||
265 | 32 | readonly property alias currentItemIndex: row.currentIndex | ||
266 | 33 | |||
267 | 34 | property real unitProgress: 0.0 | 31 | property real unitProgress: 0.0 |
268 | 35 | property real selectionChangeBuffer: units.gu(2) | 32 | property real selectionChangeBuffer: units.gu(2) |
269 | 36 | property bool enableLateralChanges: false | 33 | property bool enableLateralChanges: false |
270 | 37 | property color hightlightColor: "#ffffff" | 34 | property color hightlightColor: "#ffffff" |
271 | 38 | |||
272 | 39 | property alias delegate: row.delegate | 35 | property alias delegate: row.delegate |
273 | 40 | |||
274 | 41 | property real lateralPosition: -1 | 36 | property real lateralPosition: -1 |
275 | 37 | |||
276 | 38 | readonly property alias currentItem: row.currentItem | ||
277 | 39 | readonly property alias currentItemIndex: row.currentIndex | ||
278 | 40 | |||
279 | 42 | onLateralPositionChanged: { | 41 | onLateralPositionChanged: { |
280 | 43 | updateItemFromLateralPosition(); | 42 | updateItemFromLateralPosition(); |
281 | 44 | } | 43 | } |
282 | @@ -138,31 +137,12 @@ | |||
283 | 138 | d.previousItem = currentItem; | 137 | d.previousItem = currentItem; |
284 | 139 | } | 138 | } |
285 | 140 | 139 | ||
286 | 141 | Label { | ||
287 | 142 | id: rowLabel | ||
288 | 143 | objectName: "panelTitle" | ||
289 | 144 | anchors { | ||
290 | 145 | left: parent.left | ||
291 | 146 | leftMargin: units.gu(1) | ||
292 | 147 | verticalCenter: parent.verticalCenter | ||
293 | 148 | } | ||
294 | 149 | width: implicitWidth + units.gu(2) | ||
295 | 150 | elide: Text.ElideRight | ||
296 | 151 | maximumLineCount: 1 | ||
297 | 152 | fontSize: "medium" | ||
298 | 153 | font.weight: Font.Medium | ||
299 | 154 | color: Theme.palette.selected.backgroundText | ||
300 | 155 | opacity: showRowTitle ? 1 : 0 | ||
301 | 156 | visible: opacity != 0 | ||
302 | 157 | Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } } | ||
303 | 158 | } | ||
304 | 159 | |||
305 | 160 | ListView { | 140 | ListView { |
306 | 161 | id: row | 141 | id: row |
307 | 162 | objectName: "panelRow" | 142 | objectName: "panelRow" |
308 | 163 | orientation: ListView.Horizontal | 143 | orientation: ListView.Horizontal |
309 | 164 | model: root.model | 144 | model: root.model |
311 | 165 | opacity: showRowTitle ? 0 : 1 | 145 | opacity: showRow ? 1 : 0 |
312 | 166 | // dont set visible on basis of opacity; otherwise width will not be calculated correctly | 146 | // dont set visible on basis of opacity; otherwise width will not be calculated correctly |
313 | 167 | anchors { | 147 | anchors { |
314 | 168 | top: parent.top | 148 | top: parent.top |
315 | 169 | 149 | ||
316 | === modified file 'qml/Panel/PanelMenu.qml' | |||
317 | --- qml/Panel/PanelMenu.qml 2017-01-16 08:51:52 +0000 | |||
318 | +++ qml/Panel/PanelMenu.qml 2017-01-26 14:02:24 +0000 | |||
319 | @@ -35,8 +35,7 @@ | |||
320 | 35 | property color panelColor: theme.palette.normal.background | 35 | property color panelColor: theme.palette.normal.background |
321 | 36 | 36 | ||
322 | 37 | property alias alignment: bar.alignment | 37 | property alias alignment: bar.alignment |
325 | 38 | property alias rowTitle: bar.rowTitle | 38 | property alias showRow: bar.showRow |
324 | 39 | property alias showRowTitle: bar.showRowTitle | ||
326 | 40 | property alias rowItemDelegate: bar.rowItemDelegate | 39 | property alias rowItemDelegate: bar.rowItemDelegate |
327 | 41 | property alias pageDelegate: content.pageDelegate | 40 | property alias pageDelegate: content.pageDelegate |
328 | 42 | 41 | ||
329 | @@ -45,7 +44,7 @@ | |||
330 | 45 | readonly property bool partiallyOpened: unitProgress > 0 && unitProgress < 1.0 | 44 | readonly property bool partiallyOpened: unitProgress > 0 && unitProgress < 1.0 |
331 | 46 | readonly property bool fullyClosed: unitProgress == 0 | 45 | readonly property bool fullyClosed: unitProgress == 0 |
332 | 47 | readonly property alias expanded: bar.expanded | 46 | readonly property alias expanded: bar.expanded |
334 | 48 | readonly property int barWidth: Math.min(bar.width, bar.implicitWidth) | 47 | property int barWidth: Math.min(bar.width, bar.implicitWidth) |
335 | 49 | 48 | ||
336 | 50 | signal showTapped() | 49 | signal showTapped() |
337 | 51 | 50 | ||
338 | 52 | 51 | ||
339 | === modified file 'qml/Shell.qml' | |||
340 | --- qml/Shell.qml 2017-01-24 07:43:54 +0000 | |||
341 | +++ qml/Shell.qml 2017-01-26 14:02:24 +0000 | |||
342 | @@ -314,6 +314,7 @@ | |||
343 | 314 | altTabPressed: physicalKeysMapper.altTabPressed | 314 | altTabPressed: physicalKeysMapper.altTabPressed |
344 | 315 | oskEnabled: shell.oskEnabled | 315 | oskEnabled: shell.oskEnabled |
345 | 316 | spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown)) | 316 | spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown)) |
346 | 317 | globalMenus : settings.enableGlobalMenus | ||
347 | 317 | 318 | ||
348 | 318 | onSpreadShownChanged: { | 319 | onSpreadShownChanged: { |
349 | 319 | panel.indicators.hide(); | 320 | panel.indicators.hide(); |
350 | @@ -492,12 +493,14 @@ | |||
351 | 492 | id: panel | 493 | id: panel |
352 | 493 | objectName: "panel" | 494 | objectName: "panel" |
353 | 494 | anchors.fill: parent //because this draws indicator menus | 495 | anchors.fill: parent //because this draws indicator menus |
354 | 496 | z: shell.usageScenario === "desktop" ? 1 : 0 // otherwise the menus are drawn below the panel. | ||
355 | 495 | 497 | ||
357 | 496 | mode: shell.usageScenario == "desktop" ? "windowed" : "staged" | 498 | mode: shell.usageScenario === "desktop" ? "windowed" : "staged" |
358 | 497 | minimizedPanelHeight: units.gu(3) | 499 | minimizedPanelHeight: units.gu(3) |
359 | 498 | expandedPanelHeight: units.gu(7) | 500 | expandedPanelHeight: units.gu(7) |
360 | 499 | indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width | 501 | indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width |
361 | 500 | applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width | 502 | applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width |
362 | 503 | globalMenus: settings.enableGlobalMenus | ||
363 | 501 | 504 | ||
364 | 502 | indicators { | 505 | indicators { |
365 | 503 | hides: [launcher] | 506 | hides: [launcher] |
366 | 504 | 507 | ||
367 | === modified file 'qml/Stage/DecoratedWindow.qml' | |||
368 | --- qml/Stage/DecoratedWindow.qml 2017-01-18 17:34:57 +0000 | |||
369 | +++ qml/Stage/DecoratedWindow.qml 2017-01-26 14:02:24 +0000 | |||
370 | @@ -48,6 +48,7 @@ | |||
371 | 48 | property int highlightSize: units.gu(1) | 48 | property int highlightSize: units.gu(1) |
372 | 49 | property real shadowOpacity: 0 | 49 | property real shadowOpacity: 0 |
373 | 50 | property bool darkening: false | 50 | property bool darkening: false |
374 | 51 | property bool enableMenus: false | ||
375 | 51 | 52 | ||
376 | 52 | property real requestedWidth | 53 | property real requestedWidth |
377 | 53 | property real requestedHeight | 54 | property real requestedHeight |
378 | @@ -224,11 +225,12 @@ | |||
379 | 224 | onMinimizeClicked: root.minimizeClicked(); | 225 | onMinimizeClicked: root.minimizeClicked(); |
380 | 225 | 226 | ||
381 | 226 | enableMenus: { | 227 | enableMenus: { |
385 | 227 | return active && | 228 | return root.enableMenus && |
386 | 228 | surface && | 229 | active && |
387 | 229 | (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible) | 230 | surface && |
388 | 231 | (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible) | ||
389 | 230 | } | 232 | } |
391 | 231 | menu: sharedAppModel.model | 233 | menu: root.enableMenus ? sharedAppModel.model : undefined |
392 | 232 | 234 | ||
393 | 233 | Indicators.SharedUnityMenuModel { | 235 | Indicators.SharedUnityMenuModel { |
394 | 234 | id: sharedAppModel | 236 | id: sharedAppModel |
395 | 235 | 237 | ||
396 | === modified file 'qml/Stage/Stage.qml' | |||
397 | --- qml/Stage/Stage.qml 2017-01-03 12:04:08 +0000 | |||
398 | +++ qml/Stage/Stage.qml 2017-01-26 14:02:24 +0000 | |||
399 | @@ -46,6 +46,7 @@ | |||
400 | 46 | property int leftMargin: 0 | 46 | property int leftMargin: 0 |
401 | 47 | property bool oskEnabled: false | 47 | property bool oskEnabled: false |
402 | 48 | property rect inputMethodRect | 48 | property rect inputMethodRect |
403 | 49 | property bool globalMenus: true | ||
404 | 49 | 50 | ||
405 | 50 | // Configuration | 51 | // Configuration |
406 | 51 | property string mode: "staged" | 52 | property string mode: "staged" |
407 | @@ -1550,6 +1551,7 @@ | |||
408 | 1550 | highlightSize: windowInfoItem.iconMargin / 2 | 1551 | highlightSize: windowInfoItem.iconMargin / 2 |
409 | 1551 | stageWidth: appContainer.width | 1552 | stageWidth: appContainer.width |
410 | 1552 | stageHeight: appContainer.height | 1553 | stageHeight: appContainer.height |
411 | 1554 | enableMenus: !root.globalMenus | ||
412 | 1553 | 1555 | ||
413 | 1554 | requestedWidth: appDelegate.requestedWidth | 1556 | requestedWidth: appDelegate.requestedWidth |
414 | 1555 | requestedHeight: appDelegate.requestedHeight | 1557 | requestedHeight: appDelegate.requestedHeight |
415 | 1556 | 1558 | ||
416 | === modified file 'tests/mocks/GSettings.1.0/fake_gsettings.cpp' | |||
417 | --- tests/mocks/GSettings.1.0/fake_gsettings.cpp 2016-12-10 14:06:18 +0000 | |||
418 | +++ tests/mocks/GSettings.1.0/fake_gsettings.cpp 2017-01-26 14:02:24 +0000 | |||
419 | @@ -29,6 +29,7 @@ | |||
420 | 29 | , m_edgeDragWidth(2) | 29 | , m_edgeDragWidth(2) |
421 | 30 | , m_enableLauncher(true) | 30 | , m_enableLauncher(true) |
422 | 31 | , m_enableIndicatorMenu(true) | 31 | , m_enableIndicatorMenu(true) |
423 | 32 | , m_enableGlobalMenus(true) | ||
424 | 32 | , m_appstoreUri("http://uappexplorer.com") | 33 | , m_appstoreUri("http://uappexplorer.com") |
425 | 33 | { | 34 | { |
426 | 34 | } | 35 | } |
427 | @@ -179,6 +180,19 @@ | |||
428 | 179 | return m_appstoreUri; | 180 | return m_appstoreUri; |
429 | 180 | } | 181 | } |
430 | 181 | 182 | ||
431 | 183 | bool GSettingsControllerQml::enableGlobalMenus() const | ||
432 | 184 | { | ||
433 | 185 | return m_enableGlobalMenus; | ||
434 | 186 | } | ||
435 | 187 | |||
436 | 188 | void GSettingsControllerQml::setEnableGlobalMenus(bool enableGlobalMenus) | ||
437 | 189 | { | ||
438 | 190 | if (m_enableGlobalMenus != enableGlobalMenus) { | ||
439 | 191 | m_enableGlobalMenus = enableGlobalMenus; | ||
440 | 192 | Q_EMIT enableGlobalMenusChanged(enableGlobalMenus); | ||
441 | 193 | } | ||
442 | 194 | } | ||
443 | 195 | |||
444 | 182 | GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) { | 196 | GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) { |
445 | 183 | } | 197 | } |
446 | 184 | 198 | ||
447 | @@ -247,6 +261,8 @@ | |||
448 | 247 | this, &GSettingsQml::enableLauncherChanged); | 261 | this, &GSettingsQml::enableLauncherChanged); |
449 | 248 | connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::enableIndicatorMenuChanged, | 262 | connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::enableIndicatorMenuChanged, |
450 | 249 | this, &GSettingsQml::enableIndicatorMenuChanged); | 263 | this, &GSettingsQml::enableIndicatorMenuChanged); |
451 | 264 | connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::enableGlobalMenusChanged, | ||
452 | 265 | this, &GSettingsQml::enableGlobalMenusChanged); | ||
453 | 250 | 266 | ||
454 | 251 | Q_EMIT disableHeightChanged(); | 267 | Q_EMIT disableHeightChanged(); |
455 | 252 | Q_EMIT pictureUriChanged(); | 268 | Q_EMIT pictureUriChanged(); |
456 | @@ -258,6 +274,7 @@ | |||
457 | 258 | Q_EMIT edgeDragWidthChanged(); | 274 | Q_EMIT edgeDragWidthChanged(); |
458 | 259 | Q_EMIT enableLauncherChanged(); | 275 | Q_EMIT enableLauncherChanged(); |
459 | 260 | Q_EMIT enableIndicatorMenuChanged(); | 276 | Q_EMIT enableIndicatorMenuChanged(); |
460 | 277 | Q_EMIT enableGlobalMenusChanged(); | ||
461 | 261 | } | 278 | } |
462 | 262 | 279 | ||
463 | 263 | GSettingsSchemaQml * GSettingsQml::schema() const { | 280 | GSettingsSchemaQml * GSettingsQml::schema() const { |
464 | @@ -390,6 +407,15 @@ | |||
465 | 390 | return QVariant(); | 407 | return QVariant(); |
466 | 391 | } | 408 | } |
467 | 392 | 409 | ||
468 | 410 | QVariant GSettingsQml::enableGlobalMenus() const | ||
469 | 411 | { | ||
470 | 412 | if (m_valid && m_schema->id() == "com.canonical.Unity8") { | ||
471 | 413 | return GSettingsControllerQml::instance()->enableGlobalMenus(); | ||
472 | 414 | } else { | ||
473 | 415 | return QVariant(); | ||
474 | 416 | } | ||
475 | 417 | } | ||
476 | 418 | |||
477 | 393 | void GSettingsQml::setLifecycleExemptAppids(const QVariant &appIds) | 419 | void GSettingsQml::setLifecycleExemptAppids(const QVariant &appIds) |
478 | 394 | { | 420 | { |
479 | 395 | if (m_valid && m_schema->id() == "com.canonical.qtmir") { | 421 | if (m_valid && m_schema->id() == "com.canonical.qtmir") { |
480 | @@ -431,3 +457,10 @@ | |||
481 | 431 | GSettingsControllerQml::instance()->setEnableIndicatorMenu(enableIndicatorMenu.toBool()); | 457 | GSettingsControllerQml::instance()->setEnableIndicatorMenu(enableIndicatorMenu.toBool()); |
482 | 432 | } | 458 | } |
483 | 433 | } | 459 | } |
484 | 460 | |||
485 | 461 | void GSettingsQml::setEnableGlobalMenus(const QVariant &enableGlobalMenus) | ||
486 | 462 | { | ||
487 | 463 | if (m_valid && m_schema->id() == "com.canonical.Unity8") { | ||
488 | 464 | GSettingsControllerQml::instance()->setEnableGlobalMenus(enableGlobalMenus.toBool()); | ||
489 | 465 | } | ||
490 | 466 | } | ||
491 | 434 | 467 | ||
492 | === modified file 'tests/mocks/GSettings.1.0/fake_gsettings.h' | |||
493 | --- tests/mocks/GSettings.1.0/fake_gsettings.h 2016-12-10 14:06:18 +0000 | |||
494 | +++ tests/mocks/GSettings.1.0/fake_gsettings.h 2017-01-26 14:02:24 +0000 | |||
495 | @@ -59,6 +59,7 @@ | |||
496 | 59 | Q_PROPERTY(QVariant edgeDragWidth READ edgeDragWidth WRITE setEdgeDragWidth NOTIFY edgeDragWidthChanged) | 59 | Q_PROPERTY(QVariant edgeDragWidth READ edgeDragWidth WRITE setEdgeDragWidth NOTIFY edgeDragWidthChanged) |
497 | 60 | Q_PROPERTY(QVariant enableLauncher READ enableLauncher WRITE setEnableLauncher NOTIFY enableLauncherChanged) | 60 | Q_PROPERTY(QVariant enableLauncher READ enableLauncher WRITE setEnableLauncher NOTIFY enableLauncherChanged) |
498 | 61 | Q_PROPERTY(QVariant enableIndicatorMenu READ enableIndicatorMenu WRITE setEnableIndicatorMenu NOTIFY enableIndicatorMenuChanged) | 61 | Q_PROPERTY(QVariant enableIndicatorMenu READ enableIndicatorMenu WRITE setEnableIndicatorMenu NOTIFY enableIndicatorMenuChanged) |
499 | 62 | Q_PROPERTY(QVariant enableGlobalMenus READ enableGlobalMenus WRITE setEnableGlobalMenus NOTIFY enableGlobalMenusChanged) | ||
500 | 62 | Q_PROPERTY(QVariant appstoreUri READ appstoreUri NOTIFY appstoreUriChanged) | 63 | Q_PROPERTY(QVariant appstoreUri READ appstoreUri NOTIFY appstoreUriChanged) |
501 | 63 | 64 | ||
502 | 64 | public: | 65 | public: |
503 | @@ -78,6 +79,7 @@ | |||
504 | 78 | QVariant edgeDragWidth() const; | 79 | QVariant edgeDragWidth() const; |
505 | 79 | QVariant enableLauncher() const; | 80 | QVariant enableLauncher() const; |
506 | 80 | QVariant enableIndicatorMenu() const; | 81 | QVariant enableIndicatorMenu() const; |
507 | 82 | QVariant enableGlobalMenus() const; | ||
508 | 81 | QVariant appstoreUri() const; | 83 | QVariant appstoreUri() const; |
509 | 82 | 84 | ||
510 | 83 | void setDisableHeight(const QVariant &val); | 85 | void setDisableHeight(const QVariant &val); |
511 | @@ -90,6 +92,7 @@ | |||
512 | 90 | void setEdgeDragWidth(const QVariant &edgeDragWidth); | 92 | void setEdgeDragWidth(const QVariant &edgeDragWidth); |
513 | 91 | void setEnableLauncher(const QVariant &enableLauncher); | 93 | void setEnableLauncher(const QVariant &enableLauncher); |
514 | 92 | void setEnableIndicatorMenu(const QVariant &enableIndicatorMenu); | 94 | void setEnableIndicatorMenu(const QVariant &enableIndicatorMenu); |
515 | 95 | void setEnableGlobalMenus(const QVariant &enableGlobalMenus); | ||
516 | 93 | 96 | ||
517 | 94 | Q_SIGNALS: | 97 | Q_SIGNALS: |
518 | 95 | void disableHeightChanged(); | 98 | void disableHeightChanged(); |
519 | @@ -103,6 +106,7 @@ | |||
520 | 103 | void edgeDragWidthChanged(); | 106 | void edgeDragWidthChanged(); |
521 | 104 | void enableLauncherChanged(); | 107 | void enableLauncherChanged(); |
522 | 105 | void enableIndicatorMenuChanged(); | 108 | void enableIndicatorMenuChanged(); |
523 | 109 | void enableGlobalMenusChanged(); | ||
524 | 106 | void appstoreUriChanged(); | 110 | void appstoreUriChanged(); |
525 | 107 | 111 | ||
526 | 108 | private: | 112 | private: |
527 | @@ -150,6 +154,9 @@ | |||
528 | 150 | bool enableIndicatorMenu() const; | 154 | bool enableIndicatorMenu() const; |
529 | 151 | Q_INVOKABLE void setEnableIndicatorMenu(bool enableIndicatorMenu); | 155 | Q_INVOKABLE void setEnableIndicatorMenu(bool enableIndicatorMenu); |
530 | 152 | 156 | ||
531 | 157 | bool enableGlobalMenus() const; | ||
532 | 158 | Q_INVOKABLE void setEnableGlobalMenus(bool enableGlobalMenus); | ||
533 | 159 | |||
534 | 153 | QString appstoreUri() const; | 160 | QString appstoreUri() const; |
535 | 154 | 161 | ||
536 | 155 | Q_SIGNALS: | 162 | Q_SIGNALS: |
537 | @@ -163,6 +170,7 @@ | |||
538 | 163 | void edgeDragWidthChanged(uint edgeDragWidth); | 170 | void edgeDragWidthChanged(uint edgeDragWidth); |
539 | 164 | void enableLauncherChanged(bool enableLauncher); | 171 | void enableLauncherChanged(bool enableLauncher); |
540 | 165 | void enableIndicatorMenuChanged(bool enableIndicatorMenu); | 172 | void enableIndicatorMenuChanged(bool enableIndicatorMenu); |
541 | 173 | void enableGlobalMenusChanged(bool enableGlobalMenus); | ||
542 | 166 | void appstoreUriChanged(const QString &appstoreUri); | 174 | void appstoreUriChanged(const QString &appstoreUri); |
543 | 167 | 175 | ||
544 | 168 | private: | 176 | private: |
545 | @@ -178,6 +186,7 @@ | |||
546 | 178 | uint m_edgeDragWidth; | 186 | uint m_edgeDragWidth; |
547 | 179 | bool m_enableLauncher; | 187 | bool m_enableLauncher; |
548 | 180 | bool m_enableIndicatorMenu; | 188 | bool m_enableIndicatorMenu; |
549 | 189 | bool m_enableGlobalMenus; | ||
550 | 181 | QString m_appstoreUri; | 190 | QString m_appstoreUri; |
551 | 182 | 191 | ||
552 | 183 | static GSettingsControllerQml* s_controllerInstance; | 192 | static GSettingsControllerQml* s_controllerInstance; |
553 | 184 | 193 | ||
554 | === modified file 'tests/qmltests/Panel/tst_Panel.qml' | |||
555 | --- tests/qmltests/Panel/tst_Panel.qml 2017-01-24 07:44:18 +0000 | |||
556 | +++ tests/qmltests/Panel/tst_Panel.qml 2017-01-26 14:02:24 +0000 | |||
557 | @@ -78,6 +78,7 @@ | |||
558 | 78 | id: panel | 78 | id: panel |
559 | 79 | anchors.fill: parent | 79 | anchors.fill: parent |
560 | 80 | mode: modeSelector.model[modeSelector.selectedIndex] | 80 | mode: modeSelector.model[modeSelector.selectedIndex] |
561 | 81 | globalMenus: false | ||
562 | 81 | 82 | ||
563 | 82 | indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width | 83 | indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width |
564 | 83 | applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width | 84 | applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width |
565 | @@ -225,6 +226,18 @@ | |||
566 | 225 | color: "white" | 226 | color: "white" |
567 | 226 | } | 227 | } |
568 | 227 | } | 228 | } |
569 | 229 | |||
570 | 230 | RowLayout { | ||
571 | 231 | Layout.fillWidth: true | ||
572 | 232 | CheckBox { | ||
573 | 233 | checked: panel.globalMenus | ||
574 | 234 | onCheckedChanged: panel.globalMenus = checked | ||
575 | 235 | } | ||
576 | 236 | Label { | ||
577 | 237 | text: "Global Menus" | ||
578 | 238 | color: "white" | ||
579 | 239 | } | ||
580 | 240 | } | ||
581 | 228 | } | 241 | } |
582 | 229 | } | 242 | } |
583 | 230 | 243 | ||
584 | @@ -251,6 +264,7 @@ | |||
585 | 251 | 264 | ||
586 | 252 | function init() { | 265 | function init() { |
587 | 253 | panel.mode = "staged"; | 266 | panel.mode = "staged"; |
588 | 267 | panel.globalMenus = true; | ||
589 | 254 | mouseEmulation.checked = true; | 268 | mouseEmulation.checked = true; |
590 | 255 | panel.fullscreenMode = false; | 269 | panel.fullscreenMode = false; |
591 | 256 | callManager.foregroundCall = null; | 270 | callManager.foregroundCall = null; |
592 | @@ -269,12 +283,13 @@ | |||
593 | 269 | compare(windowControlButtonsSpy.valid, true); | 283 | compare(windowControlButtonsSpy.valid, true); |
594 | 270 | 284 | ||
595 | 271 | waitForRendering(panel); | 285 | waitForRendering(panel); |
596 | 286 | waitForAllAnimationToComplete("initial"); | ||
597 | 272 | } | 287 | } |
598 | 273 | 288 | ||
599 | 274 | function cleanup() { | 289 | function cleanup() { |
600 | 275 | panel.indicators.hide(); | 290 | panel.indicators.hide(); |
601 | 276 | panel.applicationMenus.hide(); | 291 | panel.applicationMenus.hide(); |
603 | 277 | waitForAllAnimationToComplete("initial"); | 292 | mouseMove(panel, -1, -1); |
604 | 278 | } | 293 | } |
605 | 279 | 294 | ||
606 | 280 | function get_indicator_item(index) { | 295 | function get_indicator_item(index) { |
607 | @@ -761,44 +776,67 @@ | |||
608 | 761 | } | 776 | } |
609 | 762 | } | 777 | } |
610 | 763 | 778 | ||
612 | 764 | function test_stagedApplicationMenuBarShowOnMouseHover() { | 779 | function test_stagedApplicationMenuBarShowOnMouseHover_data() { |
613 | 780 | return [ | ||
614 | 781 | { tag: "windowed-global", mode: "windowed", global: true }, | ||
615 | 782 | { tag: "windowed-local", mode: "windowed", global: false }, | ||
616 | 783 | { tag: "staged-global", mode: "staged", global: true }, | ||
617 | 784 | { tag: "staged-local", mode: "staged", global: false }, | ||
618 | 785 | ]; | ||
619 | 786 | } | ||
620 | 787 | |||
621 | 788 | function test_stagedApplicationMenuBarShowOnMouseHover(data) { | ||
622 | 765 | PanelState.title = "Fake Title"; | 789 | PanelState.title = "Fake Title"; |
624 | 766 | panel.mode = "staged"; | 790 | panel.mode = data.mode; |
625 | 791 | panel.globalMenus = data.global; | ||
626 | 767 | mouseEmulation.checked = false; | 792 | mouseEmulation.checked = false; |
627 | 768 | 793 | ||
629 | 769 | var appTitle = findChild(panel.applicationMenus, "panelTitle"); verify(appTitle); | 794 | var panelTitle = findChild(panel, "panelTitle"); verify(panelTitle); |
630 | 770 | var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow); | 795 | var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow); |
631 | 771 | var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar); | 796 | var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar); |
632 | 772 | 797 | ||
634 | 773 | tryCompare(appTitle, "visible", true, undefined, "App title should be visible"); | 798 | tryCompare(panelTitle, "visible", true, undefined, "App title should be visible"); |
635 | 774 | tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible"); | 799 | tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible"); |
636 | 775 | 800 | ||
637 | 776 | mouseMove(panel, panel.width/2, panel.panelHeight); | 801 | mouseMove(panel, panel.width/2, panel.panelHeight); |
638 | 777 | 802 | ||
644 | 778 | tryCompare(appTitle, "visible", false, undefined, "App title should not be visible on mouse hover"); | 803 | tryCompare(panelTitle, "visible", true, undefined, "App title should be visible"); |
645 | 779 | tryCompare(appMenuBar, "visible", true, undefined, "App menu bar should be visible on mouse hover"); | 804 | tryCompare(appMenuBar, "visible", data.mode == "staged" || data.global, undefined, "App menu bar should be visible on mouse hover"); |
646 | 780 | } | 805 | |
647 | 781 | 806 | mouseMove(panel, panel.width/2, panel.panelHeight * 2); | |
648 | 782 | function test_windowedApplicationMenuShowOnMouseHoverWhenDecorationsShown() { | 807 | |
649 | 808 | tryCompare(panelTitle, "visible", true, undefined, "App title should be visible"); | ||
650 | 809 | tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible"); | ||
651 | 810 | } | ||
652 | 811 | |||
653 | 812 | function test_windowedApplicationMenuShowOnMouseHoverWhenDecorationsShown_data() { | ||
654 | 813 | return [ | ||
655 | 814 | { tag: "global", global: true }, | ||
656 | 815 | { tag: "local", global: false } | ||
657 | 816 | ]; | ||
658 | 817 | } | ||
659 | 818 | |||
660 | 819 | function test_windowedApplicationMenuShowOnMouseHoverWhenDecorationsShown(data) { | ||
661 | 783 | PanelState.title = "Fake Title"; | 820 | PanelState.title = "Fake Title"; |
662 | 784 | panel.mode = "windowed"; | 821 | panel.mode = "windowed"; |
663 | 822 | panel.globalMenus = data.global; | ||
664 | 785 | mouseEmulation.checked = false; | 823 | mouseEmulation.checked = false; |
665 | 786 | 824 | ||
667 | 787 | var appTitle = findChild(panel.applicationMenus, "panelTitle"); verify(appTitle); | 825 | var panelTitle = findChild(panel, "panelTitle"); verify(panelTitle); |
668 | 788 | var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow); | 826 | var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow); |
669 | 789 | var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar); | 827 | var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar); |
670 | 790 | 828 | ||
672 | 791 | tryCompare(appTitle, "visible", true, undefined, "App title should be visible"); | 829 | tryCompare(panelTitle, "visible", true, undefined, "App title should be visible"); |
673 | 792 | tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible"); | 830 | tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible"); |
674 | 793 | 831 | ||
675 | 794 | mouseMove(panel, panel.width/2, panel.panelHeight); | 832 | mouseMove(panel, panel.width/2, panel.panelHeight); |
676 | 795 | 833 | ||
679 | 796 | tryCompare(appTitle, "visible", true, undefined, "App title should still be visible on mouse hover when panel decorations are not visible"); | 834 | tryCompare(panelTitle, "visible", true, undefined, "App title should still be visible on mouse hover when panel decorations are not visible"); |
680 | 797 | tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should be visible on mouse hover when panel decorations are not visible"); | 835 | tryCompare(appMenuBar, "visible", data.global, undefined, "App menu bar should only be visible on mouse hover if using globl menus"); |
681 | 798 | 836 | ||
682 | 799 | PanelState.decorationsVisible = true; | 837 | PanelState.decorationsVisible = true; |
683 | 800 | 838 | ||
685 | 801 | tryCompare(appTitle, "visible", false, undefined, "App title should still be visible on mouse hover when panel decorations are visible"); | 839 | tryCompare(panelTitle, "visible", false, undefined, "App title should still be visible on mouse hover when panel decorations are visible"); |
686 | 802 | tryCompare(appMenuBar, "visible", true, undefined, "App menu bar should be visible on mouse hover when panel decorations not visible"); | 840 | tryCompare(appMenuBar, "visible", true, undefined, "App menu bar should be visible on mouse hover when panel decorations not visible"); |
687 | 803 | } | 841 | } |
688 | 804 | 842 | ||
689 | 805 | 843 | ||
690 | === modified file 'tests/qmltests/Stage/tst_DesktopStage.qml' | |||
691 | --- tests/qmltests/Stage/tst_DesktopStage.qml 2017-01-10 14:44:29 +0000 | |||
692 | +++ tests/qmltests/Stage/tst_DesktopStage.qml 2017-01-26 14:02:24 +0000 | |||
693 | @@ -84,6 +84,7 @@ | |||
694 | 84 | property bool itemDestroyed: false | 84 | property bool itemDestroyed: false |
695 | 85 | sourceComponent: Component { | 85 | sourceComponent: Component { |
696 | 86 | Stage { | 86 | Stage { |
697 | 87 | globalMenus: false | ||
698 | 87 | anchors.fill: parent | 88 | anchors.fill: parent |
699 | 88 | background: "/usr/share/backgrounds/warty-final-ubuntu.png" | 89 | background: "/usr/share/backgrounds/warty-final-ubuntu.png" |
700 | 89 | focus: true | 90 | focus: true |
701 | 90 | 91 | ||
702 | === modified file 'tests/qmltests/tst_Shell.qml' | |||
703 | --- tests/qmltests/tst_Shell.qml 2017-01-24 07:43:54 +0000 | |||
704 | +++ tests/qmltests/tst_Shell.qml 2017-01-26 14:02:24 +0000 | |||
705 | @@ -308,6 +308,19 @@ | |||
706 | 308 | } | 308 | } |
707 | 309 | } | 309 | } |
708 | 310 | 310 | ||
709 | 311 | Row { | ||
710 | 312 | anchors { left: parent.left; right: parent.right } | ||
711 | 313 | CheckBox { | ||
712 | 314 | checked: GSettingsController.enableGlobalMenus | ||
713 | 315 | onCheckedChanged: { | ||
714 | 316 | GSettingsController.setEnableGlobalMenus(checked) | ||
715 | 317 | } | ||
716 | 318 | } | ||
717 | 319 | Label { | ||
718 | 320 | text: "Enable Global Menus" | ||
719 | 321 | } | ||
720 | 322 | } | ||
721 | 323 | |||
722 | 311 | Label { text: "Applications"; font.bold: true } | 324 | Label { text: "Applications"; font.bold: true } |
723 | 312 | 325 | ||
724 | 313 | Button { | 326 | Button { |
725 | @@ -2744,7 +2757,7 @@ | |||
726 | 2744 | loadShell(data.tag); | 2757 | loadShell(data.tag); |
727 | 2745 | 2758 | ||
728 | 2746 | var panel = findChild(shell, "panel"); verify(panel); | 2759 | var panel = findChild(shell, "panel"); verify(panel); |
730 | 2747 | var panelTitle = findChild(panel.applicationMenus, "panelTitle"); verify(panelTitle); | 2760 | var panelTitle = findChild(panel, "panelTitle"); verify(panelTitle); |
731 | 2748 | compare(panelTitle.visible, false, "Panel title should not be visible when greeter is shown"); | 2761 | compare(panelTitle.visible, false, "Panel title should not be visible when greeter is shown"); |
732 | 2749 | 2762 | ||
733 | 2750 | swipeAwayGreeter(); | 2763 | swipeAwayGreeter(); |
FAILED: Continuous integration, rev:2784 /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/3017/ /unity8- jenkins. ubuntu. com/job/ build/3924 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= xenial+ overlay, testname= qmluitests. sh/2300 /unity8- jenkins. ubuntu. com/job/ test-0- autopkgtest/ label=amd64, release= zesty,testname= qmluitests. sh/2300 /unity8- jenkins. ubuntu. com/job/ build-0- fetch/3952 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 3797 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 3797/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/3797 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=amd64, release= zesty/3797/ artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 3797 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 3797/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= zesty/3797 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=armhf, release= zesty/3797/ artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 3797 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 3797/artifact/ output/ *zip*/output. zip /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= zesty/3797 /unity8- jenkins. ubuntu. com/job/ build-2- binpkg/ arch=i386, release= zesty/3797/ artifact/ output/ *zip*/output. zip
https:/
Executed test runs:
SUCCESS: https:/
UNSTABLE: https:/
UNSTABLE: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild: /unity8- jenkins. ubuntu. com/job/ lp-unity8- ci/3017/ rebuild
https:/