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
=== modified file 'src/UbuntuToolkit/ucslotslayout.cpp'
--- src/UbuntuToolkit/ucslotslayout.cpp 2016-09-09 17:49:07 +0000
+++ src/UbuntuToolkit/ucslotslayout.cpp 2016-09-27 21:51:14 +0000
@@ -51,8 +51,10 @@
5151
52 QObject::connect(&padding, SIGNAL(leadingChanged()), q, SLOT(_q_relayout()));52 QObject::connect(&padding, SIGNAL(leadingChanged()), q, SLOT(_q_relayout()));
53 QObject::connect(&padding, SIGNAL(trailingChanged()), q, SLOT(_q_relayout()));53 QObject::connect(&padding, SIGNAL(trailingChanged()), q, SLOT(_q_relayout()));
54 QObject::connect(&padding, SIGNAL(topChanged()), q, SLOT(_q_relayout()));54
55 QObject::connect(&padding, SIGNAL(bottomChanged()), q, SLOT(_q_relayout()));55 //we're assuming _q_updateSize will call _q_relayout()
56 QObject::connect(&padding, SIGNAL(topChanged()), q, SLOT(_q_updateSize()));
57 QObject::connect(&padding, SIGNAL(bottomChanged()), q, SLOT(_q_updateSize()));
5658
57 QObject::connect(UCUnits::instance(), SIGNAL(gridUnitChanged()), q, SLOT(_q_onGuValueChanged()));59 QObject::connect(UCUnits::instance(), SIGNAL(gridUnitChanged()), q, SLOT(_q_onGuValueChanged()));
5860
5961
=== modified file 'tests/unit/visual/tst_slotslayout.13.qml'
--- tests/unit/visual/tst_slotslayout.13.qml 2016-06-15 13:46:51 +0000
+++ tests/unit/visual/tst_slotslayout.13.qml 2016-09-27 21:51:14 +0000
@@ -158,6 +158,22 @@
158 Item { id: layoutCustomPadding_trailing2; SlotsLayout.position: SlotsLayout.Trailing; width: units.gu(3); height: units.gu(9) }158 Item { id: layoutCustomPadding_trailing2; SlotsLayout.position: SlotsLayout.Trailing; width: units.gu(3); height: units.gu(9) }
159 }159 }
160 ListItemLayout {160 ListItemLayout {
161 id: layoutCustomPaddingSet
162 title.text: "Test"
163 }
164 ListItemLayout {
165 id: layoutCustomPaddingChanges
166 readonly property var leadingSlots: []
167 readonly property var trailingSlots: []
168 padding {
169 top: units.gu(2)
170 bottom: units.gu(2)
171 leading: units.gu(2)
172 trailing: units.gu(2)
173 }
174 title.text: "Padded"
175 }
176 ListItemLayout {
161 id: layoutTestChangeSlotsSize177 id: layoutTestChangeSlotsSize
162 readonly property var leadingSlots: [layoutTestChangeSlotsSize_leading1]178 readonly property var leadingSlots: [layoutTestChangeSlotsSize_leading1]
163 readonly property var trailingSlots: []179 readonly property var trailingSlots: []
@@ -507,6 +523,41 @@
507 checkSlotsPosition(data.item)523 checkSlotsPosition(data.item)
508 }524 }
509525
526 function test_customPaddingSet_data(){
527 return [
528 { tag: "Custom padding top", item: layoutCustomPaddingSet, position: "top" },
529 { tag: "Custom padding bottom", item: layoutCustomPaddingSet, position: "bottom" },
530 { tag: "Custom padding leading", item: layoutCustomPaddingSet, position: "leading" },
531 { tag: "Custom padding trailing", item: layoutCustomPaddingSet, position: "trailing" },
532 ]
533 }
534
535 function test_customPaddingSet(data) {
536 var oldValue = data.item.padding[data.position]
537 var newValue = oldValue + units.gu(5)
538 data.item.padding[data.position] = newValue
539 compare(data.item.padding[data.position], newValue, "Changing "+data.position+"padding failed")
540 }
541
542 function test_customPaddingUpdatesHeight_data(){
543 return [
544 { tag: "Custom padding Smaller", item: layoutCustomPaddingChanges, padding: units.gu(1) },
545 { tag: "Custom padding Bigger", item: layoutCustomPaddingChanges, padding: units.gu(3) },
546 ]
547 }
548
549 function test_customPaddingUpdatesHeight(data) {
550 var initialHeight = data.item.height
551 data.item.padding.top = data.padding
552 compare(data.item.height, expectedImplicitHeight(data.item), "Changing top padding doesn't update height")
553 verify(data.item.height !== initialHeight)
554
555 initialHeight = data.item.height
556 data.item.padding.bottom = data.padding
557 compare(data.item.height, expectedImplicitHeight(data.item), "Changing bottom padding doesn't update height")
558 verify(data.item.height !== initialHeight)
559 }
560
510 function test_relayoutAfterChangingSlotsSize() {561 function test_relayoutAfterChangingSlotsSize() {
511 checkSlotsPosition(layoutTestChangeSlotsSize)562 checkSlotsPosition(layoutTestChangeSlotsSize)
512563

Subscribers

People subscribed via source and target branches