Merge lp:~victored/unity/fixes into lp:unity
Status: | Merged |
---|---|
Approved by: | Mirco Müller |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1730 |
Proposed branch: | lp:~victored/unity/fixes |
Merge into: | lp:unity |
Diff against target: |
21 lines (+2/-2) 1 file modified
plugins/unityshell/src/IconRenderer.cpp (+2/-2) |
To merge this branch: | bzr merge lp:~victored/unity/fixes |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mirco Müller (community) | Approve | ||
Adolfo Jayme Barrientos (community) | Approve | ||
Review via email: mp+74891@code.launchpad.net |
Commit message
Fix for lp:702989
Description of the change
This is an attempt to fix lp:702989
Since the height of the icons in the launcher is an even number, having something vertically centered is not possible. For the Tooltips and QuickLists, the y-center is located at '... + Height/2', so for a 48px icon height this would result in +24.
As similar algorithms are used to calculate the center of the icons everywhere, what needs to be fixed are not the tooltips and quicklists, but the icon indicators (arrows for active and open states), which are located at the middle using a different approach: the arrows are .png images of 19px height (whose center is located at +10 pixels from the top), so this time (as you can see in the function RenderIndicators) the y-coordinates are given by 'center - Height/2'.
For a 48px icon height, the operation would be: '24 - 19/2', rounded to '24 - 9' = 15. Then, the PNG image is put at +15 pixels from the top of the icon and therefore the center of the indicator at 15+10 = 25, creating a +1px offset.
Subtracting 1px to each y-coordinate at the end of the 'RenderIndicators' function solves the problem for every icon size.
Nice fix to the ugly truth that launcher-icons with and even height can't center-line align with the tooltips. Works as advertised.
I'm good to merge that into unity trunk, but I need to know if you've signed the Canonical contributor- agreement. If you haven't done yet so please follow the procedure described here: https:/ /wiki.canonical .com/LegalServi ces/Forms/ ContributorAgre ement
Thanks in advance!