-
Notifications
You must be signed in to change notification settings - Fork 189
Add setAutoscaleDisabled API to provide a better means to disabling autoscaling at widget level #2863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
This pull request changes some projects for the first time in this development cycle. Warning 🚧 This PR cannot be modified by maintainers because edits are disabled or it is created from an organization repository. To obtain the required changes apply the git patch manually as an additional commit. Git patchFurther information are available in Common Build Issues - Missing version increments. |
|
@amartya4256 can you please add a meaningful title and description to the PR, even if it's still a draft? |
cb3cc53 to
2a1545f
Compare
2a1545f to
f5b90b2
Compare
8ff51cb to
85a74d1
Compare
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Control.java
Outdated
Show resolved
Hide resolved
| * | ||
| * @since 3.133 | ||
| */ | ||
| public int getNativeZoom() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my opinion, we should call this getZoom(), as consumers should not bother with native/non-native zoms. And the effective zoom of a shell to deal with is always the native zoom, isn't it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is not always true. When autoscaling is disabled getZoom returns autoscaled zoom depending on the scaling mode i.e. quarter, half, etc. Hence to do so, we need to rename the internal method getZoom to getAutoscaledZoom and then call this API Shell#getZoom. I'll create a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * <li><b>{@link #DISABLED_INHERITED}</b> – Autoscaling is disabled for this | ||
| * component, but the decision originates from a parent or owner context. | ||
| * This is typically used to indicate that the disabled state was not set | ||
| * explicitly at this level but inherited from upstream configuration.</li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need a mode to set on a control that the autoscale mode will (not) be inherited to childred of the control rather than to indicate that a control has inherited the mode? Since it's only used in a setter, how should the current semantics be reasonably applied anyway? And isn't that even how it is currently implemented?
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/AutoscalingMode.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/AutoscalingMode.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/AutoscalingMode.java
Outdated
Show resolved
Hide resolved
85a74d1 to
d858871
Compare
This commit renames the method Widget#getZoom to getAutoscalingZoom since this methods return the value of the zoom based on the autoscaling technique, i.e. quarter, half, etc and whether autoscaling is enabled or disabled.
d858871 to
2c97d55
Compare
This commit adds an API to set Autoscaling Modes using the new enum AutoscalingMode with types Enabled, Disabled and Disabled_Inherited. Moreover, it also provides an API Shell#getNativeZoom to still make the consumer be able to obtain the actual zoom at a screen. These features are only enabled on win32 and will not perform any action on other platforms if called.
2c97d55 to
ddd5eab
Compare
This PR provides a new API
setAutoscaleDisabledto provide a better means of disabling autoscaling at widget level across all the platforms. The current implementation is intended to return a false when this method is called in cocoa and GTK and only perform an action win32 and return since we do not support widget level autoscaling control on GTK and cocoa yet.The convention of the method is as follows:
Things to be done:
depends on #2930