Merge lp:~zsombi/ubuntu-ui-toolkit/thindivider-fix into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri
Status: Merged
Approved by: Cris Dywan
Approved revision: 1220
Merged at revision: 1223
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/thindivider-fix
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 45 lines (+13/-2)
2 files modified
components.api (+1/-0)
modules/Ubuntu/Components/ListItems/ThinDivider.qml (+12/-2)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/thindivider-fix
Reviewer Review Type Date Requested Status
Cris Dywan Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+232227@code.launchpad.net

Commit message

Thin divider adjustments.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

This shouldn't be a public property. Please move it into a QtObject { id: internal }

review: Needs Fixing
Revision history for this message
Zsombor Egri (zsombi) wrote :

> This shouldn't be a public property. Please move it into a QtObject { id:
> internal }

It could be placed in an internal QtObject, but that would decrease the performance of the list item is used in. That's why I had chosen a private property, and also not to make the design with two rectangles but a 4step gradient.

1220. By Zsombor Egri

comments reasoning the change added

Revision history for this message
Cris Dywan (kalikiana) wrote :

Makes sense. Thanks for clarification and adding the code comments!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2014-08-20 13:03:13 +0000
+++ components.api 2014-08-27 09:30:36 +0000
@@ -193,6 +193,7 @@
193 property string subText193 property string subText
194ThinDivider 0.1 1.0194ThinDivider 0.1 1.0
195Rectangle195Rectangle
196 property bool __lightBackground
196ValueSelector 0.1 1.0197ValueSelector 0.1 1.0
197Empty198Empty
198 property variant icon199 property variant icon
199200
=== modified file 'modules/Ubuntu/Components/ListItems/ThinDivider.qml'
--- modules/Ubuntu/Components/ListItems/ThinDivider.qml 2014-05-20 07:03:31 +0000
+++ modules/Ubuntu/Components/ListItems/ThinDivider.qml 2014-08-27 09:30:36 +0000
@@ -15,6 +15,7 @@
15 */15 */
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.0
1819
19/*!20/*!
20 \qmltype ThinDivider21 \qmltype ThinDivider
@@ -48,10 +49,19 @@
48 anchors {49 anchors {
49 left: (parent) ? parent.left : null50 left: (parent) ? parent.left : null
50 right: (parent) ? parent.right : null51 right: (parent) ? parent.right : null
52 leftMargin: units.gu(2)
53 rightMargin: units.gu(2)
51 }54 }
52 height: (visible) ? units.dp(2) : 055 height: (visible) ? units.dp(2) : 0
56 // a private property to catch theme background color change
57 // use private property instead of embedding it into a QtObject to avoid further
58 // performance decrease
59 property bool __lightBackground: ColorUtils.luminance(Theme.palette.normal.background) > 0.85
60 // use a gradient of 4 steps instead of instantiating two Rectangles for performance reasons
53 gradient: Gradient {61 gradient: Gradient {
54 GradientStop { position: 0.0; color: "#26000000" }62 GradientStop { position: 0.0; color: __lightBackground ? "#26000000" : "#26FFFFFF" }
55 GradientStop { position: 1.0; color: "#14F3F3E7" }63 GradientStop { position: 0.49; color: __lightBackground ? "#26000000" : "#26FFFFFF" }
64 GradientStop { position: 0.5; color: __lightBackground ? "#14FFFFFF" : "#14000000" }
65 GradientStop { position: 1.0; color: __lightBackground ? "#14FFFFFF" : "#14000000" }
56 }66 }
57}67}

Subscribers

People subscribed via source and target branches