diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java index 7e340642da..2843e25389 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolder.java @@ -341,6 +341,7 @@ void init(int style) { case SWT.Selection: onSelection(event); break; case SWT.Activate: onActivate(event); break; case SWT.Deactivate: onDeactivate(event); break; + case SWT.ZoomChanged: onZoomChange(event); break; } }; @@ -362,7 +363,8 @@ void init(int style) { SWT.Resize, SWT.Traverse, SWT.Activate, - SWT.Deactivate + SWT.Deactivate, + SWT.ZoomChanged }; for (int folderEvent : folderEvents) { addListener(folderEvent, listener); @@ -370,6 +372,11 @@ void init(int style) { initAccessible(); } + +private void onZoomChange(Event event) { + update(); +} + void onDeactivate(Event event) { if (!highlightEnabled) { return; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java index 3e2c18a134..9edf33fbf8 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CTabFolderRenderer.java @@ -102,7 +102,8 @@ public class CTabFolderRenderer { static final int FLAGS = SWT.DRAW_TRANSPARENT | SWT.DRAW_MNEMONIC | SWT.DRAW_DELIMITER; static final String ELLIPSIS = "..."; //$NON-NLS-1$ private static final String CHEVRON_ELLIPSIS = "99+"; //$NON-NLS-1$ - private static final int CHEVRON_FONT_HEIGHT = 10; + private static final float CHEVRON_FONT_SIZE_FACTOR = 0.7f; + private static final int CHEVRON_BOTTOM_INDENT = 4; //Part constants /** @@ -926,7 +927,7 @@ void drawChevron(GC gc, Rectangle chevronRect, int chevronImageState) { Display display = parent.getDisplay(); Font font = getChevronFont(display); int fontHeight = font.getFontData()[0].getHeight(); - int indent = Math.max(2, (chevronRect.height - fontHeight - 4) /2); + int indent = Math.max(2, (chevronRect.height - fontHeight - CHEVRON_BOTTOM_INDENT) /2); int x = chevronRect.x + 2; int y = chevronRect.y + indent; int count = parent.getChevronCount(); @@ -1696,9 +1697,8 @@ Color getFillColor() { private Font getChevronFont(Display display) { if (chevronFont == null) { - Point dpi = display.getDPI(); - int fontHeight = 72 * CHEVRON_FONT_HEIGHT / dpi.y; FontData fd = parent.getFont().getFontData()[0]; + int fontHeight = (int) (fd.height * CHEVRON_FONT_SIZE_FACTOR); fd.setHeight(fontHeight); chevronFont = new Font(display, fd); }