Merge lp://qastaging/~3v1n0/unity/fading-title-fix into lp://qastaging/unity
Status: | Merged | ||||
---|---|---|---|---|---|
Merge reported by: | Neil J. Patel | ||||
Merged at revision: | not available | ||||
Proposed branch: | lp://qastaging/~3v1n0/unity/fading-title-fix | ||||
Merge into: | lp://qastaging/unity | ||||
Diff against target: |
81 lines (+22/-26) 1 file modified
plugins/unityshell/src/PanelMenuView.cpp (+22/-26) |
||||
To merge this branch: | bzr merge lp://qastaging/~3v1n0/unity/fading-title-fix | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Neil J. Patel (community) | Approve | ||
Review via email:
|
Description of the change
In latest unity the title fading didn't work anymore since it's used gtk_render_layout to apply the pango layout settings to the panel using the theme settings.
To make the fading work again I had to use gtk_render_layout to apply the theme, then use its result as my cairo_source and finally apply a mask over it to set the fading transparency. I used different solutions before, but I proposed all my ideas to Cimi and he preferred this one.
I also changed the way we fade out, avoiding to make the effect to be the same for titles too long just for few pixels, and I only applied the effect on the latest few pixels of the panel bar. The value of the faded pixels, is actually hardcoded to 35 pixels (while before I used a more dynamic way to compute it), but it should be fine for any resolution. Let me know if I should adjust that.
My 2 cents (stylistic changes): add_color_ stop_rgba (linpat, 0, 0, 0, 0, 1); instead cairo_pattern_ add_color_ stop_rgb (linpat, 0, 0, 0, 0); to make more clear we're moving from alpha 1 to alpha 0. context_ restore (style_context);, I like to keep separated the calls when saving and restoring the context, as I usually do for cairo_save and restore.
- I'd use cairo_pattern_
- attach cairo_mask to the pattern creation and then add a white line afterwards (too keep a logical separation between "creation" and "destruction" of the elements.
- do not remove the line before gtk_style_
Thanks, good logical approach with cairo.