File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ public abstract class Control extends Widget implements Drawable {
82
82
Font font ;
83
83
int drawCount , foreground , background , backgroundAlpha = 255 ;
84
84
85
+ private static final String DATA_NATIVE_ZOOM = "NATIVE_ZOOM" ;
86
+
85
87
/**
86
88
* Prevents uninitialized instances from being created outside the package.
87
89
*/
@@ -1258,6 +1260,15 @@ public Cursor getCursor () {
1258
1260
return cursor ;
1259
1261
}
1260
1262
1263
+ @ Override
1264
+ public Object getData (String key ) {
1265
+ if (DATA_NATIVE_ZOOM .equals (key )) {
1266
+ Shell shell = getShell ();
1267
+ return shell == null ? null : shell .nativeZoom ;
1268
+ }
1269
+ return super .getData (key );
1270
+ }
1271
+
1261
1272
/**
1262
1273
* Returns <code>true</code> if the receiver is detecting
1263
1274
* 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 {
@@ -190,7 +189,6 @@ public Widget (Widget parent, int style) {
190
189
display = parent .display ;
191
190
reskinWidget ();
192
191
notifyCreationTracker ();
193
- this .setData (DATA_NATIVE_ZOOM , this .nativeZoom );
194
192
}
195
193
196
194
void _addListener (int eventType , Listener listener ) {
@@ -2719,7 +2717,6 @@ int getZoom() {
2719
2717
2720
2718
private static void handleDPIChange (Widget widget , int newZoom , float scalingFactor ) {
2721
2719
widget .nativeZoom = newZoom ;
2722
- widget .setData (DATA_NATIVE_ZOOM , newZoom );
2723
2720
}
2724
2721
2725
2722
int getSystemMetrics (int nIndex ) {
You can’t perform that action at this time.
0 commit comments