Merge lp:~macslow/unity/unity.fix-841945 into lp:unity

Proposed by Mirco Müller
Status: Merged
Approved by: Neil J. Patel
Approved revision: no longer in the source branch.
Merged at revision: 1513
Proposed branch: lp:~macslow/unity/unity.fix-841945
Merge into: lp:unity
Diff against target: 329 lines (+75/-49)
8 files modified
plugins/unityshell/resources/dash-widgets.json (+2/-2)
plugins/unityshell/src/DashSearchBar.cpp (+2/-2)
plugins/unityshell/src/DashStyle.cpp (+33/-28)
plugins/unityshell/src/FilterExpanderLabel.cpp (+4/-2)
plugins/unityshell/src/FilterGenreWidget.cpp (+13/-8)
plugins/unityshell/src/FilterMultiRangeWidget.cpp (+10/-0)
plugins/unityshell/src/FilterRatingsButton.cpp (+7/-4)
plugins/unityshell/src/PlacesGroup.cpp (+4/-3)
To merge this branch: bzr merge lp:~macslow/unity/unity.fix-841945
Reviewer Review Type Date Requested Status
Neil J. Patel (community) Approve
Review via email: mp+74554@code.launchpad.net

Description of the change

This branch fixes a lot of the issues stated in the mega-bug LP: #841945. But since it so much not everything is done yet. Still already done fixes should move into trunk as soon as possible. Here's a list of done fixes:

from the list of positioning issues:
- The Category Headers are positioned wrong (too far left, too low)
- The magnifying glass inside the search box is positioned wrong (should be further to the left)
- There is too much space below each category header
- "Filter results" header is positioned wrong (should be right and slightly up)
- The "All" button is aligned incorrectly relative to the other filter buttons (right sides should fall on the same vertical axis)

from the list of shape issues:
- "Filter results" is the wrong font size and weight
- The corner radius of the search filter toggle boxes is wrong
- The 'rating' stars are the wrong size
- the un-selected 'rating' star has the wrong border
- the 1px dividers in-between the categories should be narrower with 15px margin on each side
- the dividers in between the filter results categories are missing
- the 'All' button's shape is very wrong
- the filter results category headers are with wrong font size and weight

Here's a screenshot of the new looks http://people.canonical.com/~mmueller/fix-841945-1.jpg

