Community
Participate
Working Groups
While working on Bug 538740, I noticed that the CTabRendering.computeTrim() function uses the cornerSize in the calculation. I've got a series of screenshots that I will attach to the bug that show different corner sizes and how the view rendering is affected. 16px 20px 30px 40px As you will be able to see, the padding for the internal contents of view grows as the corner radius does. Similarly, the controls in the header are also shifted to the left as the radius grows. If we stop considering the cornerSize in the computeTrim function, we do need to consider that there is a tab outline (see screenshot of the outline in red) of 1px that is not accounted for in the trim calculations. The other thing that we will need to do is use CSS to specify that there is supposed to be padding at the top, currently we specify bottom, right and left padding, but we do not specify the top padding because of this bug (not sure if anyone noticed that the top padding was set to 0px but it was never ACTUALLY drawn as 0px). Attaching an image to show the final results, with 0px top padding and with padding that matches the bottom, left and right with 2px.
Created attachment 282455 [details] 16px corners
Created attachment 282456 [details] 20px corners
Created attachment 282457 [details] 30px corners
Created attachment 282458 [details] 40px corners
So, to reiterate, the 4 images demonstrate how corner radius affects more than just the radius in the trim computation. It is important for the trim computation to be independent of the corner radius so that the view can always be drawn in a consistent manner. This is going to be important for square tabs, which are corner radius 0.
Created attachment 282459 [details] Tab outline This image shows the tab outline that is never accounted for in the trim computation.
Created attachment 282460 [details] Post-fix 16px corner with 0 top padding This shows what it looks like after my fix, without changing the top padding in the css to match the left, right, bottom padding. Finally, the padding for the contents of the view is 0px, as specified.
Created attachment 282461 [details] Post-fix 16px corner with 2px top padding And at last, we have our view with a 2px top padding, matching the left, right and bottom padding.
New Gerrit change created: https://git.eclipse.org/r/161023
Gerrit change https://git.eclipse.org/r/161023 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=40500009cce062f9a81533e94f1e310fdc9f76de
Can you update eclipse.platform.ui\bundles\org.eclipse.ui.themes\css\e4_basestyle.css too ? Thanks
(In reply to Philippe Dul from comment #11) > Can you update > eclipse.platform.ui\bundles\org.eclipse.ui.themes\css\e4_basestyle.css too ? > > Thanks Philippe, please push Gerrit.
New Gerrit change created: https://git.eclipse.org/r/161062
Gerrit change https://git.eclipse.org/r/161062 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=382e93b1405079871ad2353e870e954e60422c57