Merge lp:~faenil/ubuntu-ui-toolkit/moreListItemLayoutDocs_again into lp:ubuntu-ui-toolkit/staging

Proposed by Andrea Bernabei
Status: Merged
Approved by: Andrea Bernabei
Approved revision: 1829
Merged at revision: 2042
Proposed branch: lp:~faenil/ubuntu-ui-toolkit/moreListItemLayoutDocs_again
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 54 lines (+24/-2)
2 files modified
src/Ubuntu/UbuntuToolkit/uclistitemlayout.cpp (+22/-0)
src/Ubuntu/UbuntuToolkit/ucslotslayout.cpp (+2/-2)
To merge this branch: bzr merge lp:~faenil/ubuntu-ui-toolkit/moreListItemLayoutDocs_again
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+300928@code.launchpad.net

Commit message

ListItemLayout doc: add explicit note about the need to bind ListItem's height to layout's height

To post a comment you must log in.
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: Needs Fixing (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: Needs Fixing (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: 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: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

Lovely addition!

review: Approve
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: 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)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/Ubuntu/UbuntuToolkit/uclistitemlayout.cpp'
2--- src/Ubuntu/UbuntuToolkit/uclistitemlayout.cpp 2016-07-18 17:18:13 +0000
3+++ src/Ubuntu/UbuntuToolkit/uclistitemlayout.cpp 2016-07-22 18:17:27 +0000
4@@ -64,6 +64,28 @@
5 we made it possible to tweak the position of each slot by modifying
6 its attached properties (see \l {Advanced layout tweaks}).
7
8+ \b Note that if you're wrapping the ListItemLayout in a container such
9+ as \l {ListItem}, \b {you will have to specify the height of the container so that
10+ it follows ListItemLayout's height}, otherwise the layout content may appear clipped or
11+ not vertically centered.
12+
13+ See \b {\l {Resizing the layout} {here}} for more details. Here's an example:
14+ \qml
15+ import QtQuick 2.4
16+ import Ubuntu.Component 1.3
17+ ListItem {
18+ //CORRECT, ListItem will be tall enough to accomodate all the content
19+ height: layout.height + (divider.visible ? divider.height : 0)
20+
21+ ListItemLayout {
22+ id: layout
23+ title.text: "Hello developers!"
24+ subtitle.text: "I am a ListItemLayout"
25+ summary.text: "I resize automatically to accomodate all the elements I hold. My parents should track my height property!"
26+ }
27+ }
28+ \endqml
29+
30 If you need a progression symbol in your list item,
31 just add \l ProgressionSlot as a child of your ListItemLayout.
32 No manual positioning is needed, the layout will handle it for you.
33
34=== modified file 'src/Ubuntu/UbuntuToolkit/ucslotslayout.cpp'
35--- src/Ubuntu/UbuntuToolkit/ucslotslayout.cpp 2016-07-07 08:42:42 +0000
36+++ src/Ubuntu/UbuntuToolkit/ucslotslayout.cpp 2016-07-22 18:17:27 +0000
37@@ -703,7 +703,7 @@
38 \qml
39 ListItem {
40 //CORRECT
41- height: layout.height + divider.height
42+ height: layout.height + (divider.visible ? divider.height : 0)
43
44 SlotsLayout {
45 id: layout
46@@ -765,7 +765,7 @@
47
48 \qml
49 ListItem {
50- height: layout.height + divider.height
51+ height: layout.height + (divider.visible ? divider.height : 0)
52 onClicked: console.log("clicked!")
53
54 SlotsLayout {

Subscribers

People subscribed via source and target branches