Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2018-05-02 10:08:04 +0000
committerLars Vogel2018-05-03 12:10:37 +0000
commit3b871dbaca01b0bfa4dade0a4713684d07f25402 (patch)
tree188ed36a93a802184baf8cfaea30eca1181d799d
parent91f56c5ce34cec783afce7b4b3a1121b034df6dc (diff)
downloadeclipse.platform.swt-3b871dbaca01b0bfa4dade0a4713684d07f25402.tar.gz
eclipse.platform.swt-3b871dbaca01b0bfa4dade0a4713684d07f25402.tar.xz
eclipse.platform.swt-3b871dbaca01b0bfa4dade0a4713684d07f25402.zip
Bug 480586 - [Win32][HiDPI] Tree expansion triangle issues
Fix tree glyph DPI scaling for trees without image list. Change-Id: I6d052eb08d6d33fde1690ff7c0e2c6d8dd690b92 Co-authored-by: Conrad Groth <info@conrad-groth.de> Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java9
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;
}

Back to the top