Merge lp:~aacid/unity8/previewButtonsDifferentWidth into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 2656
Merged at revision: 2681
Proposed branch: lp:~aacid/unity8/previewButtonsDifferentWidth
Merge into: lp:unity8
Diff against target: 130 lines (+49/-7)
3 files modified
qml/Dash/Previews/PreviewActionCombo.qml (+13/-2)
qml/Dash/Previews/PreviewActions.qml (+3/-2)
tests/qmltests/Dash/Previews/tst_PreviewActions.qml (+33/-3)
To merge this branch: bzr merge lp:~aacid/unity8/previewButtonsDifferentWidth
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
Unity8 CI Bot continuous-integration Approve
Review via email: mp+307828@code.launchpad.net

Commit message

Make the PreviewButtons be of the width of the button and not half the total width

half the total width is still the max width and the combos are still all the same width

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

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

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2656
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2333/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3071
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1717
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1717
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1717
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3099
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2956
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2956/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2956
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2956/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2956
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2956/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2956
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2956/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2956
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2956/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2956
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2956/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2956
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2956/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2956
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2956/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2956
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2956/artifact/output/*zip*/output.zip

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

review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

Code is fine, failures (I retriggered) shouldn't be related

 * Did you perform an exploratory manual test run of the code change and any related functionality?
y
 * Did CI run pass? If not, please explain why.
not related

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

PASSED: Continuous integration, rev:2656
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2341/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3081
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1727
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1727
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=qmluitests.sh/1727
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3109
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2966
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/2966/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2966
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/2966/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2966
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=yakkety/2966/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2966
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/2966/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2966
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/2966/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2966
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=yakkety/2966/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2966
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/2966/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2966
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/2966/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2966
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=yakkety/2966/artifact/output/*zip*/output.zip

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

