Merge lp:~tiagosh/unity-2d/fix-categories-divider into lp:unity-2d

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 944
Merged at revision: 975
Proposed branch: lp:~tiagosh/unity-2d/fix-categories-divider
Merge into: lp:unity-2d
Diff against target: 135 lines (+43/-18)
3 files modified
shell/dash/CategoryHeader.qml (+16/-15)
shell/dash/Dash.qml (+0/-1)
shell/dash/LensView.qml (+27/-2)
To merge this branch: bzr merge lp:~tiagosh/unity-2d/fix-categories-divider
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
Albert Astals Cid (community) Approve
Xi Zhu (community) design Approve
Review via email: mp+94602@code.launchpad.net

Description of the change

[dash] display category dividers instead of header underlines

To post a comment you must log in.
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :
Revision history for this message
Xi Zhu (xi.zhu) wrote :

Hi, I had a looked at the the screenshots.

Here are some tweaks:

1.All category header should be 1px to the right.
2.The first category should be 3px down.
3.The 2nd & 3rd categories should be 2px down.
4.All dividers should be 15px away from each sides, so from the very left edge is: 64px(launcher)+1px(white line)+15px(gap) then its the start of divider.
5.Because all icons are sitting in a 64px invisible box, the bottom of the box to the bottom of divider is 64px (or you can say its 63px +1px line)
6.The top of icon title to the invisible box is 10px.

I attached the measurement file to the original bug link on the top, hope it would help.

And Thanks very much for all these work!

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

Thanks Rosie,

some more changes: http://ubuntuone.com/0E8k4WA577UvEwiPlRDgIA

Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :
Revision history for this message
Xi Zhu (xi.zhu) :
review: Approve (design)
Revision history for this message
Michał Sawicz (saviq) wrote :

You could possibly speed up the calculation by returning immediately when you find category == "0". There won't be any lower than that :)

review: Needs Fixing
Revision history for this message
Tiago Salem Herrmann (tiagosh) wrote :

good catch. just updated the branch.
Thanks.

Revision history for this message
Albert Astals Cid (aacid) wrote :

Looks good, nice to have Design people having a look at the screenshots :-)

review: Approve
Revision history for this message
Michał Sawicz (saviq) :
review: Approve
Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity-2d/185/console reported an error when processing this lp:~tiagosh/unity-2d/fix-categories-divider branch.
Not merging it.

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity-2d/187/console reported an error when processing this lp:~tiagosh/unity-2d/fix-categories-divider branch.
Not merging it.

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

now, the build environnement should install unity-common (for unity-2d only). Approving on behalf of the other approvals :)

Revision history for this message
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity-2d/189/console reported an error when processing this lp:~tiagosh/unity-2d/fix-categories-divider branch.
Not merging it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'shell/dash/CategoryHeader.qml'
2--- shell/dash/CategoryHeader.qml 2012-02-27 16:49:30 +0000
3+++ shell/dash/CategoryHeader.qml 2012-03-09 14:34:21 +0000
4@@ -36,6 +36,17 @@
5
6 Accessible.name: "%1 %2 %3".arg(title.text).arg(label.text).arg(folded ? u2d.tr("not expanded") : u2d.tr("expanded"))
7
8+ Rectangle {
9+ id: divider
10+
11+ visible: !isFirst
12+ color: "#21ffffff"
13+ height: 1
14+ anchors.top: parent.top
15+ anchors.left: parent.left
16+ anchors.right: parent.right
17+ }
18+
19 Image {
20 id: iconImage
21
22@@ -43,9 +54,10 @@
23
24 width: 22
25 height: 22
26- anchors.bottom: underline.top
27- anchors.bottomMargin: 5
28+ anchors.top: divider.bottom
29+ anchors.topMargin: 13
30 anchors.left: parent.left
31+ anchors.leftMargin: 4
32 fillMode: Image.PreserveAspectFit
33 sourceSize.width: width
34 sourceSize.height: height
35@@ -55,8 +67,8 @@
36 id: title
37
38 fontSize: "large"
39- anchors.baseline: underline.top
40- anchors.baselineOffset: -10
41+ anchors.top: divider.bottom
42+ anchors.topMargin: 13
43 anchors.left: iconImage.right
44 anchors.leftMargin: 8
45 }
46@@ -96,15 +108,4 @@
47 anchors.bottom: label.baseline
48 }
49 }
50-
51- Rectangle {
52- id: underline
53-
54- color: "#21ffffff"
55-
56- height: 1
57- anchors.bottom: parent.bottom
58- anchors.left: parent.left
59- anchors.right: parent.right
60- }
61 }
62
63=== modified file 'shell/dash/Dash.qml'
64--- shell/dash/Dash.qml 2012-02-27 10:47:50 +0000
65+++ shell/dash/Dash.qml 2012-03-09 14:34:21 +0000
66@@ -314,7 +314,6 @@
67 KeyNavigation.down: lensBar
68
69 anchors.top: search_entry.bottom
70- anchors.topMargin: 9
71 anchors.bottom: lensBar.top
72 anchors.left: parent.left
73 anchors.right: !filterPane.visible || filterPane.folded ? parent.right : filterPane.left
74
75=== modified file 'shell/dash/LensView.qml'
76--- shell/dash/LensView.qml 2012-02-24 18:13:08 +0000
77+++ shell/dash/LensView.qml 2012-03-09 14:34:21 +0000
78@@ -25,6 +25,29 @@
79
80 /* An instance of Lens */
81 property variant model
82+ property string firstNonEmptyCategory
83+
84+ function updateFirstCategory() {
85+ if (lensView.model.results.count == 0)
86+ return
87+ var firstCategory = -1
88+ for (var i = 0; i < lensView.model.results.count; i++) {
89+ var result = lensView.model.results.get(i)
90+ if (result.column_2 < firstCategory || firstCategory == -1) {
91+ firstCategory = result.column_2
92+ if (firstCategory == 0) {
93+ break
94+ }
95+ }
96+ }
97+ var category = lensView.model.categories.get(firstCategory)
98+ firstNonEmptyCategory = category.column_0
99+ }
100+
101+ Connections {
102+ target: lensView.model.results
103+ onCountChanged: updateFirstCategory()
104+ }
105
106 function activateFirstResult() {
107 var firstResult = null
108@@ -48,7 +71,7 @@
109
110 focus: true
111 anchors.fill: parent
112- anchors.leftMargin: 18
113+ anchors.leftMargin: 15
114
115 /* The category's delegate is chosen dynamically depending on what
116 rendererName is returned by the CategoriesModel.
117@@ -72,6 +95,7 @@
118
119 source: rendererName ? Utils.convertToCamelCase(rendererName) + ".qml" : ""
120 onStatusChanged: {
121+ updateFirstCategory()
122 if (status == Loader.Error) {
123 console.log("Failed to load renderer %1. Using default renderer instead.".arg(rendererName))
124 source = "TileVertical.qml"
125@@ -108,8 +132,9 @@
126
127 headerDelegate: CategoryHeader {
128 visible: body.item ? body.item.needHeader && body.visible : false
129- height: visible ? 32 : 0
130+ height: visible ? 35 : 0
131
132+ property bool isFirst: firstNonEmptyCategory == body.name
133 property bool foldable: body.item ? body.item.folded != undefined : false
134 availableCount: body.item ? foldable ? body.category_model.count - body.item.cellsPerRow : 0 : 0
135 folded: body.item ? foldable ? body.item.folded : false : false

Subscribers

People subscribed via source and target branches