Skip to content

Commit b510ca2

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 b510ca2

File tree

1 file changed

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

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,10 +627,11 @@ void drawSelectedTab(int itemIndex, GC gc, Rectangle bounds) {
627627
highlightOnTop = !highlightOnTop;
628628
}
629629
int highlightHeight = 2;
630-
int verticalOffset = highlightOnTop ? 0 : bounds.height - (highlightHeight - 1);
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,
634+
outlineBoundsForOutline.width - widthAdjustment,
634635
highlightHeight);
635636
}
636637

0 commit comments

Comments
 (0)