review: Approve (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

I noticed that the buttons in the dash appear to have outer shadow - can we at least make them flat and remove the inset? aspect: UbuntuShape.Flat

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

The button doesn't really have an aspect, so that's hard to achieve with the current Ubuntu.Button component being used.

Revision history for this message
Andrea Cimitan (cimi) wrote :

We agreed to leave it this way until sdk adds different capability to the button component

review: Approve
2657. By Albert Astals Cid

Design wants more spacing

IMHO this should be part of the SDK button implicitWidth already, but oh well

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Dash/Previews/PreviewActionCombo.qml'
--- qml/Dash/Previews/PreviewActionCombo.qml 2016-04-01 13:20:27 +0000
+++ qml/Dash/Previews/PreviewActionCombo.qml 2016-11-02 16:47:23 +0000
@@ -21,6 +21,7 @@
21 id: root21 id: root
2222
23 implicitHeight: childrenRect.height23 implicitHeight: childrenRect.height
24 implicitWidth: Math.max(moreButton.implicitWidth, column.maxButtonImplicitWidth)
2425
25 signal triggeredAction(var actionData)26 signal triggeredAction(var actionData)
2627
@@ -39,14 +40,23 @@
39 }40 }
4041
41 Column {42 Column {
43 id: column
42 anchors {44 anchors {
43 top: moreButton.bottom45 top: moreButton.bottom
44 topMargin: height > 0 ? spacing : 046 topMargin: height > 0 ? spacing : 0
45 }47 }
46 objectName: "buttonColumn"48 objectName: "buttonColumn"
47 spacing: units.gu(1)49 spacing: units.gu(1)
48 width: parent.width
49 height: moreButton.expanded ? implicitHeight : 050 height: moreButton.expanded ? implicitHeight : 0
51
52 property real maxButtonImplicitWidth: 0
53 function calculateImplicitWidth() {
54 maxButtonImplicitWidth = 0;
55 for (var i in children) {
56 maxButtonImplicitWidth = Math.max(maxButtonImplicitWidth, children[i].implicitWidth);
57 }
58 }
59
50 clip: true60 clip: true
51 Behavior on height {61 Behavior on height {
52 UbuntuNumberAnimation {62 UbuntuNumberAnimation {
@@ -59,7 +69,8 @@
5969
60 delegate: PreviewActionButton {70 delegate: PreviewActionButton {
61 data: modelData71 data: modelData
62 width: implicitWidth < root.width ? root.width : implicitWidth72 width: root.width
73 onImplicitWidthChanged: column.calculateImplicitWidth();
63 onClicked: root.triggeredAction(modelData)74 onClicked: root.triggeredAction(modelData)
64 strokeColor: moreButton.strokeColor75 strokeColor: moreButton.strokeColor
65 }76 }
6677
=== modified file 'qml/Dash/Previews/PreviewActions.qml'
--- qml/Dash/Previews/PreviewActions.qml 2016-05-27 13:52:27 +0000
+++ qml/Dash/Previews/PreviewActions.qml 2016-11-02 16:47:23 +0000
@@ -27,6 +27,7 @@
2727
28 implicitHeight: row.height + units.gu(1)28 implicitHeight: row.height + units.gu(1)
29 readonly property var actions: root.widgetData ? root.widgetData["actions"] : null29 readonly property var actions: root.widgetData ? root.widgetData["actions"] : null
30 readonly property real maxButtonWidth: (width - units.gu(1)) / 2
3031
31 Row {32 Row {
32 id: row33 id: row
@@ -40,7 +41,7 @@
40 readonly property bool button: root.actions && root.actions.length == 241 readonly property bool button: root.actions && root.actions.length == 2
41 readonly property bool combo: root.actions && root.actions.length > 242 readonly property bool combo: root.actions && root.actions.length > 2
42 source: button ? "PreviewActionButton.qml" : (combo ? "PreviewActionCombo.qml" : "")43 source: button ? "PreviewActionButton.qml" : (combo ? "PreviewActionCombo.qml" : "")
43 width: (root.width - units.gu(1)) / 244 width: Math.min(root.maxButtonWidth, implicitWidth + units.gu(2))
44 onLoaded: {45 onLoaded: {
45 if (button) {46 if (button) {
46 item.data = Qt.binding(function() { return root.actions[1]; });47 item.data = Qt.binding(function() { return root.actions[1]; });
@@ -65,7 +66,7 @@
65 data: visible ? root.actions[0] : null66 data: visible ? root.actions[0] : null
66 visible: root.actions && root.actions.length > 067 visible: root.actions && root.actions.length > 0
67 onTriggeredAction: root.triggered(root.widgetId, actionData.id, actionData)68 onTriggeredAction: root.triggered(root.widgetId, actionData.id, actionData)
68 width: (root.width - units.gu(1)) / 269 width: Math.min(root.maxButtonWidth, implicitWidth + units.gu(2))
69 color: root.scopeStyle ? root.scopeStyle.previewButtonColor : theme.palette.normal.positive70 color: root.scopeStyle ? root.scopeStyle.previewButtonColor : theme.palette.normal.positive
70 }71 }
71 }72 }
7273
=== modified file 'tests/qmltests/Dash/Previews/tst_PreviewActions.qml'
--- tests/qmltests/Dash/Previews/tst_PreviewActions.qml 2016-08-23 12:45:36 +0000
+++ tests/qmltests/Dash/Previews/tst_PreviewActions.qml 2016-11-02 16:47:23 +0000
@@ -39,9 +39,27 @@
39 readonly property var actionDataFiveActions: {39 readonly property var actionDataFiveActions: {
40 "actions": [{"label": "Some Label C", "id": "someid3"},40 "actions": [{"label": "Some Label C", "id": "someid3"},
41 {"label": "Some Label D", "id": "someid4"},41 {"label": "Some Label D", "id": "someid4"},
42 {"label": "Some Label E", "id": "someid5"},42 {"label": "Some Longer Longer Longer Longer Label E", "id": "someid5"},
43 {"label": "Some Label F", "id": "someid6"},43 {"label": "Some Label F", "id": "someid6"},
44 {"label": "Some Label G", "id": "someid7"}44 {"label": "Some Label G", "id": "someid7"}
45 ]
46 }
47
48 readonly property var actionDataFiveActions2: {
49 "actions": [{"label": "Some Label C", "id": "someid3"},
50 {"label": "Some Label D", "id": "someid4"},
51 {"label": "Some E", "id": "someid5"},
52 {"label": "Some Label F", "id": "someid6"},
53 {"label": "Some Label G", "id": "someid7"}
54 ]
55 }
56
57 readonly property var actionDataFiveActions3: {
58 "actions": [{"label": "C", "id": "someid3"},
59 {"label": "D", "id": "someid4"},
60 {"label": "E", "id": "someid5"},
61 {"label": "F", "id": "someid6"},
62 {"label": "G", "id": "someid7"}
45 ]63 ]
46 }64 }
4765
@@ -91,6 +109,18 @@
91 }109 }
92110
93 PreviewActions {111 PreviewActions {
112 id: buttonAndCombo2
113 widgetData: actionDataFiveActions2
114 width: units.gu(40)
115 }
116
117 PreviewActions {
118 id: buttonAndCombo3
119 widgetData: actionDataFiveActions3
120 width: units.gu(40)
121 }
122
123 PreviewActions {
94 id: twoActions124 id: twoActions
95 widgetId: "2buttons"125 widgetId: "2buttons"
96 widgetData: actionDataTwoActions126 widgetData: actionDataTwoActions

Subscribers

People subscribed via source and target branches