Merge lp:~nik90/ureadit/beautify-post-listing into lp:~mhall119/ureadit/2.0

Proposed by Nekhelesh Ramananthan on 2015-01-12
Status: Approved
Approved by: Michael Hall on 2015-07-24
Approved revision: 23
Proposed branch: lp:~nik90/ureadit/beautify-post-listing
Merge into: lp:~mhall119/ureadit/2.0
Diff against target: 221 lines (+61/-27)
3 files modified
components/SmallImagePostItem.qml (+36/-16)
components/UserMessageItem.qml (+24/-11)
ui/UserMessagesPage.qml (+1/-0)
To merge this branch: bzr merge lp:~nik90/ureadit/beautify-post-listing
Reviewer Review Type Date Requested Status
Michael Hall 2015-01-12 Approve on 2015-07-24
Review via email: mp+246183@code.launchpad.net

Commit message

This MP adds spacing and margins for the SmallImagePostItem.qml to get a more spacious feel.

Description of the change

This MP adds spacing and margins for the SmallImagePostItem.qml to get a more spacious feel.

Here is how it looks now,
- http://imgur.com/FLcVyen
- http://imgur.com/Lj4VqWb

To post a comment you must log in.
22. By Nekhelesh Ramananthan on 2015-01-13

Merged parent branch

23. By Nekhelesh Ramananthan on 2015-01-13

Applied similar beautification of the user messages page

Michael Hall (mhall119) wrote :

Very late in reviewing and merging this, sorry about that, thanks for the improvements

review: Approve

Unmerged revisions

23. By Nekhelesh Ramananthan on 2015-01-13

Applied similar beautification of the user messages page

22. By Nekhelesh Ramananthan on 2015-01-13

Merged parent branch

21. By Nekhelesh Ramananthan on 2015-01-12

