diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java index e24bd918dfe..c4445e2ae94 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/CCombo.java @@ -2025,4 +2025,13 @@ public boolean traverse(int event){ } return super.traverse(event); } +/** + * @since 3.126 + */ +public static void adapt(CCombo combo, Consumer consumer) { + consumer.accept(combo.text); + consumer.accept(combo.list); + consumer.accept(combo.arrow); + consumer.accept(combo.popup); +} } diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/CommonWidgetsDPIChangeHandlers.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/CommonWidgetsDPIChangeHandlers.java index 1ac53b67756..3a44d9e984d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/CommonWidgetsDPIChangeHandlers.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/internal/CommonWidgetsDPIChangeHandlers.java @@ -13,6 +13,7 @@ *******************************************************************************/ package org.eclipse.swt.internal; +import org.eclipse.swt.custom.*; import org.eclipse.swt.graphics.*; import org.eclipse.swt.widgets.*; @@ -31,6 +32,7 @@ public class CommonWidgetsDPIChangeHandlers { public static void registerCommonHandlers() { DPIZoomChangeRegistry.registerHandler(CommonWidgetsDPIChangeHandlers::handleItemDPIChange, Item.class); + DPIZoomChangeRegistry.registerHandler(CommonWidgetsDPIChangeHandlers::handleCComboDPIChange, CCombo.class); } private static void handleItemDPIChange(Widget widget, int newZoom, float scalingFactor) { @@ -43,4 +45,12 @@ private static void handleItemDPIChange(Widget widget, int newZoom, float scalin item.setImage(image); } } -} + private static void handleCComboDPIChange(Widget widget, int newZoom, float scalingFactor) { + if (!(widget instanceof CCombo)) { + return; + } + CCombo combo = (CCombo) widget; + + CCombo.adapt(combo, w -> DPIZoomChangeRegistry.applyChange(w, newZoom, scalingFactor)); + } +} \ No newline at end of file