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
1=== modified file 'components.api'
2--- components.api 2014-08-20 13:03:13 +0000
3+++ components.api 2014-08-27 09:30:36 +0000
4@@ -193,6 +193,7 @@
5 property string subText
6 ThinDivider 0.1 1.0
7 Rectangle
8+ property bool __lightBackground
9 ValueSelector 0.1 1.0
10 Empty
11 property variant icon
12
13=== modified file 'modules/Ubuntu/Components/ListItems/ThinDivider.qml'
14--- modules/Ubuntu/Components/ListItems/ThinDivider.qml 2014-05-20 07:03:31 +0000
15+++ modules/Ubuntu/Components/ListItems/ThinDivider.qml 2014-08-27 09:30:36 +0000
16@@ -15,6 +15,7 @@
17 */
18
19 import QtQuick 2.0
20+import Ubuntu.Components 1.0
21
22 /*!
23 \qmltype ThinDivider
24@@ -48,10 +49,19 @@
25 anchors {
26 left: (parent) ? parent.left : null
27 right: (parent) ? parent.right : null
28+ leftMargin: units.gu(2)
29+ rightMargin: units.gu(2)
30 }
31 height: (visible) ? units.dp(2) : 0
32+ // a private property to catch theme background color change
33+ // use private property instead of embedding it into a QtObject to avoid further
34+ // performance decrease
35+ property bool __lightBackground: ColorUtils.luminance(Theme.palette.normal.background) > 0.85
36+ // use a gradient of 4 steps instead of instantiating two Rectangles for performance reasons
37 gradient: Gradient {
38- GradientStop { position: 0.0; color: "#26000000" }
39- GradientStop { position: 1.0; color: "#14F3F3E7" }
40+ GradientStop { position: 0.0; color: __lightBackground ? "#26000000" : "#26FFFFFF" }
41+ GradientStop { position: 0.49; color: __lightBackground ? "#26000000" : "#26FFFFFF" }
42+ GradientStop { position: 0.5; color: __lightBackground ? "#14FFFFFF" : "#14000000" }
43+ GradientStop { position: 1.0; color: __lightBackground ? "#14FFFFFF" : "#14000000" }
44 }
45 }

Subscribers

People subscribed via source and target branches