-
Notifications
You must be signed in to change notification settings - Fork 186
[Refactoring] Streamline calls to Image#adaptImageDataIfDisabledOrGray() #2737
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
|
@copilot could you review it first. |
Test Results 118 files ±0 118 suites ±0 17m 59s ⏱️ +11s Results for commit f6ec60e. ± Comparison against base commit 9aa5074. This pull request skips 1 test.♻️ This comment has been updated with latest results. |
018f3fb to
34ea42d
Compare
|
One remark: as the change seems to affect Cursor as well - Is there a Snippet/test case or could you provide one to test correctness for Cursor? |
I have added a sanity test for disabled cursor in the description. |
HeikoKlare
left a comment
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.
This PR seems to currently mix up two changes: one is streamlining calls to adaptImageDataIfDisabledOrGray in the sense that there should be a common concept when to call it consistently (without any behavioral changes). Another is applying this method where it (erronoeously? on purpose?) was not applied before. The latter affects Icon-type images, for which it seems as if the adaptation was not always applied.
Can we split the PR up accordingly and, in particular, how can we see/test the changed behavior for Icon-type images?
|
@HeikoKlare there seems to be a confusion. For Icon it was working even before. Although during all these refactoring the signature for org.eclipse.swt.graphics.Image.init(Device, ImageData, int) has changed which accepts the style flag and org.eclipse.swt.graphics.Image.initIcon(Device, ImageData, ImageData, int) method which is called from cursor now need to pass the style flag (which could be null since the image for that now can be initialized directly with disabled or gray flag. The short answer is the flag was applied even before this change for the images of type Icon (can be tested through I have made a small change which will reflect previous behavior as is for the icons after refactoring. |
34ea42d to
c099059
Compare
Enabling a consistent pattern to apply disablement or graying of an Image. They are applied whenever a handle is being created from init method. Ensuring streamline usage and avoid double calls to this method.
c099059 to
f6ec60e
Compare
When running I went through the call sequences a bit to see if I miss something and found that |
This snippet can test the icon disablement and grayness. Initially I though we had an example in 382. |
Enabling a consistent pattern to apply disablement or graying of an Image. They are applied whenever a handle is being created from init method. Ensuring streamline usage and avoid double calls to this method.
How to test
Snippet382with following VM Argument:swt.autoScale.updateOnRuntime=trueSanity test for the Cursor:
The cursor should be disabled using this snippet.