Merge lp:~seb128/ubuntu-system-settings/storage-bar-border into lp:ubuntu-system-settings

Proposed by Sebastien Bacher
Status: Merged
Approved by: Alberto Mardegan
Approved revision: 111
Merged at revision: 113
Proposed branch: lp:~seb128/ubuntu-system-settings/storage-bar-border
Merge into: lp:ubuntu-system-settings
Diff against target: 77 lines (+23/-21)
2 files modified
plugins/about/Storage.qml (+1/-2)
plugins/about/StorageBar.qml (+22/-19)
To merge this branch: bzr merge lp:~seb128/ubuntu-system-settings/storage-bar-border
Reviewer Review Type Date Requested Status
Alberto Mardegan Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+173672@code.launchpad.net

Commit message

storage: use a rectangle so we can have a border around the bar

Tweak some of the margins and vertical spaces as well to look a bit better
and be aligned on other elements

Description of the change

storage: use a rectangle so we can have a border around the bar

Tweak some of the margins and vertical spaces as well to look a bit better
and be aligned on other elements

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
Alberto Mardegan (mardy) wrote :

I'd prefer to use the anchors properties instead of assigning the width, that is instead of having:

 anchors.horizontalCenter: parent.horizontalCenter
 width: parent.width - units.gu(4)

have

 anchors.left: parent.left
 anchors.right: parent.right
 anchors.leftMargin: units.gu(2)
 anchors.rightMargin: anchors.leftMargin

which makes it more declarative, but it's just my preference.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'plugins/about/Storage.qml'
--- plugins/about/Storage.qml 2013-07-08 14:19:23 +0000
+++ plugins/about/Storage.qml 2013-07-09 08:53:28 +0000
@@ -62,7 +62,6 @@
62 }62 }
6363
64 StorageBar {64 StorageBar {
65 barHeight: units.gu(3)
66 colors: spaceColors65 colors: spaceColors
67 }66 }
6867
@@ -70,7 +69,7 @@
70 model: spaceColors69 model: spaceColors
71 Item {70 Item {
72 height: units.gu(3)71 height: units.gu(3)
73 width: parent.width*0.972 width: parent.width-units.gu(4)
74 anchors.horizontalCenter: parent.horizontalCenter73 anchors.horizontalCenter: parent.horizontalCenter
75 Row {74 Row {
76 spacing: units.gu(1)75 spacing: units.gu(1)
7776
=== modified file 'plugins/about/StorageBar.qml'
--- plugins/about/StorageBar.qml 2013-06-17 18:52:58 +0000
+++ plugins/about/StorageBar.qml 2013-07-09 08:53:28 +0000
@@ -2,30 +2,33 @@
2import Ubuntu.Components 0.12import Ubuntu.Components 0.1
33
4Item {4Item {
5 property int barHeight
6 property var colors5 property var colors
76
8 anchors.horizontalCenter: parent.horizontalCenter7 anchors.horizontalCenter: parent.horizontalCenter
9 width: parent.width*0.98 height: units.gu(5)
10 height: barHeight + 2*units.gu(1)9 width: parent.width - units.gu(4)
1110
12 Row {
13 id: spaceRow
14 Rectangle {
15 color: colors[1]
16 height: barHeight
17 width: 50
18 }
19 Rectangle {
20 color: colors[2]
21 height: barHeight
22 width: 30
23 }
24 }
25 Rectangle {11 Rectangle {
12 border.width: 1
26 color: colors[0]13 color: colors[0]
27 anchors.left: spaceRow.right14 height: units.gu(3)
28 anchors.right: parent.right15 width: parent.width
29 height: barHeight16
17 Row {
18 anchors.centerIn: parent
19 height: parent.height-2
20 width: parent.width-2
21 Rectangle {
22 color: colors[1]
23 height: parent.height
24 width: 50
25 }
26 Rectangle {
27 color: colors[2]
28 height: parent.height
29 width: 30
30 }
31 }
32
30 }33 }
31}34}

Subscribers

People subscribed via source and target branches