-
Notifications
You must be signed in to change notification settings - Fork 228
Adjust selection bounds for CTabRenderring #3533
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?
Conversation
HeikoKlare
left a comment
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.
....ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java
Outdated
Show resolved
Hide resolved
b510ca2 to
8be0403
Compare
|
@HeikoKlare I found the problem. Here were drawing the tab from (0,0) pixel but still using initial item location (1,1) and hence the gap was visible. I also updated the height to 3 when we draw from (0,0) so we have enough height for the selection marker. The code that caused the gap: |
8be0403 to
c878f05
Compare
HeikoKlare
left a comment
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.
The appearance is in my opinion much better than before. I have some questions/remarks on the current propose.
And the appearance with round tabs now became worse (than it already was before):

We may probably do something similar than in SWT to draw a proper shape. The current adjustments by 1 point based on cornerSize do not look sufficient.
....ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java
Outdated
Show resolved
Hide resolved
....ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java
Outdated
Show resolved
Hide resolved
88fc99e to
a4713f9
Compare
No, it should be fully aligned at the top, left and right without any gaps at every zoom. |
|
@amartya4256 can you please retest this? Unfortunately, I have currently monitor available that I can set to 250%. Everything up to 225% looks fine to me. |
@ShahzaibIbrahim But maybe that would require another readaptation of the calculations. Shouldn't we just fix it right away? Then it would also make more sense to take into account the |
I have added a commit to put highlight on rounded tabs. Although it looks big jagged as original one (non-selected rounded tabs) also bit jagged. I have reused the shape. Here's the comparison of the selected and unselected tabs:
|
|
This pull request changes some projects for the first time in this development cycle. Warning 🚧 This PR cannot be modified by maintainers because edits are disabled or it is created from an organization repository. To obtain the required changes apply the git patch manually as an additional commit. Git patchFurther information are available in Common Build Issues - Missing version increments. |
Selected tabs highlight look slightly off and more noticeable when zoom is not 100%. These adjusted value shows no gaps from top and better aligned highlights for tabs (Theme is enabled)
691b22d to
fe5e96b
Compare
| int horizontalOffset = itemIndex == 0 || cornerSize == SQUARE_CORNER ? 0 : 1; | ||
| int widthAdjustment = cornerSize == SQUARE_CORNER ? 0 : 1; |
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.
Since cornerSize == SQUARE_CORNER in this branch, these variable can be completely removed, can't they?
| } else { | ||
| int[] highlightShape = Arrays.copyOf(tabOutlinePoints, tabOutlinePoints.length); | ||
| // Update Y coordinates in shape to apply highlight thickness | ||
| int thickness = 2; |
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.
Why don't we need to apply the more complex calculation logic used for the SQUARE_CORNER case here? This seems to lead to hightlights that are far too thick:


Also note that there are blue-colored fragments remaining to the left and right. Seems like some more tweaking of the shape points is necessary.
Screenshots are taken at 175%.
| int[] highlightShape = Arrays.copyOf(tabOutlinePoints, tabOutlinePoints.length); | ||
| // Update Y coordinates in shape to apply highlight thickness | ||
| int thickness = 2; | ||
| int highlightY = onBottom ? bottomY - thickness : thickness + 1; |
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.
This introduces a regression, as it uses onBottom instead of the highlightOnTop. I think there is even a mistake in the general distinction just based on cornerSize == SQUARE_CORNER. You will also need to draw a rectangle in case of round corners but when the highlight is not at the end with the rounding, i.e., if highlightOnTop != onBottom. So the condition for drawing a rectangle probably needs to be cornerSize == SQUARE_CORNER || highlightOnTop == onBottom.










Selected tabs highlight look slightly off and more noticeable when zoom is not 100%. These adjusted value shows no gaps from top and better aligned highlights for tabs (Theme is enabled)
Results:
At 300% Before Changes:

From top left one px perhaps is missing and from top it is slightly downwards leaving the gap on top.
At 300% After Changes: