Merge lp:~azzar1/unity/fix-1008603 into lp:unity

Proposed by Andrea Azzarone on 2012-06-04
Status: Merged
Approved by: Łukasz Zemczak on 2012-06-06
Approved revision: 2382
Merged at revision: 2391
Proposed branch: lp:~azzar1/unity/fix-1008603
Merge into: lp:unity
Diff against target: 62 lines (+17/-5)
2 files modified
hud/HudView.cpp (+14/-2)
unity-shared/DashStyle.cpp (+3/-3)
To merge this branch: bzr merge lp:~azzar1/unity/fix-1008603
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve on 2012-06-06
Łukasz Zemczak 2012-06-04 Approve on 2012-06-06
John Lea design 2012-06-04 Pending
Review via email: mp+108604@code.launchpad.net

Commit message

Draw the result grid in proximity of the search entry.

Description of the change

== Problem ==
The result grid is not drawn in proximity of the search entry.

== Fix ==
Use nux::GetPainter().Draw2DLine to draw the grid behind the search entry.

== Test ==
Not applicable

== Screenshot ==
http://ubuntuone.com/5YADnxYrLKWYgQ32XUgrOZ

To post a comment you must log in.
Łukasz Zemczak (sil2100) wrote :

Seems fine to me.

review: Approve
Marco Trevisan (Treviño) (3v1n0) wrote :

After the bottom padding fix you've included, it's fine for me.

review: Approve
Unity Merger (unity-merger) wrote :

The Jenkins job https://jenkins.qa.ubuntu.com/job/automerge-unity/775/console reported an error when processing this lp:~andyrock/unity/fix-1008603 branch.
Not merging it.

Sam Spilsbury (smspillaz) wrote :

/tmp/buildd/unity-5.12+bzr2390ubuntu0+702/tests/test_service_lens.c: In function 'on_preview_uri':
/tmp/buildd/unity-5.12+bzr2390ubuntu0+702/tests/test_service_lens.c:190:3: error: implicit declaration of function 'unity_track_preview_new' [-Werror=implicit-function-declaration]
/tmp/buildd/unity-5.12+bzr2390ubuntu0+702/tests/test_service_lens.c:190:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
cc1: all warnings being treated as errors

Doesn't seem like that was introduced by this branch, but CI got screwy, probably the last commit that went in.

Sebastien Bacher (seb128) wrote :

right, that was pointed to Michal on IRC and he's working on a fix

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hud/HudView.cpp'
2--- hud/HudView.cpp 2012-06-04 22:47:12 +0000
3+++ hud/HudView.cpp 2012-06-06 11:26:24 +0000
4@@ -44,10 +44,10 @@
5
6 const int default_width = 960;
7 const int default_height = 276;
8-const int content_width = 941;
9+const int content_width = 939;
10
11 const int top_padding = 11;
12-const int bottom_padding = 9;
13+const int bottom_padding = 10;
14 const int left_padding = 11;
15 const int right_padding = 0;
16 }
17@@ -451,9 +451,21 @@
18 renderer_.DrawInner(gfx_context, draw_content_geo, absolute_window_geometry_, window_geometry_);
19
20 gfx_context.PushClippingRectangle(draw_content_geo);
21+
22 if (IsFullRedraw())
23 {
24 nux::GetPainter().PushBackgroundStack();
25+
26+ if (!buttons_.empty()) // See bug #1008603.
27+ {
28+ int height = 3;
29+ int x = search_bar_->GetBaseX() + 1;
30+ int y = search_bar_->GetBaseY() + search_bar_->GetBaseHeight() - height;
31+ nux::GetPainter().Draw2DLine(gfx_context, x, y, x, y + height, nux::color::White * 0.13);
32+ x += content_width - 1;
33+ nux::GetPainter().Draw2DLine(gfx_context, x, y, x, y + height, nux::color::White * 0.13);
34+ }
35+
36 GetLayout()->ProcessDraw(gfx_context, force_draw);
37 nux::GetPainter().PopBackgroundStack();
38 }
39
40=== modified file 'unity-shared/DashStyle.cpp'
41--- unity-shared/DashStyle.cpp 2012-05-22 13:39:19 +0000
42+++ unity-shared/DashStyle.cpp 2012-06-06 11:26:24 +0000
43@@ -1651,7 +1651,7 @@
44 // draw the grid background
45 {
46 cairo_set_line_width(cr, 1);
47- cairo_move_to(cr, _align(x + width, odd), _align(y, odd));
48+ cairo_move_to(cr, _align(x + width, odd), y);
49 if (curve_bottom)
50 {
51 LOG_DEBUG(logger) << "curve: " << _align(x + width, odd) << " - " << _align(y + height - radius, odd);
52@@ -1683,8 +1683,8 @@
53 else
54 {
55 cairo_line_to(cr, _align(x + width, odd), _align(y + height, odd));
56- cairo_line_to(cr, _align(x, odd), _align(x + height, odd));
57- cairo_line_to(cr, _align(x, odd), _align(y, odd));
58+ cairo_line_to(cr, _align(x, odd), _align(y + height, odd));
59+ cairo_line_to(cr, _align(x, odd), y);
60 }
61
62 cairo_set_source_rgba(cr, pimpl->button_label_border_color_[nux::ButtonVisualState::VISUAL_STATE_NORMAL]);