Merge lp:~dandrader/unity8/refactorWindowDecoration into lp:unity8

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Michael Zanetti
Approved revision: 2676
Merged at revision: 2713
Proposed branch: lp:~dandrader/unity8/refactorWindowDecoration
Merge into: lp:unity8
Diff against target: 75 lines (+20/-9)
3 files modified
qml/Stage/DecoratedWindow.qml (+1/-1)
qml/Stage/Stage.qml (+15/-3)
qml/Stage/WindowDecoration.qml (+4/-5)
To merge this branch: bzr merge lp:~dandrader/unity8/refactorWindowDecoration
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+310528@code.launchpad.net

Commit message

There's no need for WindowDecoration to access the appDelegate

It damages modularity.

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, in "make tryDesktopStage".

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

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

To post a comment you must log in.
Revision history for this message
Michael Zanetti (mzanetti) wrote :

would it make sense to have closeButtonVisible to be just an alias instead of its own property?

apart from that, definitely +1 from here.

review: Needs Information
2676. By Daniel d'Andrada

Make it an alias

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> would it make sense to have closeButtonVisible to be just an alias instead of
> its own property?
>
> apart from that, definitely +1 from here.

That works as well. Done.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

tested. works fine. +1 on the code.

waiting for CI before top-approving

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

FAILED: Continuous integration, rev:2675
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2481/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3273
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1872
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1872
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/1872
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3301
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3155
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3155/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3155
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3155/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3155
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3155/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3155
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3155/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3155
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3155/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3155
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3155/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3155
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3155/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3155
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3155/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3155
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3155/artifact/output/*zip*/output.zip

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

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

FAILED: Continuous integration, rev:2676
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2482/
Executed test runs:
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build/3274/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3302
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3156/artifact/output/*zip*/output.zip
    FAILURE: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3156/console
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3156/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3156
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3156/artifact/output/*zip*/output.zip

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

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

PASSED: Continuous integration, rev:2676
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2483/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3275
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1873
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1873
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/1873
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3303
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3157
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3157/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3157
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3157/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3157
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3157/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3157
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3157/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3157
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3157/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3157
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3157/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3157
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3157/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3157
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3157/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3157
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3157/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

the failure seems unrelated... top-approving

review: Approve
Revision history for this message
Michael Zanetti (mzanetti) wrote :

actually it even passed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Stage/DecoratedWindow.qml'
--- qml/Stage/DecoratedWindow.qml 2016-10-07 11:20:09 +0000
+++ qml/Stage/DecoratedWindow.qml 2016-11-10 13:16:55 +0000
@@ -149,7 +149,7 @@
149149
150 WindowDecoration {150 WindowDecoration {
151 id: decoration151 id: decoration
152 target: root.parent || null152 closeButtonVisible: root.application.appId !== "unity8-dash"
153 objectName: "appWindowDecoration"153 objectName: "appWindowDecoration"
154 anchors { left: parent.left; top: parent.top; right: parent.right }154 anchors { left: parent.left; top: parent.top; right: parent.right }
155 height: units.gu(3)155 height: units.gu(3)
156156
=== modified file 'qml/Stage/Stage.qml'
--- qml/Stage/Stage.qml 2016-10-24 11:34:20 +0000
+++ qml/Stage/Stage.qml 2016-11-10 13:16:55 +0000
@@ -1467,9 +1467,21 @@
1467 onRequestedHeightChanged: oldRequestedHeight = requestedHeight1467 onRequestedHeightChanged: oldRequestedHeight = requestedHeight
14681468
1469 onCloseClicked: { appDelegate.close(); }1469 onCloseClicked: { appDelegate.close(); }
1470 onMaximizeClicked: appDelegate.anyMaximized ? appDelegate.restoreFromMaximized() : appDelegate.maximize();1470 onMaximizeClicked: {
1471 onMaximizeHorizontallyClicked: appDelegate.maximizedHorizontally ? appDelegate.restoreFromMaximized() : appDelegate.maximizeHorizontally()1471 if (appDelegate.canBeMaximized) {
1472 onMaximizeVerticallyClicked: appDelegate.maximizedVertically ? appDelegate.restoreFromMaximized() : appDelegate.maximizeVertically()1472 appDelegate.anyMaximized ? appDelegate.restoreFromMaximized() : appDelegate.maximize();
1473 }
1474 }
1475 onMaximizeHorizontallyClicked: {
1476 if (appDelegate.canBeMaximizedHorizontally) {
1477 appDelegate.maximizedHorizontally ? appDelegate.restoreFromMaximized() : appDelegate.maximizeHorizontally()
1478 }
1479 }
1480 onMaximizeVerticallyClicked: {
1481 if (appDelegate.canBeMaximizedVertically) {
1482 appDelegate.maximizedVertically ? appDelegate.restoreFromMaximized() : appDelegate.maximizeVertically()
1483 }
1484 }
1473 onMinimizeClicked: appDelegate.minimize()1485 onMinimizeClicked: appDelegate.minimize()
1474 onDecorationPressed: { appDelegate.focus = true; }1486 onDecorationPressed: { appDelegate.focus = true; }
1475 onDecorationReleased: fakeRectangle.commit();1487 onDecorationReleased: fakeRectangle.commit();
14761488
=== modified file 'qml/Stage/WindowDecoration.qml'
--- qml/Stage/WindowDecoration.qml 2016-09-22 10:33:39 +0000
+++ qml/Stage/WindowDecoration.qml 2016-11-10 13:16:55 +0000
@@ -22,7 +22,7 @@
22 id: root22 id: root
23 clip: true23 clip: true
2424
25 property Item target // appDelegate25 property alias closeButtonVisible: buttons.closeButtonShown
26 property alias title: titleLabel.text26 property alias title: titleLabel.text
27 property alias maximizeButtonShown: buttons.maximizeButtonShown27 property alias maximizeButtonShown: buttons.maximizeButtonShown
28 property bool active: false28 property bool active: false
@@ -40,7 +40,7 @@
40 signal maximizeVerticallyClicked()40 signal maximizeVerticallyClicked()
4141
42 onDoubleClicked: {42 onDoubleClicked: {
43 if (target.canBeMaximized && mouse.button == Qt.LeftButton) {43 if (mouse.button == Qt.LeftButton) {
44 root.maximizeClicked();44 root.maximizeClicked();
45 }45 }
46 }46 }
@@ -77,9 +77,8 @@
77 onCloseClicked: root.closeClicked();77 onCloseClicked: root.closeClicked();
78 onMinimizeClicked: root.minimizeClicked();78 onMinimizeClicked: root.minimizeClicked();
79 onMaximizeClicked: root.maximizeClicked();79 onMaximizeClicked: root.maximizeClicked();
80 onMaximizeHorizontallyClicked: if (root.target.canBeMaximizedHorizontally) root.maximizeHorizontallyClicked();80 onMaximizeHorizontallyClicked: root.maximizeHorizontallyClicked();
81 onMaximizeVerticallyClicked: if (root.target.canBeMaximizedVertically) root.maximizeVerticallyClicked();81 onMaximizeVerticallyClicked: root.maximizeVerticallyClicked();
82 closeButtonShown: root.target.appId !== "unity8-dash"
83 }82 }
8483
85 Label {84 Label {

Subscribers

People subscribed via source and target branches