Added margins and spacing to beautify small image post items

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components/SmallImagePostItem.qml'
2--- components/SmallImagePostItem.qml 2015-01-09 15:31:22 +0000
3+++ components/SmallImagePostItem.qml 2015-01-13 13:04:48 +0000
4@@ -3,6 +3,7 @@
5
6 Item {
7 id: postitemroot
8+
9 property string title: parent.title
10 property string text: parent.text
11 property string score: parent.score
12@@ -19,6 +20,8 @@
13 Rectangle {
14 color: "#222222"
15 anchors.fill: parent
16+ anchors.leftMargin: units.gu(1)
17+ anchors.rightMargin: units.gu(1)
18 border.color: "#111111"
19 Image {
20 id: postThumbnail
21@@ -37,10 +40,14 @@
22
23 Label {
24 id: titleLabel
25- anchors.left: postThumbnail.right
26- anchors.leftMargin: units.gu(1)
27- anchors.right: parent.right
28- y: parent.y
29+
30+ anchors {
31+ top: parent.top
32+ topMargin: units.gu(1)
33+ left: postThumbnail.right
34+ leftMargin: units.gu(1)
35+ right: parent.right
36+ }
37
38 fontSize: "medium"
39 font.weight: Font.DemiBold
40@@ -51,6 +58,7 @@
41 wrapMode: Text.WordWrap
42
43 text: postitemroot.title
44+
45 MouseArea {
46 anchors.fill: parent
47 onClicked: postitemroot.parent.clicked()
48@@ -59,10 +67,14 @@
49
50 Label {
51 id: authorLabel
52- anchors.left: postThumbnail.right
53- anchors.leftMargin: units.gu(1)
54- anchors.top: titleLabel.bottom
55- anchors.right: domainLabel.left
56+
57+ anchors {
58+ top: titleLabel.bottom
59+ topMargin: units.gu(1)
60+ left: postThumbnail.right
61+ leftMargin: units.gu(1)
62+ right: domainLabel.left
63+ }
64
65 fontSize: "small"
66 font.weight: Font.Light
67@@ -74,9 +86,13 @@
68
69 Label {
70 id: domainLabel
71- anchors.right: parent.right
72- anchors.rightMargin: units.gu(1)
73- anchors.top: titleLabel.bottom
74+
75+ anchors {
76+ right: parent.right
77+ rightMargin: units.gu(1)
78+ top: titleLabel.bottom
79+ topMargin: units.gu(1)
80+ }
81
82 fontSize: "small"
83 font.weight: Font.Light
84@@ -86,11 +102,15 @@
85
86 Label {
87 id: selfTextLabel
88- anchors.left: postThumbnail.right
89- anchors.leftMargin: units.gu(1)
90- anchors.right: parent.right
91- anchors.top: authorLabel.bottom
92- anchors.bottom: actionsRow.top
93+
94+ anchors {
95+ left: postThumbnail.right
96+ leftMargin: units.gu(1)
97+ right: parent.right
98+ top: authorLabel.bottom
99+ topMargin: units.gu(1)
100+ bottom: actionsRow.top
101+ }
102
103 fontSize: "small"
104 font.weight: Font.Light
105
106=== modified file 'components/UserMessageItem.qml'
107--- components/UserMessageItem.qml 2015-01-13 03:09:22 +0000
108+++ components/UserMessageItem.qml 2015-01-13 13:04:48 +0000
109@@ -5,14 +5,19 @@
110
111 Rectangle {
112 id: userMessageItem
113+
114 property var messageObj
115- color: UbuntuColors.darkGrey
116 property string score: parent.score
117 property var likes: parent.likes
118
119- width: parent.width
120+ color: UbuntuColors.darkGrey
121 height: childrenRect.height
122- anchors.horizontalCenter: parent.horizontalCenter
123+
124+ anchors {
125+ left: parent.left
126+ right: parent.right
127+ margins: units.gu(1)
128+ }
129
130 signal clicked
131 signal upvoteClicked
132@@ -31,17 +36,23 @@
133
134 Column {
135 id: messageContents
136- anchors.topMargin: units.gu(1)
137- anchors.left: parent.left
138- anchors.leftMargin: units.gu(1)
139- anchors.right: parent.right
140+
141+ anchors {
142+ top: parent.top
143+ left: parent.left
144+ right: parent.right
145+ margins: units.gu(1)
146+ }
147+
148 spacing: units.gu(1)
149+
150 Label {
151 id: title
152 anchors.left: parent.left
153- anchors.topMargin: units.gu(1)
154+ anchors.right: parent.right
155 color: 'lightblue'
156 fontSize: "medium"
157+ wrapMode: Text.WordWrap
158 font.weight: messageObj.data.new ? Font.Bold : Font.Normal
159 text: messageObj && messageObj.data.link_title ? messageObj.data.link_title : ""
160 visible: messageObj ? (messageObj.kind === "t1" || messageObj.kind === "t3") : false
161@@ -50,7 +61,6 @@
162 Label {
163 id: name
164 anchors.left: parent.left
165- anchors.topMargin: units.gu(1)
166 color: Qt.darker(UbuntuColors.warmGrey, 1.5)
167 fontSize: "small"
168 text: messageObj ? messageObj.data.author : ""
169@@ -59,7 +69,7 @@
170
171 Label {
172 id: body
173- width: parent.width - units.gu(depth+2)
174+ //width: parent.width - units.gu(depth+2)
175 wrapMode: Text.WordWrap
176 anchors.left: parent.left
177 anchors.right: parent.right
178@@ -80,13 +90,14 @@
179 id: actionsRow
180 anchors.left: messageContents.left
181 anchors.right: messageContents.right
182- height: units.gu(3)
183+ height: units.gu(5)
184
185 Icon {
186 x: 1*(messageContents.width / 3)-(messageContents.width / 6)-(width/2)
187 source: Qt.resolvedUrl("../images/upvote.png")
188 width: units.gu(2)
189 height: units.gu(2)
190+ anchors.verticalCenter: parent.verticalCenter
191 color: userMessageItem.likes === true ? UbuntuColors.orange : UbuntuColors.warmGrey
192
193 MouseArea {
194@@ -101,6 +112,7 @@
195 source: Qt.resolvedUrl("../images/downvote.png")
196 width: units.gu(2)
197 height: units.gu(2)
198+ anchors.verticalCenter: parent.verticalCenter
199 color: userMessageItem.likes === false ? UbuntuColors.blue : UbuntuColors.warmGrey
200
201 MouseArea {
202@@ -116,6 +128,7 @@
203 name: "new-message"
204 width: units.gu(2)
205 height: units.gu(2.5)
206+ anchors.verticalCenter: parent.verticalCenter
207 color: UbuntuColors.warmGrey
208
209 MouseArea {
210
211=== modified file 'ui/UserMessagesPage.qml'
212--- ui/UserMessagesPage.qml 2015-01-13 03:02:31 +0000
213+++ ui/UserMessagesPage.qml 2015-01-13 13:04:48 +0000
214@@ -22,6 +22,7 @@
215 ListView {
216 id: messagesList
217 anchors.fill: parent
218+ spacing: units.gu(1)
219
220 model: UserMessagesListModel {
221 id: commentsModel

Subscribers

People subscribed via source and target branches