|
14 | 14 | *******************************************************************************/ |
15 | 15 | package org.eclipse.swt.custom; |
16 | 16 |
|
| 17 | +import java.util.*; |
| 18 | + |
17 | 19 | import org.eclipse.swt.*; |
18 | 20 | import org.eclipse.swt.graphics.*; |
19 | 21 | import org.eclipse.swt.widgets.*; |
@@ -93,8 +95,8 @@ public class CTabFolderRenderer { |
93 | 95 | static final int BUTTON_FILL = SWT.COLOR_LIST_BACKGROUND; |
94 | 96 | static final int BORDER1_COLOR = SWT.COLOR_WIDGET_NORMAL_SHADOW; |
95 | 97 |
|
96 | | - static final int ITEM_TOP_MARGIN = 2; |
97 | | - static final int ITEM_BOTTOM_MARGIN = 2; |
| 98 | + static final int ITEM_TOP_MARGIN = 3; |
| 99 | + static final int ITEM_BOTTOM_MARGIN = 3; |
98 | 100 | static final int ITEM_LEFT_MARGIN = 4; |
99 | 101 | static final int ITEM_RIGHT_MARGIN = 4; |
100 | 102 | static final int INTERNAL_SPACING = 4; |
@@ -1382,7 +1384,15 @@ void drawSelected(int itemIndex, GC gc, Rectangle bounds, int state ) { |
1382 | 1384 | if (parent.selectionHighlightBarThickness > 0 && parent.simple) { |
1383 | 1385 | Color previousColor = gc.getBackground(); |
1384 | 1386 | gc.setBackground(item.getDisplay().getSystemColor(parent.shouldHighlight() ? SWT.COLOR_LIST_SELECTION : SWT.COLOR_WIDGET_DISABLED_FOREGROUND)); |
1385 | | - gc.fillRectangle(x + 1 /* outline */, parent.onBottom ? y + height - 1 - parent.selectionHighlightBarThickness : y + 1, width - 2 /*outline*/, parent.selectionHighlightBarThickness); |
| 1387 | + |
| 1388 | + int[] highlightShape = Arrays.copyOf(shape, shape.length); |
| 1389 | + // Update Y coordinates in shape to apply highlight thickness |
| 1390 | + int thickness = parent.selectionHighlightBarThickness; |
| 1391 | + boolean onBottom = parent.onBottom; |
| 1392 | + int bottomY = y + height - 1; |
| 1393 | + int highlightY = onBottom ? bottomY - thickness : thickness + 1; |
| 1394 | + highlightShape[1] = highlightShape[3] = highlightShape[highlightShape.length - 1] = highlightShape[highlightShape.length - 3] = highlightY; |
| 1395 | + gc.fillPolygon(highlightShape); |
1386 | 1396 | gc.setBackground(previousColor); |
1387 | 1397 | } |
1388 | 1398 |
|
|
0 commit comments