Merge lp:~mhr3/unity/places-group-focus-overlay into lp:unity

Proposed by Michal Hruby
Status: Merged
Approved by: Martin Mrazik
Approved revision: 2541
Merged at revision: 2567
Proposed branch: lp:~mhr3/unity/places-group-focus-overlay
Merge into: lp:unity
Diff against target: 12 lines (+2/-1)
1 file modified
dash/PlacesGroup.cpp (+2/-1)
To merge this branch: bzr merge lp:~mhr3/unity/places-group-focus-overlay
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email:

Commit message

Don't compare entire geometry when re-rendering focus overlay in PlacesGroup

Description of the change

PlacesGroup::ComputeContentSize was unnecessarily re-rendering the focus overlay because it was comparing the entire geometry (pos + size) while only the width matters for the overlay.

To post a comment you must log in.
Andrea Azzarone (azzar1) wrote :

Cool. I think we don't need to store the _ached_geometry too. We can just store the width.

Michal Hruby (mhr3) wrote :

I kept it in case we wanted to account for the height as well at some point, but yes atm only width would suffice.

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


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

The Jenkins job reported an error when processing this lp:~mhr3/unity/places-group-focus-overlay branch.
Not merging it.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dash/PlacesGroup.cpp'
2--- dash/PlacesGroup.cpp 2012-06-18 02:57:23 +0000
3+++ dash/PlacesGroup.cpp 2012-08-05 22:28:18 +0000
4@@ -369,7 +369,8 @@
6 nux::Geometry const& geo = GetGeometry();
8- if (_cached_geometry != geo)
9+ // only the width matters
10+ if (_cached_geometry.GetWidth() != geo.GetWidth())
11 {
12 _focus_layer.reset(dash::Style::Instance().FocusOverlay(geo.width - kHighlightLeftPadding - kHighlightRightPadding, kHighlightHeight));