To post a comment you must log in.
Revision history for this message
Neil J. Patel (njpatel) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/resources/dash-widgets.json'
2--- plugins/unityshell/resources/dash-widgets.json 2011-09-01 08:40:57 +0000
3+++ plugins/unityshell/resources/dash-widgets.json 2011-09-08 08:00:25 +0000
4@@ -48,9 +48,9 @@
5 "text-opacity" : [ 1.0, 1.0, 1.0, 1.0, 1.0],
6 "fill-color" : ["#FFFFFF", "#000000", "#ffffff", "#000000", "#000000"],
7 "fill-opacity" : [ 0.5, 0.0, 0.25, 0.0, 0.0],
8- "overlay-opacity": [ 0.7, 0.35, 0.7, 0.0, 0.0],
9+ "overlay-opacity": [ 0.1, 0.1, 0.1, 0.0, 0.0],
10 "overlay-mode" : [ "normal", "normal", "normal", "normal", "normal"],
11- "blur-size" : [ 4, 2, 4, 0, 0]},
12+ "blur-size" : [ 1, 1, 1, 0, 0]},
13
14 "track-view" : {
15 "line-gap" : 26.0,
16
17=== modified file 'plugins/unityshell/src/DashSearchBar.cpp'
18--- plugins/unityshell/src/DashSearchBar.cpp 2011-09-07 21:45:10 +0000
19+++ plugins/unityshell/src/DashSearchBar.cpp 2011-09-08 08:00:25 +0000
20@@ -62,9 +62,9 @@
21 bg_layer_ = new nux::ColorLayer(nux::Color(0xff595853), true);
22
23 layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
24- layout_->SetHorizontalInternalMargin(12);
25+ layout_->SetHorizontalInternalMargin(0);
26 layout_->SetVerticalExternalMargin(12);
27- layout_->SetHorizontalExternalMargin(18);
28+ layout_->SetHorizontalExternalMargin(10);
29 SetLayout(layout_);
30
31 spinner_ = new SearchBarSpinner();
32
33=== modified file 'plugins/unityshell/src/DashStyle.cpp'
34--- plugins/unityshell/src/DashStyle.cpp 2011-09-08 03:04:04 +0000
35+++ plugins/unityshell/src/DashStyle.cpp 2011-09-08 08:00:25 +0000
36@@ -847,7 +847,7 @@
37 {0.0, 0.0}};
38 double angle[5] = {-90.0, -18.0, 54.0, 126.0, 198.0};
39 double outterRadius = size;
40- double innerRadius = size/2.0;
41+ double innerRadius = size/1.75;
42
43 for (int i = 0; i < 5; i++)
44 {
45@@ -1545,22 +1545,25 @@
46 double* color,
47 double opacity,
48 std::string label)
49- {
50- double x = 0.0;
51- double y = 0.0;
52- int w = 0;
53- int h = 0;
54- PangoLayout* layout = NULL;
55- PangoFontDescription* desc = NULL;
56- PangoContext* pangoCtx = NULL;
57- int dpi = 0;
58- GdkScreen* screen = gdk_screen_get_default(); // not ref'ed
59- GtkSettings* settings = gtk_settings_get_default(); // not ref'ed
60- gchar* fontName = NULL;
61+ {
62+ double x = 0.0;
63+ double y = 0.0;
64+ int w = 0;
65+ int h = 0;
66+ PangoLayout* layout = NULL;
67+ PangoFontDescription* desc = NULL;
68+ PangoContext* pangoCtx = NULL;
69+ int dpi = 0;
70+ GdkScreen* screen = gdk_screen_get_default(); // not ref'ed
71+ GtkSettings* settings = gtk_settings_get_default(); // not ref'ed
72+ gchar* fontName = NULL;
73+ double horizMargin = 10.0;
74
75 w = cairo_image_surface_get_width (cairo_get_target (cr));
76 h = cairo_image_surface_get_height (cairo_get_target (cr));
77
78+ w -= 2 * horizMargin;
79+
80 if (!screen)
81 cairo_set_font_options(cr, _defaultFontOptions);
82 else
83@@ -1624,7 +1627,7 @@
84 PangoRectangle ink = {0, 0, 0, 0};
85 PangoRectangle log = {0, 0, 0, 0};
86 pango_layout_get_extents (layout, &ink, &log);
87- x = ((double) w - pango_units_to_double (ink.width)) / 2.0;
88+ x = ((double) w - pango_units_to_double (ink.width)) / 2.0 + horizMargin;
89 y = ((double) h - pango_units_to_double (log.height)) / 2.0;
90 cairo_move_to (cr, x, y);
91 pango_cairo_show_layout(cr, layout);
92@@ -1748,7 +1751,7 @@
93 1.0,
94 (double) (garnish),
95 (double) (garnish),
96- h / 4.0,
97+ 7.0,
98 w - (double) (2 * garnish),
99 h - (double) (2 * garnish),
100 false);
101@@ -1797,16 +1800,17 @@
102 double h = cairo_image_surface_get_height (cairo_get_target (cr));
103 double radius = .85 * h / 2.0;
104
105- cairo_save (cr);
106+ cairo_save (cr);
107 cairo_translate (cr, w / 2.0, h / 2.0);
108 Star (cr, radius);
109- cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.2);
110+ cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.2);
111 cairo_fill_preserve (cr);
112- cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
113+ cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.5);
114+ cairo_set_line_width (cr, 0.75);
115 cairo_stroke (cr);
116- cairo_restore (cr);
117+ cairo_restore (cr);
118
119- return true;
120+ return true;
121 }
122
123 bool DashStyle::StarHalf (cairo_t* cr, nux::State state)
124@@ -1822,24 +1826,25 @@
125 double h = cairo_image_surface_get_height (cairo_get_target (cr));
126 double radius = .85 * h / 2.0;
127
128- cairo_pattern_t* pattern = NULL;
129+ cairo_pattern_t* pattern = NULL;
130 pattern = cairo_pattern_create_linear (0.0, 0.0, w, 0.0);
131- cairo_pattern_add_color_stop_rgba (pattern, 0.0, 1.0, 1.0, 1.0, 1.0);
132+ cairo_pattern_add_color_stop_rgba (pattern, 0.0, 1.0, 1.0, 1.0, 1.0);
133 cairo_pattern_add_color_stop_rgba (pattern, .5, 1.0, 1.0, 1.0, 1.0);
134 cairo_pattern_add_color_stop_rgba (pattern, .5 + 0.01, 1.0, 1.0, 1.0, 0.2);
135 cairo_pattern_add_color_stop_rgba (pattern, 1.0, 1.0, 1.0, 1.0, 0.2);
136- cairo_set_source (cr, pattern);
137+ cairo_set_source (cr, pattern);
138
139- cairo_save (cr);
140+ cairo_save (cr);
141 cairo_translate (cr, w / 2.0, h / 2.0);
142 Star (cr, radius);
143- cairo_fill_preserve (cr);
144+ cairo_fill_preserve (cr);
145 cairo_pattern_destroy (pattern);
146- cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 1.0);
147+ cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.5);
148+ cairo_set_line_width (cr, 0.75);
149 cairo_stroke (cr);
150- cairo_restore (cr);
151+ cairo_restore (cr);
152
153- return true;
154+ return true;
155 }
156
157 bool DashStyle::StarFull (cairo_t* cr, nux::State state)
158
159=== modified file 'plugins/unityshell/src/FilterExpanderLabel.cpp'
160--- plugins/unityshell/src/FilterExpanderLabel.cpp 2011-09-06 18:30:26 +0000
161+++ plugins/unityshell/src/FilterExpanderLabel.cpp 2011-09-08 08:00:25 +0000
162@@ -35,7 +35,7 @@
163 , contents_ (NULL)
164 , right_hand_contents_ (NULL)
165 , expander_graphic_ (NULL)
166- , label_("<span font_size='larger'>" + label + "</span>")
167+ , label_("<span size='larger' weight='bold'>" + label + "</span>")
168 {
169 expanded.changed.connect (sigc::mem_fun(this, &FilterExpanderLabel::DoExpandChange));
170 BuildLayout ();
171@@ -47,7 +47,7 @@
172
173 void FilterExpanderLabel::SetLabel (std::string label)
174 {
175- label_ = "<span font_size='larger'>" + label + "</span>";
176+ label_ = "<span size='larger' weight='bold'>" + label + "</span>";
177 cairo_label_->SetText(label_.c_str());
178 }
179
180@@ -86,6 +86,8 @@
181 top_bar_layout_->AddSpace(1, 1);
182
183 layout_->AddLayout (top_bar_layout_, 0);
184+ layout_->SetVerticalInternalMargin(12);
185+
186 SetLayout(layout_);
187
188 QueueRelayout();
189
190=== modified file 'plugins/unityshell/src/FilterGenreWidget.cpp'
191--- plugins/unityshell/src/FilterGenreWidget.cpp 2011-09-07 21:25:18 +0000
192+++ plugins/unityshell/src/FilterGenreWidget.cpp 2011-09-08 08:00:25 +0000
193@@ -48,15 +48,12 @@
194 genre_layout_ = new nux::GridHLayout(NUX_TRACKER_LOCATION);
195 genre_layout_->ForceChildrenSize(true);
196 genre_layout_->SetHeightMatchContent(true);
197- genre_layout_->SetVerticalInternalMargin (0);
198- genre_layout_->SetHorizontalInternalMargin (0);
199+ genre_layout_->SetVerticalInternalMargin (12);
200+ genre_layout_->SetVerticalExternalMargin (12);
201+ genre_layout_->SetHorizontalInternalMargin (10);
202 genre_layout_->EnablePartialVisibility (false);
203-
204- DashStyle *dash_style = DashStyle::GetDefault();
205- int garnish = 2 * dash_style->GetButtonGarnishSize();
206-
207- genre_layout_->SetChildrenSize (style->GetTileWidth() - 12,
208- garnish + style->GetTextLineHeight() * 2);
209+ genre_layout_->SetChildrenSize (style->GetTileWidth() - 12, 35);
210+ genre_layout_->Reference();
211
212 SetRightHandView(all_button_);
213 SetContents(genre_layout_);
214@@ -146,9 +143,17 @@
215
216 void FilterGenre::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) {
217 nux::Geometry geo = GetGeometry();
218+ nux::Color col(0.2f, 0.2f, 0.2f, 0.2f);
219
220 GfxContext.PushClippingRectangle(geo);
221 nux::GetPainter().PaintBackground(GfxContext, geo);
222+
223+ nux::GetPainter().Draw2DLine(GfxContext,
224+ geo.x, geo.y + geo.height - 1,
225+ geo.x + geo.width, geo.y + geo.height - 1,
226+ col,
227+ col);
228+
229 GfxContext.PopClippingRectangle();
230 }
231
232
233=== modified file 'plugins/unityshell/src/FilterMultiRangeWidget.cpp'
234--- plugins/unityshell/src/FilterMultiRangeWidget.cpp 2011-09-07 21:25:18 +0000
235+++ plugins/unityshell/src/FilterMultiRangeWidget.cpp 2011-09-08 08:00:25 +0000
236@@ -43,6 +43,8 @@
237 all_button_->Reference();
238
239 layout_ = new nux::HLayout(NUX_TRACKER_LOCATION);
240+ layout_->Reference();
241+ layout_->SetVerticalExternalMargin (12);
242
243 SetRightHandView(all_button_);
244 SetContents(layout_);
245@@ -177,9 +179,17 @@
246
247 void FilterMultiRange::Draw(nux::GraphicsEngine& GfxContext, bool force_draw) {
248 nux::Geometry geo = GetGeometry();
249+ nux::Color col(0.2f, 0.2f, 0.2f, 0.2f);
250
251 GfxContext.PushClippingRectangle(geo);
252 nux::GetPainter().PaintBackground(GfxContext, geo);
253+
254+ nux::GetPainter().Draw2DLine(GfxContext,
255+ geo.x, geo.y + geo.height - 1,
256+ geo.x + geo.width, geo.y + geo.height - 1,
257+ col,
258+ col);
259+
260 GfxContext.PopClippingRectangle();
261 }
262
263
264=== modified file 'plugins/unityshell/src/FilterRatingsButton.cpp'
265--- plugins/unityshell/src/FilterRatingsButton.cpp 2011-09-06 18:30:26 +0000
266+++ plugins/unityshell/src/FilterRatingsButton.cpp 2011-09-08 08:00:25 +0000
267@@ -120,7 +120,8 @@
268 if (cached_geometry_ != GetGeometry())
269 {
270 nux::Geometry geometry = GetGeometry();
271- geometry.width /= 5;
272+ //geometry.width /= 5;
273+ geometry.width = 27;
274 prelight_empty_->Invalidate(geometry);
275 active_empty_->Invalidate(geometry);
276 normal_empty_->Invalidate(geometry);
277@@ -151,7 +152,8 @@
278 int total_half_stars = rating % 2;
279
280 nux::Geometry geometry = GetGeometry ();
281- geometry.width = geometry.width / 5;
282+ //geometry.width = geometry.width / 5;
283+ geometry.width = 27;
284
285 gPainter.PaintBackground(GfxContext, GetGeometry());
286 // set up our texture mode
287@@ -210,7 +212,7 @@
288 texxform,
289 nux::Color(1.0f, 1.0f, 1.0f, 1.0f));
290
291- geometry.x += geometry.width;
292+ geometry.x += geometry.width + 10;
293
294 }
295
296@@ -227,7 +229,8 @@
297 }
298
299 void FilterRatingsButton::RecvMouseDown (int x, int y, unsigned long button_flags, unsigned long key_flags) {
300- int width = GetGeometry().width;
301+ //int width = GetGeometry().width;
302+ int width = 180;
303 float new_rating = (static_cast<float>(x) / width) + 0.10f;
304 if (filter_ != NULL)
305 filter_->rating = new_rating;
306
307=== modified file 'plugins/unityshell/src/PlacesGroup.cpp'
308--- plugins/unityshell/src/PlacesGroup.cpp 2011-09-02 03:40:15 +0000
309+++ plugins/unityshell/src/PlacesGroup.cpp 2011-09-08 08:00:25 +0000
310@@ -66,7 +66,8 @@
311
312 _cached_name = NULL;
313 _group_layout = new nux::VLayout("", NUX_TRACKER_LOCATION);
314- _group_layout->SetVerticalExternalMargin(12);
315+ _group_layout->SetVerticalExternalMargin(15);
316+ _group_layout->SetHorizontalExternalMargin(19);
317
318 _header_layout = new nux::HLayout(NUX_TRACKER_LOCATION);
319 _group_layout->AddLayout(_header_layout, 0, nux::MINOR_POSITION_TOP, nux::MINOR_SIZE_FULL);
320@@ -305,8 +306,8 @@
321
322 if (_draw_sep)
323 nux::GetPainter().Draw2DLine(GfxContext,
324- geo.x, geo.y + geo.height - 1,
325- geo.x + geo.width, geo.y + geo.height - 1,
326+ geo.x + 10, geo.y + geo.height - 1,
327+ geo.x + geo.width - 10, geo.y + geo.height - 1,
328 col,
329 col);
330