Merge lp:~unity-team/unity/fix-long-section-names into lp:unity
Status: | Merged |
---|---|
Merged at revision: | 567 |
Proposed branch: | lp:~unity-team/unity/fix-long-section-names |
Merge into: | lp:unity |
Diff against target: |
281 lines (+143/-9) 3 files modified
unity-private/places/places-place-search-bar.vala (+60/-3) unity-private/places/places-place-search-entry.vala (+25/-4) unity-private/places/places-place-search-sections-bar.vala (+58/-2) |
To merge this branch: | bzr merge lp:~unity-team/unity/fix-long-section-names |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mikkel Kamstrup Erlandsen (community) | Approve | ||
Review via email: mp+37236@code.launchpad.net |
Description of the change
This is a very horrible way of making sure we can fit all the sections on the screen. It works around a bunch of bugs in ClutterText wrt size-negotiation with ellipsis.
The main thing that happens is:
If the sections bar is too long for the screen when a place is activated, we figure that out in the allocation cycle and then request the section to go into small mode (as well as asking the search entry to become smaller too). At this point, the section will enable ellipsising on it's sections, and the bar will repack the sections to be expand=true, so we'll try and use as much space as possible. The sections themselves need to store their width when they were allowed to show all the text, so they have a reference point (as they cannot get this ever again when they need it).
When we switch places, we need to create a new sections bar to undo the damage we did and then go through the cycle again.
If i had more time, and I'll do this for SRU, I would have staged the "make things fit" into two allocation cycles:
1. First decrease the entry width and, if sections still don't fit,
2. Make sections go into small mode
There is a slight visual flicker when this happens first time, but I can try and fix that for SRU too.
Code looks ok (in light of the comments above) and I can confirm it works. In fact I don't see the flickering :-)
Approved!