Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNiraj Modi2018-07-19 06:13:45 +0000
committerNiraj Modi2018-07-19 06:13:45 +0000
commit0db816029ec1abfbf29270c7e886d235575376d1 (patch)
treec7b17f6f10da5197195d23598f541159c163010f
parent27613b0ff94a7e45afa9d090722f6e9443e98880 (diff)
downloadeclipse.platform.swt-0db816029ec1abfbf29270c7e886d235575376d1.tar.gz
eclipse.platform.swt-0db816029ec1abfbf29270c7e886d235575376d1.tar.xz
eclipse.platform.swt-0db816029ec1abfbf29270c7e886d235575376d1.zip
Bug 537097 - [Win][HiDPI] Table/Tree custom header: sort indicator too
small at HiDPI with set header colors Change-Id: I1a490aab14bad950b005c6384f66fbd10da8361f Signed-off-by: Niraj Modi <niraj.modi@in.ibm.com>
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Tree.java8
2 files changed, 12 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
index f3963bd300..25a53dcddc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Table.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -6941,7 +6941,11 @@ LRESULT wmNotifyHeader (NMHDR hdr, long /*int*/ wParam, long /*int*/ lParam) {
long /*int*/ pen = OS.CreatePen (OS.PS_SOLID, 1, OS.GetSysColor(OS.COLOR_3DDKSHADOW));
long /*int*/ oldPen = OS.SelectObject (nmcd.hdc, pen);
int center = rects[i].left + (rects[i].right - rects[i].left) / 2;
- int leg = 3;
+ /*
+ * Sort indicator size needs to scale as per the Native Windows OS DPI level
+ * when header is custom drawn. For more details refer bug 537097.
+ */
+ int leg = DPIUtil.autoScaleUpUsingNativeDPI(3);
if (sortDirection == SWT.UP) {
OS.Polyline(nmcd.hdc, new int[] {center-leg, 1+leg, center+1, 0}, 2);
OS.Polyline(nmcd.hdc, new int[] {center+leg, 1+leg, center-1, 0}, 2);
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 eac9e367a3..2df459ac1b 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2017 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7696,7 +7696,11 @@ LRESULT wmNotifyHeader (NMHDR hdr, long /*int*/ wParam, long /*int*/ lParam) {
long /*int*/ pen = OS.CreatePen (OS.PS_SOLID, 1, OS.GetSysColor(OS.COLOR_3DDKSHADOW));
long /*int*/ oldPen = OS.SelectObject (nmcd.hdc, pen);
int center = rects[i].left + (rects[i].right - rects[i].left) / 2;
- int leg = 3;
+ /*
+ * Sort indicator size needs to scale as per the Native Windows OS DPI level
+ * when header is custom drawn. For more details refer bug 537097.
+ */
+ int leg = DPIUtil.autoScaleUpUsingNativeDPI(3);
if (sortDirection == SWT.UP) {
OS.Polyline(nmcd.hdc, new int[] {center-leg, 1+leg, center+1, 0}, 2);
OS.Polyline(nmcd.hdc, new int[] {center+leg, 1+leg, center-1, 0}, 2);

Back to the top