diff options
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java | 1 | ||||
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java index f6cd0e8719..bac2c3c179 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java @@ -1696,6 +1696,7 @@ public class OS extends C { public static final int TVM_SETBKCOLOR = 0x111d; public static final int TVM_SETEXTENDEDSTYLE = TV_FIRST + 44; public static final int TVM_SETIMAGELIST = 0x1109; + public static final int TVM_SETINDENT = TV_FIRST + 7; public static final int TVM_SETINSERTMARK = 0x111a; public static final int TVM_SETITEM = 0x113f; public static final int TVM_SETITEMHEIGHT = TV_FIRST + 27; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java index 5386a5cbe6..eac9e367a3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java @@ -1893,6 +1893,15 @@ void createHandle () { long /*int*/ hFont = OS.GetStockObject (OS.SYSTEM_FONT); OS.SendMessage (handle, OS.WM_SETFONT, hFont, 0); + /* + * Bug in Windows. When image list is not set, tree glyph + * size is tied to tree indent. Indent doesn't automatically + * scale with DPI resulting in distorted glyph image + * at higher DPI settings. + */ + int indent = DPIUtil.autoScaleUpUsingNativeDPI(16); + OS.SendMessage(handle, OS.TVM_SETINDENT, indent, 0); + createdAsRTL = (style & SWT.RIGHT_TO_LEFT) != 0; } |