GNOME Bugzilla – Bug 707920
notebook tab style improvements
Last modified: 2013-10-02 15:09:48 UTC
We've been discussing and iterating for months if not years on various ways to improve the style of our notebook tabs. Over the course of the summer we converged on an approach that makes the tabs less visually prominent. While it may be advantageous in the longer run to add a new widget to drive a GtkStack instead of using notebooks I think it makes sense to make an improvement to the existing uses as well. We still have some work to do on the theme side but I think the changes required to the notebook are relatively small and are ready for review.
Created attachment 254699 [details] [review] demo: Show popup menu on tabs
Created attachment 254700 [details] [review] notebook: Remove gap from notebook tabs
Created attachment 254701 [details] [review] notebook: Use initial-gap on both edges of the tab header
Created attachment 254702 [details] [review] notebook: Improve the style of the default arrows
Created attachment 254703 [details] [review] notebook: Make notebook scroll arrows honor initial gap setting So that they can be styled so they are not right on the edge.
Created attachment 254704 [details] [review] notebook: Fix rounding error in vertical alignment of arrow
These patches depend on the patches in bug 643914 and bug 691163.
Review of attachment 254699 [details] [review]: sure
Review of attachment 254702 [details] [review]: ok
Review of attachment 254700 [details] [review]: This is going to break existing themes. I'd prefer to just change the default render_extension implementation.
Review of attachment 254701 [details] [review]: Looks harmless enough
Review of attachment 254703 [details] [review]: I'm not entirely convinced that you got number fiddling right here. When I played with this, setting initial-gap to 30, I had the impression that the left arrow was placed as expected, but for the right arrow, I had a big gap before and after the arrow.
Review of attachment 254704 [details] [review]: ok
(In reply to comment #10) > Review of attachment 254700 [details] [review]: > > This is going to break existing themes. > I'd prefer to just change the default render_extension implementation. If I modify the theme to remove the render_extension method and change the default render_extension to not hide sides then the only remaining problem is that gtk_notebook_paint hardcodes gtk_render_frame_gap. Which will need to be gtk_render_frame for the new design. It seems to me that we could either: a) defer that decision to the theme b) be able to know if the theme needs a gap.
Created attachment 256147 [details] [review] notebook: Add a style property for whether to draw a tab gap Add a has-tab-gap style property to GtkNotebook so that we can disable drawing the gap between tabs and the page in the Adwaita theme without breaking existing themes.
Created attachment 256150 [details] [review] notebook: Make notebook scroll arrows honor initial gap setting So that they can be styled so they are not right on the edge.
Review of attachment 256147 [details] [review]: With this version of the patch, the old adwaita style tabs continue to work as expected. So, +1 for that. I think the description of the has-gap property is maybe a little misleading - it is not just about the gap, it is about the entire tab rendering being switched from gtk_render_extension to gtk_render_background + frame.
Review of attachment 256150 [details] [review]: Not sure what you've changed here, but in my test with this, both arrows now get the same spacing towards the outside, and the same (small) spacing towards the tabs. +1
Attachment 254699 [details] pushed as 2bb01c6 - demo: Show popup menu on tabs Attachment 254701 [details] pushed as 81b0808 - notebook: Use initial-gap on both edges of the tab header Attachment 254702 [details] pushed as 8dd100d - notebook: Improve the style of the default arrows Attachment 254704 [details] pushed as b609377 - notebook: Fix rounding error in vertical alignment of arrow Attachment 256147 [details] pushed as e9b9fd2 - notebook: Add a style property for whether to draw a tab gap Attachment 256150 [details] pushed as e07fec3 - notebook: Make notebook scroll arrows honor initial gap setting