File tree Expand file tree Collapse file tree 3 files changed +46
-0
lines changed
bundles/org.eclipse.swt/Eclipse SWT
cocoa/org/eclipse/swt/widgets
gtk/org/eclipse/swt/widgets
win32/org/eclipse/swt/widgets Expand file tree Collapse file tree 3 files changed +46
-0
lines changed Original file line number Diff line number Diff line change 1818import org .eclipse .swt .*;
1919import org .eclipse .swt .events .*;
2020import org .eclipse .swt .graphics .*;
21+ import org .eclipse .swt .internal .*;
2122import org .eclipse .swt .internal .cocoa .*;
2223
2324/**
@@ -1992,6 +1993,21 @@ public void setModified (boolean modified) {
19921993 window .setDocumentEdited (modified );
19931994}
19941995
1996+ /**
1997+ * Returns the zoom of the shell.
1998+ * <p>
1999+ * Hint: The returned value is the zoom of the shell as originally considered by
2000+ * the OS and not an adjusted zoom value as considered by SWT autoscaling capabilities.
2001+ * </p>
2002+ *
2003+ * @return the zoom for this shell
2004+ *
2005+ * @since 3.133
2006+ */
2007+ public int getZoom () {
2008+ return DPIUtil .getNativeDeviceZoom ();
2009+ }
2010+
19952011/**
19962012 * Sets the shape of the shell to the region specified
19972013 * by the argument. When the argument is null, the
Original file line number Diff line number Diff line change @@ -2786,6 +2786,21 @@ public void setModified (boolean modified) {
27862786 this .modified = modified ;
27872787}
27882788
2789+ /**
2790+ * Returns the zoom of the shell.
2791+ * <p>
2792+ * Hint: The returned value is the zoom of the shell as originally considered by
2793+ * the OS and not an adjusted zoom value as considered by SWT autoscaling capabilities.
2794+ * </p>
2795+ *
2796+ * @return the zoom for this shell
2797+ *
2798+ * @since 3.133
2799+ */
2800+ public int getZoom () {
2801+ return DPIUtil .getNativeDeviceZoom ();
2802+ }
2803+
27892804/**
27902805 * Sets the shape of the shell to the region specified
27912806 * by the argument. When the argument is null, the
Original file line number Diff line number Diff line change @@ -1233,6 +1233,21 @@ public ToolBar getToolBar() {
12331233 return null ;
12341234}
12351235
1236+ /**
1237+ * Returns the zoom of the shell.
1238+ * <p>
1239+ * Hint: The returned value is the zoom of the shell as originally considered by
1240+ * the OS and not an adjusted zoom value as considered by SWT autoscaling capabilities.
1241+ * </p>
1242+ *
1243+ * @return the zoom for this shell
1244+ *
1245+ * @since 3.133
1246+ */
1247+ public int getZoom () {
1248+ return DPIUtil .mapDPIToZoom (OS .GetDpiForWindow (handle ));
1249+ }
1250+
12361251@ Override
12371252Composite findDeferredControl () {
12381253 return layoutCount > 0 ? this : null ;
You can’t perform that action at this time.
0 commit comments