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

Proposed by Michal Hruby
Status: Merged
Approved by: Martin Mrazik
Approved revision: no longer in the source branch.
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: mp+118276@code.launchpad.net

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.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

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

Revision history for this message
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.

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/1016/console 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
=== modified file 'dash/PlacesGroup.cpp'
--- dash/PlacesGroup.cpp 2012-06-18 02:57:23 +0000
+++ dash/PlacesGroup.cpp 2012-08-05 22:28:18 +0000
@@ -369,7 +369,8 @@
369369
370 nux::Geometry const& geo = GetGeometry();370 nux::Geometry const& geo = GetGeometry();
371371
372 if (_cached_geometry != geo)372 // only the width matters
373 if (_cached_geometry.GetWidth() != geo.GetWidth())
373 {374 {
374 _focus_layer.reset(dash::Style::Instance().FocusOverlay(geo.width - kHighlightLeftPadding - kHighlightRightPadding, kHighlightHeight));375 _focus_layer.reset(dash::Style::Instance().FocusOverlay(geo.width - kHighlightLeftPadding - kHighlightRightPadding, kHighlightHeight));
375376