Skip to content

Commit 8be0403

Browse files
Adjust selection bounds for CTabRenderring
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)
1 parent 6b6dd81 commit 8be0403

File tree

1 file changed

+3
-3
lines changed
  • bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt

1 file changed

+3
-3
lines changed

bundles/org.eclipse.e4.ui.workbench.renderers.swt/src/org/eclipse/e4/ui/workbench/renderers/swt/CTabRendering.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,11 +626,11 @@ void drawSelectedTab(int itemIndex, GC gc, Rectangle bounds) {
626626
if (onBottom) {
627627
highlightOnTop = !highlightOnTop;
628628
}
629-
int highlightHeight = 2;
630-
int verticalOffset = highlightOnTop ? 0 : bounds.height - (highlightHeight - 1);
629+
int highlightHeight = superimposeKeylineOutline ? 3 : 2;
630+
int verticalOffset = highlightOnTop ? 0 : outlineBoundsForOutline.height - (highlightHeight - 1);
631631
int horizontalOffset = itemIndex == 0 || cornerSize == SQUARE_CORNER ? 0 : 1;
632632
int widthAdjustment = cornerSize == SQUARE_CORNER ? 0 : 1;
633-
gc.fillRectangle(bounds.x + horizontalOffset, bounds.y + verticalOffset, bounds.width - widthAdjustment,
633+
gc.fillRectangle(outlineBoundsForOutline.x + horizontalOffset, outlineBoundsForOutline.y + verticalOffset, outlineBoundsForOutline.width - widthAdjustment,
634634
highlightHeight);
635635
}
636636

0 commit comments

Comments
 (0)