Merge lp:~nick-dedekind/unity8/menus.local.global into lp:unity8

Proposed by Nick Dedekind
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
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.

To post a comment you must log in.
2785. By Nick Dedekind

merged with parent

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2784
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3017/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3924
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2300
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2300
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3952
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3797/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3797
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3797/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3017/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2785
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3019/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3926
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2302
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2302
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3954
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3799
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3799/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3799
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3799/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3799
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3799/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3799
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3799/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3799
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3799/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3799
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3799/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3019/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in data/com.canonical.Unity8.gschema.xml
Text conflict in plugins/Utils/CMakeLists.txt
Text conflict in plugins/Utils/plugin.cpp
Text conflict in qml/Stage/DecoratedWindow.qml
Text conflict in tests/mocks/GSettings.1.0/fake_gsettings.cpp
Text conflict in tests/mocks/GSettings.1.0/fake_gsettings.h
Text conflict in tests/mocks/Utils/CMakeLists.txt
Text conflict in tests/mocks/Utils/plugin.cpp
Text conflict in tests/qmltests/ApplicationMenus/tst_MenuBar.qml
9 conflicts encountered.

2786. By Nick Dedekind

merged with parent

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2786
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3045/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3960
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2316
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2316
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3988
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3833
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3833/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3833
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3833/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3833
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3833/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3833
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3833/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3833
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3833/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3833
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3833/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3045/rebuild

review: Needs Fixing (continuous-integration)
2787. By Nick Dedekind

fixed tests

Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

PASSED: Continuous integration, rev:2787
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3051/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3966
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/2321
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/2321
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3994
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3838
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3838/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3838
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3838/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3838
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3838/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3838
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3838/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3838
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3838/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3838
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3838/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/3051/rebuild

review: Approve (continuous-integration)
Revision history for this message
Lukáš Tinkl (lukas-kde) wrote :

Just a couple of minor issues inline, otherwise the code looks good; haven't tested yet

review: Needs Fixing
Revision history for this message
Albert Astals Cid (aacid) wrote :

Text conflict in qml/Stage/Stage.qml
1 conflicts encountered

