Merge lp:~azzar1/unity/fix-1016239-5.0 into lp:unity/5.0

Proposed by Andrea Azzarone
Status: Merged
Approved by: Didier Roche-Tolomelli
Approved revision: no longer in the source branch.
Merged at revision: 2376
Proposed branch: lp:~azzar1/unity/fix-1016239-5.0
Merge into: lp:unity/5.0
Diff against target: 59 lines (+10/-2)
2 files modified
plugins/unityshell/src/HudButton.cpp (+8/-1)
plugins/unityshell/src/HudView.cpp (+2/-1)
To merge this branch: bzr merge lp:~azzar1/unity/fix-1016239-5.0
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+112345@code.launchpad.net

Commit message

Description of the change

Backport lp:~andyrock/unity/fix-1016239

== Problem ==
Searching in the HUD freezes unity.
== Fix ==
Set a min/max width for the hudbutton to avoid layout issues.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

+1

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

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/unityshell/src/HudButton.cpp'
2--- plugins/unityshell/src/HudButton.cpp 2012-05-31 09:03:00 +0000
3+++ plugins/unityshell/src/HudButton.cpp 2012-06-27 12:34:50 +0000
4@@ -132,6 +132,7 @@
5 void HudButton::Draw(nux::GraphicsEngine& GfxContext, bool force_draw)
6 {
7 nux::Geometry const& geo = GetGeometry();
8+ GfxContext.PushClippingRectangle(geo);
9 gPainter.PaintBackground(GfxContext, geo);
10 // set up our texture mode
11 nux::TexCoordXForm texxform;
12@@ -169,12 +170,18 @@
13 nux::Color(1.0f, 1.0f, 1.0f, 1.0f));
14
15 GfxContext.GetRenderStates().SetBlend(alpha, src, dest);
16+
17+ GfxContext.PopClippingRectangle();
18 }
19
20 void HudButton::DrawContent(nux::GraphicsEngine& GfxContext, bool force_draw)
21 {
22 if (IsFullRedraw())
23+ {
24+ GfxContext.PushClippingRectangle(GetGeometry());
25 hlayout_->ProcessDraw(GfxContext, force_draw);
26+ GfxContext.PopClippingRectangle();
27+ }
28 }
29
30 void HudButton::SetQuery(Query::Ptr query)
31@@ -187,7 +194,7 @@
32 hlayout_->Clear();
33 for (auto item : items)
34 {
35- nux::StaticCairoText* text = new nux::StaticCairoText(item.first.c_str());
36+ nux::StaticCairoText* text = new nux::StaticCairoText(item.first);
37 text->SetTextColor(nux::Color(1.0f, 1.0f, 1.0f, item.second ? 1.0f : 0.5f));
38 text->SetFont(button_font);
39 hlayout_->AddView(text, 0, nux::MINOR_POSITION_CENTER, nux::MINOR_SIZE_FULL);
40
41=== modified file 'plugins/unityshell/src/HudView.cpp'
42--- plugins/unityshell/src/HudView.cpp 2012-06-25 21:55:49 +0000
43+++ plugins/unityshell/src/HudView.cpp 2012-06-27 12:34:50 +0000
44@@ -244,6 +244,8 @@
45
46 HudButton::Ptr button(new HudButton());
47 buttons_.push_front(button);
48+ button->SetMinimumWidth(content_width);
49+ button->SetMaximumWidth(content_width);
50 button->SetQuery(query);
51
52 button_views_->AddView(button.GetPointer(), 0, nux::MINOR_POSITION_LEFT);
53@@ -261,7 +263,6 @@
54 query_selected.emit(dynamic_cast<HudButton*>(area)->GetQuery());
55 });
56
57- button->SetMinimumWidth(content_width);
58 ++found_items;
59 }
60

Subscribers

People subscribed via source and target branches

to all changes: