Merge lp:~3v1n0/ubuntu-ui-toolkit/slotslayout-paddings-changes-updates-size into lp:ubuntu-ui-toolkit/staging

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Bernabei
Approved revision: 2135
Merged at revision: 2132
Proposed branch: lp:~3v1n0/ubuntu-ui-toolkit/slotslayout-paddings-changes-updates-size
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 84 lines (+55/-2)
2 files modified
src/UbuntuToolkit/ucslotslayout.cpp (+4/-2)
tests/unit/visual/tst_slotslayout.13.qml (+51/-0)
To merge this branch: bzr merge lp:~3v1n0/ubuntu-ui-toolkit/slotslayout-paddings-changes-updates-size
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Andrea Bernabei (community) Approve
Review via email: mp+306907@code.launchpad.net

This proposal supersedes a proposal from 2016-09-27.

Commit message

UCSlotsLayout: update the size of the element when top/bottom paddings change

Description of the change

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

No

* Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

Yep

* Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

Yes, tested with testcase too:
  https://launchpadlibrarian.net/286902679/listitem-height-size-changes.qml

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/ui-toolkit) on device or emulator?

Yes

If you changed the UI, was the change specified/approved by design?

N/A

If you changed the packaging (debian), did you subscribe a core-dev to this MP?

N/A

To post a comment you must log in.
Revision history for this message
Andrea Bernabei (faenil) wrote :

thanks for the MR! I left a comment :)

Revision history for this message
Andrea Bernabei (faenil) wrote :

great! thanks a lot Marco!

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

It seems armhf has some troubles:

[sudo] password for phablet: sudo: pbuilder: command not found

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

armhf is probably alright, and will be rerun if this will be top-approved.

Our arale killed itself it seems (and it tries to do that quite often, now it may have succeeded).

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/UbuntuToolkit/ucslotslayout.cpp'
2--- src/UbuntuToolkit/ucslotslayout.cpp 2016-09-09 17:49:07 +0000
3+++ src/UbuntuToolkit/ucslotslayout.cpp 2016-09-27 21:51:14 +0000
4@@ -51,8 +51,10 @@
5
6 QObject::connect(&padding, SIGNAL(leadingChanged()), q, SLOT(_q_relayout()));
7 QObject::connect(&padding, SIGNAL(trailingChanged()), q, SLOT(_q_relayout()));
8- QObject::connect(&padding, SIGNAL(topChanged()), q, SLOT(_q_relayout()));
9- QObject::connect(&padding, SIGNAL(bottomChanged()), q, SLOT(_q_relayout()));
10+
11+ //we're assuming _q_updateSize will call _q_relayout()
12+ QObject::connect(&padding, SIGNAL(topChanged()), q, SLOT(_q_updateSize()));
13+ QObject::connect(&padding, SIGNAL(bottomChanged()), q, SLOT(_q_updateSize()));
14
15 QObject::connect(UCUnits::instance(), SIGNAL(gridUnitChanged()), q, SLOT(_q_onGuValueChanged()));
16
17
18=== modified file 'tests/unit/visual/tst_slotslayout.13.qml'
19--- tests/unit/visual/tst_slotslayout.13.qml 2016-06-15 13:46:51 +0000
20+++ tests/unit/visual/tst_slotslayout.13.qml 2016-09-27 21:51:14 +0000
21@@ -158,6 +158,22 @@
22 Item { id: layoutCustomPadding_trailing2; SlotsLayout.position: SlotsLayout.Trailing; width: units.gu(3); height: units.gu(9) }
23 }
24 ListItemLayout {
25+ id: layoutCustomPaddingSet
26+ title.text: "Test"
27+ }
28+ ListItemLayout {
29+ id: layoutCustomPaddingChanges
30+ readonly property var leadingSlots: []
31+ readonly property var trailingSlots: []
32+ padding {
33+ top: units.gu(2)
34+ bottom: units.gu(2)
35+ leading: units.gu(2)
36+ trailing: units.gu(2)
37+ }
38+ title.text: "Padded"
39+ }
40+ ListItemLayout {
41 id: layoutTestChangeSlotsSize
42 readonly property var leadingSlots: [layoutTestChangeSlotsSize_leading1]
43 readonly property var trailingSlots: []
44@@ -507,6 +523,41 @@
45 checkSlotsPosition(data.item)
46 }
47
48+ function test_customPaddingSet_data(){
49+ return [
50+ { tag: "Custom padding top", item: layoutCustomPaddingSet, position: "top" },
51+ { tag: "Custom padding bottom", item: layoutCustomPaddingSet, position: "bottom" },
52+ { tag: "Custom padding leading", item: layoutCustomPaddingSet, position: "leading" },
53+ { tag: "Custom padding trailing", item: layoutCustomPaddingSet, position: "trailing" },
54+ ]
55+ }
56+
57+ function test_customPaddingSet(data) {
58+ var oldValue = data.item.padding[data.position]
59+ var newValue = oldValue + units.gu(5)
60+ data.item.padding[data.position] = newValue
61+ compare(data.item.padding[data.position], newValue, "Changing "+data.position+"padding failed")
62+ }
63+
64+ function test_customPaddingUpdatesHeight_data(){
65+ return [
66+ { tag: "Custom padding Smaller", item: layoutCustomPaddingChanges, padding: units.gu(1) },
67+ { tag: "Custom padding Bigger", item: layoutCustomPaddingChanges, padding: units.gu(3) },
68+ ]
69+ }
70+
71+ function test_customPaddingUpdatesHeight(data) {
72+ var initialHeight = data.item.height
73+ data.item.padding.top = data.padding
74+ compare(data.item.height, expectedImplicitHeight(data.item), "Changing top padding doesn't update height")
75+ verify(data.item.height !== initialHeight)
76+
77+ initialHeight = data.item.height
78+ data.item.padding.bottom = data.padding
79+ compare(data.item.height, expectedImplicitHeight(data.item), "Changing bottom padding doesn't update height")
80+ verify(data.item.height !== initialHeight)
81+ }
82+
83 function test_relayoutAfterChangingSlotsSize() {
84 checkSlotsPosition(layoutTestChangeSlotsSize)
85

Subscribers

People subscribed via source and target branches