Revision history for this message
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'data/com.canonical.Unity8.gschema.xml'
--- data/com.canonical.Unity8.gschema.xml 2016-12-10 14:06:18 +0000
+++ data/com.canonical.Unity8.gschema.xml 2017-01-26 14:02:24 +0000
@@ -58,6 +58,11 @@
58 <summary>The uri to the app store</summary>58 <summary>The uri to the app store</summary>
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>
60 </key>60 </key>
61 <key type="b" name="enable-global-menus">
62 <default>true</default>
63 <summary>Enable/disable global application menus.</summary>
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>
65 </key>
61 </schema>66 </schema>
6267
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">
6469
=== modified file 'qml/Panel/Panel.qml'
--- qml/Panel/Panel.qml 2017-01-26 14:02:23 +0000
+++ qml/Panel/Panel.qml 2017-01-26 14:02:24 +0000
@@ -1,4 +1,4 @@
1/*1/*
2 * Copyright (C) 2013-2016 Canonical, Ltd.2 * Copyright (C) 2013-2016 Canonical, Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
@@ -15,6 +15,7 @@
15 */15 */
1616
17import QtQuick 2.417import QtQuick 2.4
18import QtGraphicalEffects 1.0
18import Ubuntu.Components 1.319import Ubuntu.Components 1.3
19import Ubuntu.Layouts 1.020import Ubuntu.Layouts 1.0
20import Unity.Application 0.121import Unity.Application 0.1
@@ -41,6 +42,7 @@
41 property real expandedPanelHeight: units.gu(7)42 property real expandedPanelHeight: units.gu(7)
42 property real indicatorMenuWidth: width43 property real indicatorMenuWidth: width
43 property real applicationMenuWidth: width44 property real applicationMenuWidth: width
45 property bool globalMenus: true
4446
45 property alias applicationMenus: __applicationMenus47 property alias applicationMenus: __applicationMenus
46 property alias indicators: __indicators48 property alias indicators: __indicators
@@ -87,7 +89,9 @@
87 PanelState.decorationsAlwaysVisible89 PanelState.decorationsAlwaysVisible
8890
89 property bool showPointerMenu: revealControls &&91 property bool showPointerMenu: revealControls &&
90 (PanelState.decorationsVisible || mode == "staged")92 (PanelState.decorationsVisible || root.globalMenus || mode == "staged")
93
94 property bool showPointerMenuApplicationTitle: showPointerMenu && !showWindowDecorationControls
9195
92 property bool enablePointerMenu: revealControls &&96 property bool enablePointerMenu: revealControls &&
93 applicationMenus.available &&97 applicationMenus.available &&
@@ -178,59 +182,95 @@
178 }182 }
179 }183 }
180184
181 Row {185 WindowControlButtons {
182 anchors.fill: parent186 id: windowControlButtons
183 spacing: units.gu(2)187 objectName: "panelWindowControlButtons"
184188 height: parent.height
185 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/189
186 // cf. https://bugreports.qt.io/browse/QTBUG-32909190 opacity: d.showWindowDecorationControls ? 1 : 0
187 WindowControlButtons {191 visible: opacity !== 0
188 id: windowControlButtons192 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
189 objectName: "panelWindowControlButtons"193
190 height: indicators.minimizedPanelHeight194 active: PanelState.decorationsVisible || PanelState.decorationsAlwaysVisible
191 opacity: d.showWindowDecorationControls ? 1 : 0195 windowIsMaximized: true
192 visible: opacity != 0196 onCloseClicked: PanelState.closeClicked()
193 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }197 onMinimizeClicked: PanelState.minimizeClicked()
194198 onMaximizeClicked: PanelState.restoreClicked()
195 active: PanelState.decorationsVisible || PanelState.decorationsAlwaysVisible199 closeButtonShown: PanelState.closeButtonShown
196 windowIsMaximized: true200 }
197 onCloseClicked: PanelState.closeClicked()201
198 onMinimizeClicked: PanelState.minimizeClicked()202 Label {
199 onMaximizeClicked: PanelState.restoreClicked()203 id: titleLabel
200 closeButtonShown: PanelState.closeButtonShown204 anchors.verticalCenter: parent.verticalCenter
205 anchors.left: parent.left
206 anchors.leftMargin: units.gu(1)
207
208 maximumLineCount: 1
209 fontSize: "medium"
210 font.weight: Font.Medium
211 text: PanelState.title
212 visible: false
213 }
214
215 LinearGradient {
216 id: titleGradient
217 objectName: "panelTitle"
218 width: titleLabel.width
219 height: titleLabel.height
220 anchors.verticalCenter: parent.verticalCenter
221 anchors.left: parent.left
222 anchors.leftMargin: units.gu(1)
223
224 source: titleLabel
225 gradient: Gradient {
226 GradientStop { position: 0; color: theme.palette.selected.backgroundText }
227 GradientStop { position: 0.7; color: theme.palette.selected.backgroundText }
228 GradientStop { position: 1; color: "transparent" }
201 }229 }
202230 start: Qt.point(0, 0)
203 Loader {231 end: Qt.point(endpoint, 0)
204 id: menuBarLoader232
205 height: parent.height233 property real endpoint: d.showPointerMenuApplicationTitle ? menuBarLoader.anchors.leftMargin :
206 enabled: d.enablePointerMenu234 parent.width - __indicators.barWidth
207 opacity: d.showPointerMenu ? 1 : 0235
208 visible: opacity != 0236 opacity: d.showTouchMenu || d.showPointerMenuApplicationTitle ? 1 : 0
209 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }237 visible: opacity !== 0
210 active: __applicationMenus.model238 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
211239 }
212 width: parent.width - windowControlButtons.width - units.gu(2) - __indicators.barWidth240
213241 Loader {
214 property bool menusRequested: menuBarLoader.item ? menuBarLoader.item.showRequested : false242 id: menuBarLoader
215243 anchors.left: parent.left
216 sourceComponent: MenuBar {244 anchors.leftMargin: d.showPointerMenuApplicationTitle ? units.gu(8) : (windowControlButtons.width + units.gu(2))
217 id: bar245 height: parent.height
218 objectName: "menuBar"246 enabled: d.enablePointerMenu
219 anchors.left: parent.left247 active: __applicationMenus.model
220 anchors.margins: units.gu(1)248
221 height: menuBarLoader.height249 opacity: d.showPointerMenu ? 1 : 0
222 enableKeyFilter: valid && PanelState.decorationsVisible250 visible: opacity !== 0
223 unityMenuModel: __applicationMenus.model251 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
224252
225 Connections {253 width: parent.width - anchors.leftMargin - __indicators.barWidth
226 target: __applicationMenus254
227 onShownChanged: bar.dismiss();255 property bool menusRequested: menuBarLoader.item ? menuBarLoader.item.showRequested : false
228 }256
229257 sourceComponent: MenuBar {
230 Connections {258 id: bar
231 target: __indicators259 objectName: "menuBar"
232 onShownChanged: bar.dismiss();260 anchors.left: parent.left
233 }261 anchors.margins: units.gu(1)
262 height: menuBarLoader.height
263 enableKeyFilter: valid && PanelState.decorationsVisible
264 unityMenuModel: __applicationMenus.model
265
266 Connections {
267 target: __applicationMenus
268 onShownChanged: bar.dismiss();
269 }
270
271 Connections {
272 target: __indicators
273 onShownChanged: bar.dismiss();
234 }274 }
235 }275 }
236 }276 }
@@ -259,6 +299,7 @@
259 enableHint: !callHint.active && !fullscreenMode299 enableHint: !callHint.active && !fullscreenMode
260 showOnClick: false300 showOnClick: false
261 panelColor: panelAreaBackground.color301 panelColor: panelAreaBackground.color
302 barWidth: Math.max(titleLabel.width, units.gu(10))
262303
263 onShowTapped: {304 onShowTapped: {
264 if (callHint.active) {305 if (callHint.active) {
@@ -266,8 +307,7 @@
266 }307 }
267 }308 }
268309
269 showRowTitle: !expanded310 showRow: expanded
270 rowTitle: PanelState.title
271 rowItemDelegate: ActionItem {311 rowItemDelegate: ActionItem {
272 id: actionItem312 id: actionItem
273 property int ownIndex: index313 property int ownIndex: index
@@ -300,7 +340,6 @@
300340
301 enabled: d.enableTouchMenus341 enabled: d.enableTouchMenus
302 opacity: d.showTouchMenu ? 1 : 0342 opacity: d.showTouchMenu ? 1 : 0
303 visible: opacity != 0
304 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }343 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.SnapDuration } }
305344
306 onEnabledChanged: {345 onEnabledChanged: {
307346
=== modified file 'qml/Panel/PanelBar.qml'
--- qml/Panel/PanelBar.qml 2017-01-16 08:51:52 +0000
+++ qml/Panel/PanelBar.qml 2017-01-26 14:02:24 +0000
@@ -30,8 +30,7 @@
30 property real lateralPosition: -130 property real lateralPosition: -1
31 property int alignment: Qt.AlignRight31 property int alignment: Qt.AlignRight
3232
33 property alias showRowTitle: row.showRowTitle33 property alias showRow: row.showRow
34 property alias rowTitle: row.rowTitle
35 property alias rowItemDelegate: row.delegate34 property alias rowItemDelegate: row.delegate
3635
37 implicitWidth: flickable.contentWidth36 implicitWidth: flickable.contentWidth
3837
=== modified file 'qml/Panel/PanelItemRow.qml'
--- qml/Panel/PanelItemRow.qml 2017-01-10 00:44:47 +0000
+++ qml/Panel/PanelItemRow.qml 2017-01-26 14:02:24 +0000
@@ -16,29 +16,28 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import QtGraphicalEffects 1.0
19import "../Components"20import "../Components"
2021
21Item {22Item {
22 id: root23 id: root
23 implicitWidth: showRowTitle && !expanded ? rowTitle != "" ? rowLabel.width : 0 : row.width24 implicitWidth: row.width
24 implicitHeight: units.gu(3)25 implicitHeight: units.gu(3)
2526
26 property bool showRowTitle: false27 property bool showRow: true
27 property alias rowTitle: rowLabel.text
28 property QtObject model: null28 property QtObject model: null
29 property real overFlowWidth: width29 property real overFlowWidth: width
30 property bool expanded: false30 property bool expanded: false
31 readonly property alias currentItem: row.currentItem
32 readonly property alias currentItemIndex: row.currentIndex
33
34 property real unitProgress: 0.031 property real unitProgress: 0.0
35 property real selectionChangeBuffer: units.gu(2)32 property real selectionChangeBuffer: units.gu(2)
36 property bool enableLateralChanges: false33 property bool enableLateralChanges: false
37 property color hightlightColor: "#ffffff"34 property color hightlightColor: "#ffffff"
38
39 property alias delegate: row.delegate35 property alias delegate: row.delegate
40
41 property real lateralPosition: -136 property real lateralPosition: -1
37
38 readonly property alias currentItem: row.currentItem
39 readonly property alias currentItemIndex: row.currentIndex
40
42 onLateralPositionChanged: {41 onLateralPositionChanged: {
43 updateItemFromLateralPosition();42 updateItemFromLateralPosition();
44 }43 }
@@ -138,31 +137,12 @@
138 d.previousItem = currentItem;137 d.previousItem = currentItem;
139 }138 }
140139
141 Label {
142 id: rowLabel
143 objectName: "panelTitle"
144 anchors {
145 left: parent.left
146 leftMargin: units.gu(1)
147 verticalCenter: parent.verticalCenter
148 }
149 width: implicitWidth + units.gu(2)
150 elide: Text.ElideRight
151 maximumLineCount: 1
152 fontSize: "medium"
153 font.weight: Font.Medium
154 color: Theme.palette.selected.backgroundText
155 opacity: showRowTitle ? 1 : 0
156 visible: opacity != 0
157 Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration } }
158 }
159
160 ListView {140 ListView {
161 id: row141 id: row
162 objectName: "panelRow"142 objectName: "panelRow"
163 orientation: ListView.Horizontal143 orientation: ListView.Horizontal
164 model: root.model144 model: root.model
165 opacity: showRowTitle ? 0 : 1145 opacity: showRow ? 1 : 0
166 // dont set visible on basis of opacity; otherwise width will not be calculated correctly146 // dont set visible on basis of opacity; otherwise width will not be calculated correctly
167 anchors {147 anchors {
168 top: parent.top148 top: parent.top
169149
=== modified file 'qml/Panel/PanelMenu.qml'
--- qml/Panel/PanelMenu.qml 2017-01-16 08:51:52 +0000
+++ qml/Panel/PanelMenu.qml 2017-01-26 14:02:24 +0000
@@ -35,8 +35,7 @@
35 property color panelColor: theme.palette.normal.background35 property color panelColor: theme.palette.normal.background
3636
37 property alias alignment: bar.alignment37 property alias alignment: bar.alignment
38 property alias rowTitle: bar.rowTitle38 property alias showRow: bar.showRow
39 property alias showRowTitle: bar.showRowTitle
40 property alias rowItemDelegate: bar.rowItemDelegate39 property alias rowItemDelegate: bar.rowItemDelegate
41 property alias pageDelegate: content.pageDelegate40 property alias pageDelegate: content.pageDelegate
4241
@@ -45,7 +44,7 @@
45 readonly property bool partiallyOpened: unitProgress > 0 && unitProgress < 1.044 readonly property bool partiallyOpened: unitProgress > 0 && unitProgress < 1.0
46 readonly property bool fullyClosed: unitProgress == 045 readonly property bool fullyClosed: unitProgress == 0
47 readonly property alias expanded: bar.expanded46 readonly property alias expanded: bar.expanded
48 readonly property int barWidth: Math.min(bar.width, bar.implicitWidth)47 property int barWidth: Math.min(bar.width, bar.implicitWidth)
4948
50 signal showTapped()49 signal showTapped()
5150
5251
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2017-01-24 07:43:54 +0000
+++ qml/Shell.qml 2017-01-26 14:02:24 +0000
@@ -314,6 +314,7 @@
314 altTabPressed: physicalKeysMapper.altTabPressed314 altTabPressed: physicalKeysMapper.altTabPressed
315 oskEnabled: shell.oskEnabled315 oskEnabled: shell.oskEnabled
316 spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))316 spreadEnabled: tutorial.spreadEnabled && (!greeter || (!greeter.hasLockedApp && !greeter.shown))
317 globalMenus : settings.enableGlobalMenus
317318
318 onSpreadShownChanged: {319 onSpreadShownChanged: {
319 panel.indicators.hide();320 panel.indicators.hide();
@@ -492,12 +493,14 @@
492 id: panel493 id: panel
493 objectName: "panel"494 objectName: "panel"
494 anchors.fill: parent //because this draws indicator menus495 anchors.fill: parent //because this draws indicator menus
496 z: shell.usageScenario === "desktop" ? 1 : 0 // otherwise the menus are drawn below the panel.
495497
496 mode: shell.usageScenario == "desktop" ? "windowed" : "staged"498 mode: shell.usageScenario === "desktop" ? "windowed" : "staged"
497 minimizedPanelHeight: units.gu(3)499 minimizedPanelHeight: units.gu(3)
498 expandedPanelHeight: units.gu(7)500 expandedPanelHeight: units.gu(7)
499 indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width501 indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
500 applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width502 applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
503 globalMenus: settings.enableGlobalMenus
501504
502 indicators {505 indicators {
503 hides: [launcher]506 hides: [launcher]
504507
=== modified file 'qml/Stage/DecoratedWindow.qml'
--- qml/Stage/DecoratedWindow.qml 2017-01-18 17:34:57 +0000
+++ qml/Stage/DecoratedWindow.qml 2017-01-26 14:02:24 +0000
@@ -48,6 +48,7 @@
48 property int highlightSize: units.gu(1)48 property int highlightSize: units.gu(1)
49 property real shadowOpacity: 049 property real shadowOpacity: 0
50 property bool darkening: false50 property bool darkening: false
51 property bool enableMenus: false
5152
52 property real requestedWidth53 property real requestedWidth
53 property real requestedHeight54 property real requestedHeight
@@ -224,11 +225,12 @@
224 onMinimizeClicked: root.minimizeClicked();225 onMinimizeClicked: root.minimizeClicked();
225226
226 enableMenus: {227 enableMenus: {
227 return active &&228 return root.enableMenus &&
228 surface &&229 active &&
229 (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible)230 surface &&
231 (PanelState.focusedPersistentSurfaceId === surface.persistentId && !PanelState.decorationsVisible)
230 }232 }
231 menu: sharedAppModel.model233 menu: root.enableMenus ? sharedAppModel.model : undefined
232234
233 Indicators.SharedUnityMenuModel {235 Indicators.SharedUnityMenuModel {
234 id: sharedAppModel236 id: sharedAppModel
235237
=== modified file 'qml/Stage/Stage.qml'
--- qml/Stage/Stage.qml 2017-01-03 12:04:08 +0000
+++ qml/Stage/Stage.qml 2017-01-26 14:02:24 +0000
@@ -46,6 +46,7 @@
46 property int leftMargin: 046 property int leftMargin: 0
47 property bool oskEnabled: false47 property bool oskEnabled: false
48 property rect inputMethodRect48 property rect inputMethodRect
49 property bool globalMenus: true
4950
50 // Configuration51 // Configuration
51 property string mode: "staged"52 property string mode: "staged"
@@ -1550,6 +1551,7 @@
1550 highlightSize: windowInfoItem.iconMargin / 21551 highlightSize: windowInfoItem.iconMargin / 2
1551 stageWidth: appContainer.width1552 stageWidth: appContainer.width
1552 stageHeight: appContainer.height1553 stageHeight: appContainer.height
1554 enableMenus: !root.globalMenus
15531555
1554 requestedWidth: appDelegate.requestedWidth1556 requestedWidth: appDelegate.requestedWidth
1555 requestedHeight: appDelegate.requestedHeight1557 requestedHeight: appDelegate.requestedHeight
15561558
=== modified file 'tests/mocks/GSettings.1.0/fake_gsettings.cpp'
--- tests/mocks/GSettings.1.0/fake_gsettings.cpp 2016-12-10 14:06:18 +0000
+++ tests/mocks/GSettings.1.0/fake_gsettings.cpp 2017-01-26 14:02:24 +0000
@@ -29,6 +29,7 @@
29 , m_edgeDragWidth(2)29 , m_edgeDragWidth(2)
30 , m_enableLauncher(true)30 , m_enableLauncher(true)
31 , m_enableIndicatorMenu(true)31 , m_enableIndicatorMenu(true)
32 , m_enableGlobalMenus(true)
32 , m_appstoreUri("http://uappexplorer.com")33 , m_appstoreUri("http://uappexplorer.com")
33{34{
34}35}
@@ -179,6 +180,19 @@
179 return m_appstoreUri;180 return m_appstoreUri;
180}181}
181182
183bool GSettingsControllerQml::enableGlobalMenus() const
184{
185 return m_enableGlobalMenus;
186}
187
188void GSettingsControllerQml::setEnableGlobalMenus(bool enableGlobalMenus)
189{
190 if (m_enableGlobalMenus != enableGlobalMenus) {
191 m_enableGlobalMenus = enableGlobalMenus;
192 Q_EMIT enableGlobalMenusChanged(enableGlobalMenus);
193 }
194}
195
182GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {196GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
183}197}
184198
@@ -247,6 +261,8 @@
247 this, &GSettingsQml::enableLauncherChanged);261 this, &GSettingsQml::enableLauncherChanged);
248 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::enableIndicatorMenuChanged,262 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::enableIndicatorMenuChanged,
249 this, &GSettingsQml::enableIndicatorMenuChanged);263 this, &GSettingsQml::enableIndicatorMenuChanged);
264 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::enableGlobalMenusChanged,
265 this, &GSettingsQml::enableGlobalMenusChanged);
250266
251 Q_EMIT disableHeightChanged();267 Q_EMIT disableHeightChanged();
252 Q_EMIT pictureUriChanged();268 Q_EMIT pictureUriChanged();
@@ -258,6 +274,7 @@
258 Q_EMIT edgeDragWidthChanged();274 Q_EMIT edgeDragWidthChanged();
259 Q_EMIT enableLauncherChanged();275 Q_EMIT enableLauncherChanged();
260 Q_EMIT enableIndicatorMenuChanged();276 Q_EMIT enableIndicatorMenuChanged();
277 Q_EMIT enableGlobalMenusChanged();
261}278}
262279
263GSettingsSchemaQml * GSettingsQml::schema() const {280GSettingsSchemaQml * GSettingsQml::schema() const {
@@ -390,6 +407,15 @@
390 return QVariant();407 return QVariant();
391}408}
392409
410QVariant GSettingsQml::enableGlobalMenus() const
411{
412 if (m_valid && m_schema->id() == "com.canonical.Unity8") {
413 return GSettingsControllerQml::instance()->enableGlobalMenus();
414 } else {
415 return QVariant();
416 }
417}
418
393void GSettingsQml::setLifecycleExemptAppids(const QVariant &appIds)419void GSettingsQml::setLifecycleExemptAppids(const QVariant &appIds)
394{420{
395 if (m_valid && m_schema->id() == "com.canonical.qtmir") {421 if (m_valid && m_schema->id() == "com.canonical.qtmir") {
@@ -431,3 +457,10 @@
431 GSettingsControllerQml::instance()->setEnableIndicatorMenu(enableIndicatorMenu.toBool());457 GSettingsControllerQml::instance()->setEnableIndicatorMenu(enableIndicatorMenu.toBool());
432 }458 }
433}459}
460
461void GSettingsQml::setEnableGlobalMenus(const QVariant &enableGlobalMenus)
462{
463 if (m_valid && m_schema->id() == "com.canonical.Unity8") {
464 GSettingsControllerQml::instance()->setEnableGlobalMenus(enableGlobalMenus.toBool());
465 }
466}
434467
=== modified file 'tests/mocks/GSettings.1.0/fake_gsettings.h'
--- tests/mocks/GSettings.1.0/fake_gsettings.h 2016-12-10 14:06:18 +0000
+++ tests/mocks/GSettings.1.0/fake_gsettings.h 2017-01-26 14:02:24 +0000
@@ -59,6 +59,7 @@
59 Q_PROPERTY(QVariant edgeDragWidth READ edgeDragWidth WRITE setEdgeDragWidth NOTIFY edgeDragWidthChanged)59 Q_PROPERTY(QVariant edgeDragWidth READ edgeDragWidth WRITE setEdgeDragWidth NOTIFY edgeDragWidthChanged)
60 Q_PROPERTY(QVariant enableLauncher READ enableLauncher WRITE setEnableLauncher NOTIFY enableLauncherChanged)60 Q_PROPERTY(QVariant enableLauncher READ enableLauncher WRITE setEnableLauncher NOTIFY enableLauncherChanged)
61 Q_PROPERTY(QVariant enableIndicatorMenu READ enableIndicatorMenu WRITE setEnableIndicatorMenu NOTIFY enableIndicatorMenuChanged)61 Q_PROPERTY(QVariant enableIndicatorMenu READ enableIndicatorMenu WRITE setEnableIndicatorMenu NOTIFY enableIndicatorMenuChanged)
62 Q_PROPERTY(QVariant enableGlobalMenus READ enableGlobalMenus WRITE setEnableGlobalMenus NOTIFY enableGlobalMenusChanged)
62 Q_PROPERTY(QVariant appstoreUri READ appstoreUri NOTIFY appstoreUriChanged)63 Q_PROPERTY(QVariant appstoreUri READ appstoreUri NOTIFY appstoreUriChanged)
6364
64public:65public:
@@ -78,6 +79,7 @@
78 QVariant edgeDragWidth() const;79 QVariant edgeDragWidth() const;
79 QVariant enableLauncher() const;80 QVariant enableLauncher() const;
80 QVariant enableIndicatorMenu() const;81 QVariant enableIndicatorMenu() const;
82 QVariant enableGlobalMenus() const;
81 QVariant appstoreUri() const;83 QVariant appstoreUri() const;
8284
83 void setDisableHeight(const QVariant &val);85 void setDisableHeight(const QVariant &val);
@@ -90,6 +92,7 @@
90 void setEdgeDragWidth(const QVariant &edgeDragWidth);92 void setEdgeDragWidth(const QVariant &edgeDragWidth);
91 void setEnableLauncher(const QVariant &enableLauncher);93 void setEnableLauncher(const QVariant &enableLauncher);
92 void setEnableIndicatorMenu(const QVariant &enableIndicatorMenu);94 void setEnableIndicatorMenu(const QVariant &enableIndicatorMenu);
95 void setEnableGlobalMenus(const QVariant &enableGlobalMenus);
9396
94Q_SIGNALS:97Q_SIGNALS:
95 void disableHeightChanged();98 void disableHeightChanged();
@@ -103,6 +106,7 @@
103 void edgeDragWidthChanged();106 void edgeDragWidthChanged();
104 void enableLauncherChanged();107 void enableLauncherChanged();
105 void enableIndicatorMenuChanged();108 void enableIndicatorMenuChanged();
109 void enableGlobalMenusChanged();
106 void appstoreUriChanged();110 void appstoreUriChanged();
107111
108private:112private:
@@ -150,6 +154,9 @@
150 bool enableIndicatorMenu() const;154 bool enableIndicatorMenu() const;
151 Q_INVOKABLE void setEnableIndicatorMenu(bool enableIndicatorMenu);155 Q_INVOKABLE void setEnableIndicatorMenu(bool enableIndicatorMenu);
152156
157 bool enableGlobalMenus() const;
158 Q_INVOKABLE void setEnableGlobalMenus(bool enableGlobalMenus);
159
153 QString appstoreUri() const;160 QString appstoreUri() const;
154161
155Q_SIGNALS:162Q_SIGNALS:
@@ -163,6 +170,7 @@
163 void edgeDragWidthChanged(uint edgeDragWidth);170 void edgeDragWidthChanged(uint edgeDragWidth);
164 void enableLauncherChanged(bool enableLauncher);171 void enableLauncherChanged(bool enableLauncher);
165 void enableIndicatorMenuChanged(bool enableIndicatorMenu);172 void enableIndicatorMenuChanged(bool enableIndicatorMenu);
173 void enableGlobalMenusChanged(bool enableGlobalMenus);
166 void appstoreUriChanged(const QString &appstoreUri);174 void appstoreUriChanged(const QString &appstoreUri);
167175
168private:176private:
@@ -178,6 +186,7 @@
178 uint m_edgeDragWidth;186 uint m_edgeDragWidth;
179 bool m_enableLauncher;187 bool m_enableLauncher;
180 bool m_enableIndicatorMenu;188 bool m_enableIndicatorMenu;
189 bool m_enableGlobalMenus;
181 QString m_appstoreUri;190 QString m_appstoreUri;
182191
183 static GSettingsControllerQml* s_controllerInstance;192 static GSettingsControllerQml* s_controllerInstance;
184193
=== modified file 'tests/qmltests/Panel/tst_Panel.qml'
--- tests/qmltests/Panel/tst_Panel.qml 2017-01-24 07:44:18 +0000
+++ tests/qmltests/Panel/tst_Panel.qml 2017-01-26 14:02:24 +0000
@@ -78,6 +78,7 @@
78 id: panel78 id: panel
79 anchors.fill: parent79 anchors.fill: parent
80 mode: modeSelector.model[modeSelector.selectedIndex]80 mode: modeSelector.model[modeSelector.selectedIndex]
81 globalMenus: false
8182
82 indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width83 indicatorMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
83 applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width84 applicationMenuWidth: parent.width > units.gu(60) ? units.gu(40) : parent.width
@@ -225,6 +226,18 @@
225 color: "white"226 color: "white"
226 }227 }
227 }228 }
229
230 RowLayout {
231 Layout.fillWidth: true
232 CheckBox {
233 checked: panel.globalMenus
234 onCheckedChanged: panel.globalMenus = checked
235 }
236 Label {
237 text: "Global Menus"
238 color: "white"
239 }
240 }
228 }241 }
229 }242 }
230243
@@ -251,6 +264,7 @@
251264
252 function init() {265 function init() {
253 panel.mode = "staged";266 panel.mode = "staged";
267 panel.globalMenus = true;
254 mouseEmulation.checked = true;268 mouseEmulation.checked = true;
255 panel.fullscreenMode = false;269 panel.fullscreenMode = false;
256 callManager.foregroundCall = null;270 callManager.foregroundCall = null;
@@ -269,12 +283,13 @@
269 compare(windowControlButtonsSpy.valid, true);283 compare(windowControlButtonsSpy.valid, true);
270284
271 waitForRendering(panel);285 waitForRendering(panel);
286 waitForAllAnimationToComplete("initial");
272 }287 }
273288
274 function cleanup() {289 function cleanup() {
275 panel.indicators.hide();290 panel.indicators.hide();
276 panel.applicationMenus.hide();291 panel.applicationMenus.hide();
277 waitForAllAnimationToComplete("initial");292 mouseMove(panel, -1, -1);
278 }293 }
279294
280 function get_indicator_item(index) {295 function get_indicator_item(index) {
@@ -761,44 +776,67 @@
761 }776 }
762 }777 }
763778
764 function test_stagedApplicationMenuBarShowOnMouseHover() {779 function test_stagedApplicationMenuBarShowOnMouseHover_data() {
780 return [
781 { tag: "windowed-global", mode: "windowed", global: true },
782 { tag: "windowed-local", mode: "windowed", global: false },
783 { tag: "staged-global", mode: "staged", global: true },
784 { tag: "staged-local", mode: "staged", global: false },
785 ];
786 }
787
788 function test_stagedApplicationMenuBarShowOnMouseHover(data) {
765 PanelState.title = "Fake Title";789 PanelState.title = "Fake Title";
766 panel.mode = "staged";790 panel.mode = data.mode;
791 panel.globalMenus = data.global;
767 mouseEmulation.checked = false;792 mouseEmulation.checked = false;
768793
769 var appTitle = findChild(panel.applicationMenus, "panelTitle"); verify(appTitle);794 var panelTitle = findChild(panel, "panelTitle"); verify(panelTitle);
770 var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow);795 var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow);
771 var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar);796 var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar);
772797
773 tryCompare(appTitle, "visible", true, undefined, "App title should be visible");798 tryCompare(panelTitle, "visible", true, undefined, "App title should be visible");
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");
775800
776 mouseMove(panel, panel.width/2, panel.panelHeight);801 mouseMove(panel, panel.width/2, panel.panelHeight);
777802
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");
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");
780 }805
781806 mouseMove(panel, panel.width/2, panel.panelHeight * 2);
782 function test_windowedApplicationMenuShowOnMouseHoverWhenDecorationsShown() {807
808 tryCompare(panelTitle, "visible", true, undefined, "App title should be visible");
809 tryCompare(appMenuBar, "visible", false, undefined, "App menu bar should not be visible");
810 }
811
812 function test_windowedApplicationMenuShowOnMouseHoverWhenDecorationsShown_data() {
813 return [
814 { tag: "global", global: true },
815 { tag: "local", global: false }
816 ];
817 }
818
819 function test_windowedApplicationMenuShowOnMouseHoverWhenDecorationsShown(data) {
783 PanelState.title = "Fake Title";820 PanelState.title = "Fake Title";
784 panel.mode = "windowed";821 panel.mode = "windowed";
822 panel.globalMenus = data.global;
785 mouseEmulation.checked = false;823 mouseEmulation.checked = false;
786824
787 var appTitle = findChild(panel.applicationMenus, "panelTitle"); verify(appTitle);825 var panelTitle = findChild(panel, "panelTitle"); verify(panelTitle);
788 var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow);826 var appMenuRow = findChild(panel.applicationMenus, "panelRow"); verify(appMenuRow);
789 var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar);827 var appMenuBar = findChild(panel, "menuBar"); verify(appMenuBar);
790828
791 tryCompare(appTitle, "visible", true, undefined, "App title should be visible");829 tryCompare(panelTitle, "visible", true, undefined, "App title should be visible");
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");
793831
794 mouseMove(panel, panel.width/2, panel.panelHeight);832 mouseMove(panel, panel.width/2, panel.panelHeight);
795833
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");
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");
798836
799 PanelState.decorationsVisible = true;837 PanelState.decorationsVisible = true;
800838
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");
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");
803 }841 }
804842
805843
=== modified file 'tests/qmltests/Stage/tst_DesktopStage.qml'
--- tests/qmltests/Stage/tst_DesktopStage.qml 2017-01-10 14:44:29 +0000
+++ tests/qmltests/Stage/tst_DesktopStage.qml 2017-01-26 14:02:24 +0000
@@ -84,6 +84,7 @@
84 property bool itemDestroyed: false84 property bool itemDestroyed: false
85 sourceComponent: Component {85 sourceComponent: Component {
86 Stage {86 Stage {
87 globalMenus: false
87 anchors.fill: parent88 anchors.fill: parent
88 background: "/usr/share/backgrounds/warty-final-ubuntu.png"89 background: "/usr/share/backgrounds/warty-final-ubuntu.png"
89 focus: true90 focus: true
9091
=== modified file 'tests/qmltests/tst_Shell.qml'
--- tests/qmltests/tst_Shell.qml 2017-01-24 07:43:54 +0000
+++ tests/qmltests/tst_Shell.qml 2017-01-26 14:02:24 +0000
@@ -308,6 +308,19 @@
308 }308 }
309 }309 }
310310
311 Row {
312 anchors { left: parent.left; right: parent.right }
313 CheckBox {
314 checked: GSettingsController.enableGlobalMenus
315 onCheckedChanged: {
316 GSettingsController.setEnableGlobalMenus(checked)
317 }
318 }
319 Label {
320 text: "Enable Global Menus"
321 }
322 }
323
311 Label { text: "Applications"; font.bold: true }324 Label { text: "Applications"; font.bold: true }
312325
313 Button {326 Button {
@@ -2744,7 +2757,7 @@
2744 loadShell(data.tag);2757 loadShell(data.tag);
27452758
2746 var panel = findChild(shell, "panel"); verify(panel);2759 var panel = findChild(shell, "panel"); verify(panel);
2747 var panelTitle = findChild(panel.applicationMenus, "panelTitle"); verify(panelTitle);2760 var panelTitle = findChild(panel, "panelTitle"); verify(panelTitle);
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");
27492762
2750 swipeAwayGreeter();2763 swipeAwayGreeter();

Subscribers

People subscribed via source and target branches