File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,8 @@ public abstract class Control extends Widget implements Drawable {
78
78
Font font ;
79
79
int drawCount , foreground , background , backgroundAlpha = 255 ;
80
80
81
+ private static final String DATA_SHELL_ZOOM = "SHELL_ZOOM" ;
82
+
81
83
/**
82
84
* Prevents uninitialized instances from being created outside the package.
83
85
*/
@@ -1256,6 +1258,15 @@ public Cursor getCursor () {
1256
1258
return cursor ;
1257
1259
}
1258
1260
1261
+ @ Override
1262
+ public Object getData (String key ) {
1263
+ if (DATA_SHELL_ZOOM .equals (key )) {
1264
+ Shell shell = getShell ();
1265
+ return shell == null ? null : shell .nativeZoom ;
1266
+ }
1267
+ return super .getData (key );
1268
+ }
1269
+
1259
1270
/**
1260
1271
* Returns <code>true</code> if the receiver is detecting
1261
1272
* drag gestures, and <code>false</code> otherwise.
Original file line number Diff line number Diff line change @@ -134,7 +134,6 @@ public abstract class Widget {
134
134
static final int AUTO_TEXT_DIRECTION = SWT .LEFT_TO_RIGHT | SWT .RIGHT_TO_LEFT ;
135
135
136
136
private static final String DATA_AUTOSCALE_DISABLED = "AUTOSCALE_DISABLED" ;
137
- private static final String DATA_NATIVE_ZOOM = "NATIVE_ZOOM" ;
138
137
139
138
/* Initialize the Common Controls DLL */
140
139
static {
@@ -189,7 +188,6 @@ public Widget (Widget parent, int style) {
189
188
display = parent .display ;
190
189
reskinWidget ();
191
190
notifyCreationTracker ();
192
- this .setData (DATA_NATIVE_ZOOM , this .nativeZoom );
193
191
registerDPIChangeListener ();
194
192
}
195
193
@@ -2725,9 +2723,7 @@ int getZoom() {
2725
2723
}
2726
2724
2727
2725
void handleDPIChange (Event event , float scalingFactor ) {
2728
- int newZoom = event .detail ;
2729
- this .nativeZoom = newZoom ;
2730
- this .setData (DATA_NATIVE_ZOOM , newZoom );
2726
+ this .nativeZoom = event .detail ;
2731
2727
}
2732
2728
2733
2729
int getSystemMetrics (int nIndex ) {
You can’t perform that action at this time.
0 commit comments