-
Notifications
You must be signed in to change notification settings - Fork 230
Improve CTabFolder highlight appearance on higher zooms #3656
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Improve CTabFolder highlight appearance on higher zooms #3656
Conversation
The highlight of CTabFolders implemented in CTabRendering does not properly deal with higher zooms on Windows. The outline of the tabs is drawn with a width of one pixel whereas the highlight has an offset of one point, producing a gap at higher zooms. In addition, the highlight for rounded tabs exceeds the intended bounds. This change adapts the rendering as follows: - When the highlight is drawn rounded at the top, the shape of the outline is taken and adapted to the intended highlight height to draw the highlight. - In all other cases the highlight is drawn as a simple line of according width with an offset of half the line width with respect to its bounds. To compensate for the 1px border that is drawn on top of the highlight when it is placed at the top of a tab, another line of according size is drawn next to the highlight to make its height fit again.
14b37fe to
92aa308
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At 100%, there is a behavior change from previous implementation:
The bottom highlight has a gap from bottom, the same issue that was mentioned here: #3533 (review)
Left: Current implementation
Right: Your change.
At 250%: I see highlight color bleeding out to left tab when hovered. See, (its a gif, please open it in other tab to see it running)
It's interesting that I did not have that when testing (as can be seen in my screenshots). I don't understand why, as I can also reproduce it. @ShahzaibIbrahim can you maybe update and simplify your PR to support the |

The highlight of CTabFolders implemented in CTabRendering does not properly deal with higher zooms on Windows. The outline of the tabs is drawn with a width of one pixel whereas the highlight has an offset of one point, producing a gap at higher zooms. In addition, the highlight for rounded tabs exceeds the intended bounds.
This change adapts the rendering as follows:
One problem that is not solved by this are inconsistent heights of the highlights when using a CTabFolder with headers being placed at the bottom at 125% and 175%. The root cause is an already misplaced/miscalculated header region, at it exceeds the intended size to the bottom. So in order to improve that behavior, the header region calculation has to be fixed.
This is a proposal to overcome the current limitations of:
How it looks
Windows
CTabFolders with headers on top:

CTabFolders with headers at top:

Linux
150% used fractional scaling mode, which is why the screenshot has the same size as 200% (the OS scales down a faked 200% canvas):

MacOS