-
Notifications
You must be signed in to change notification settings - Fork 137
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
Adding disable/gray image props in ImageData when rescaled #1347
Conversation
2ec84b8
to
864dadc
Compare
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
864dadc
to
c19a71e
Compare
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
5c548f2
to
49fb9dc
Compare
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.
I tested it and it has the expected behavior ✔️
There's only one small typo (missing "e") and I would like to have the snippet also contributed. You need to set the name of the dialog properly though: shell.setText("Snippet382");
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
8c4a483
to
cdaf0f0
Compare
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.
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet382.java
Outdated
Show resolved
Hide resolved
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet382.java
Show resolved
Hide resolved
ca6e7fc
to
23bfed5
Compare
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.
From a functional perspective, the changes look sound to me. Still the change seem to introduce some unnecessary complexity (or I do not understand the necessity for the complexity so far).
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
5a7806c
to
c378d22
Compare
examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet382.java
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
c378d22
to
4f5c4d6
Compare
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.
Thank you for the recent improvements. The PR looks much better now. Changes are easy to comprehend and look sound. I only have one comment remaining w.r.t. documentation, but since it is about a private method that is easy to comprehend by its name and implementation, I propose to simply remove the potentially irritating documentation.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
Disabled image do not work when rescaled. Writing a new method copyImageDataForDisabledOrGrayImages and calling it before init image in win32_getHandle
4f5c4d6
to
fefe52f
Compare
Commit ba97568 broke compilation of snippets project on Linux. Please next time exclude platform specific sources in the Snippets project from classpath on the platforms where the source can't compile. I've created #1372. @HeikoKlare: I wonder if we can make the |
I once opened some requests to JDT to support class folders with different settings so one not need copy around classpath settings or other hacks:
Also see this related Tycho issues:
In the end such issues are that seldom that no one really cared to work on that. |
Thank you for the fix, @iloveeclipse! I missed that the snippet uses OS-specific functionality. I guess that it also breaks on MacOS. I will check that as a follow-up. It would of course be great to have automated checks for this kind of problems in the build / Tycho. But I am not sure whether it is worth the effort (as indicated by Christoph's comment) or if it would not be even better to introduce some (better) way of declaring and statically checking (already in the IDE) what is part of the SWT API. E.g., having warnings for access of classes/methods marked as |
MacOS is also affected. I've created #1373 to fix that. |
I think this would usually happen if we enable API analysis, but here again, the question is how much effort one want to invest compared to how often are snippets added. I usually simply have an own project in my workspace named "swt-test" that I use to write a snippet then I copy it over (e.g. for a bugreport or for permanent usage), that works "good enough" at least :-) |
Fully agree that it's a matter of ROI and if this was only relevant for snippets, I agree that only low effort would be worth the benefit in the rather seldom case of having changes/additions to snippets. I have to admit that I just understood @iloveeclipse's comment completely: the snippet project is not part of the Tycho build at all. I was not aware of that. Doing that should be quite easy and thus a quick win (maybe as an intermediate solution until the requests mentioned by @laeubi for JDT/Tycho have been processed). I will have a look at that. |
Works fine, but requires at least: @laeubi can you estimate how difficult it would be to implement that in Tycho? |
Disabled image do not work when rescaled. Writing a new method
copyImageDataForDisabledOrGrayImages
and calling it before init image in win32_getHandle.HOW TO TEST
Put the following snippet into the snippet folder to test the effect: