|
18 | 18 | package org.eclipse.e4.ui.workbench.renderers.swt; |
19 | 19 |
|
20 | 20 | import java.lang.reflect.Field; |
| 21 | +import java.util.Arrays; |
21 | 22 | import java.util.Objects; |
22 | 23 | import org.eclipse.core.runtime.Platform; |
23 | 24 | import org.eclipse.core.runtime.preferences.IEclipsePreferences; |
@@ -627,11 +628,28 @@ void drawSelectedTab(int itemIndex, GC gc, Rectangle bounds) { |
627 | 628 | highlightOnTop = !highlightOnTop; |
628 | 629 | } |
629 | 630 | int highlightHeight = 2; |
630 | | - int verticalOffset = highlightOnTop ? 0 : bounds.height - (highlightHeight - 1); |
631 | | - int horizontalOffset = itemIndex == 0 || cornerSize == SQUARE_CORNER ? 0 : 1; |
632 | | - int widthAdjustment = cornerSize == SQUARE_CORNER ? 0 : 1; |
633 | | - gc.fillRectangle(bounds.x + horizontalOffset, bounds.y + verticalOffset, bounds.width - widthAdjustment, |
634 | | - highlightHeight); |
| 631 | + if (highlightOnTop == onBottom) { |
| 632 | + int verticalOffset = bounds.height - (highlightHeight); |
| 633 | + gc.fillRectangle(outlineBoundsForOutline.x, bounds.y + verticalOffset, outlineBoundsForOutline.width, |
| 634 | + highlightHeight); |
| 635 | + gc.setForeground(selectedTabHighlightColor); |
| 636 | + gc.drawLine(outlineBoundsForOutline.x, bounds.y + verticalOffset + highlightHeight, |
| 637 | + outlineBoundsForOutline.x + outlineBoundsForOutline.width, |
| 638 | + bounds.y + verticalOffset + highlightHeight); |
| 639 | + } else if (cornerSize == SQUARE_CORNER) { |
| 640 | + gc.fillRectangle(outlineBoundsForOutline.x, |
| 641 | + outlineBoundsForOutline.y, outlineBoundsForOutline.width, highlightHeight + 1); |
| 642 | + } else { |
| 643 | + boolean gcAdvanced = gc.getAdvanced(); |
| 644 | + gc.setAdvanced(false); |
| 645 | + int[] highlightShape = Arrays.copyOfRange(tabOutlinePoints, 12, tabOutlinePoints.length - 12); |
| 646 | + int highlightY = highlightOnTop ? highlightHeight |
| 647 | + : outlineBoundsForOutline.height - highlightHeight; |
| 648 | + highlightShape[1] = highlightShape[3] = highlightShape[highlightShape.length |
| 649 | + - 1] = highlightShape[highlightShape.length - 3] = highlightY; |
| 650 | + gc.fillPolygon(highlightShape); |
| 651 | + gc.setAdvanced(gcAdvanced); |
| 652 | + } |
635 | 653 | } |
636 | 654 |
|
637 | 655 | if (backgroundPattern != null) { |
|
0 commit comments