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
1=== modified file 'plugins/about/Storage.qml'
2--- plugins/about/Storage.qml 2013-07-08 14:19:23 +0000
3+++ plugins/about/Storage.qml 2013-07-09 08:53:28 +0000
4@@ -62,7 +62,6 @@
5 }
6
7 StorageBar {
8- barHeight: units.gu(3)
9 colors: spaceColors
10 }
11
12@@ -70,7 +69,7 @@
13 model: spaceColors
14 Item {
15 height: units.gu(3)
16- width: parent.width*0.9
17+ width: parent.width-units.gu(4)
18 anchors.horizontalCenter: parent.horizontalCenter
19 Row {
20 spacing: units.gu(1)
21
22=== modified file 'plugins/about/StorageBar.qml'
23--- plugins/about/StorageBar.qml 2013-06-17 18:52:58 +0000
24+++ plugins/about/StorageBar.qml 2013-07-09 08:53:28 +0000
25@@ -2,30 +2,33 @@
26 import Ubuntu.Components 0.1
27
28 Item {
29- property int barHeight
30 property var colors
31
32 anchors.horizontalCenter: parent.horizontalCenter
33- width: parent.width*0.9
34- height: barHeight + 2*units.gu(1)
35+ height: units.gu(5)
36+ width: parent.width - units.gu(4)
37
38- Row {
39- id: spaceRow
40- Rectangle {
41- color: colors[1]
42- height: barHeight
43- width: 50
44- }
45- Rectangle {
46- color: colors[2]
47- height: barHeight
48- width: 30
49- }
50- }
51 Rectangle {
52+ border.width: 1
53 color: colors[0]
54- anchors.left: spaceRow.right
55- anchors.right: parent.right
56- height: barHeight
57+ height: units.gu(3)
58+ width: parent.width
59+
60+ Row {
61+ anchors.centerIn: parent
62+ height: parent.height-2
63+ width: parent.width-2
64+ Rectangle {
65+ color: colors[1]
66+ height: parent.height
67+ width: 50
68+ }
69+ Rectangle {
70+ color: colors[2]
71+ height: parent.height
72+ width: 30
73+ }
74+ }
75+
76 }
77 }

Subscribers

People subscribed via source and target branches