-
Notifications
You must be signed in to change notification settings - Fork 185
Unify and improve image disablement calculation algorithm #1936
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
Unify and improve image disablement calculation algorithm #1936
Conversation
HannesWell
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.
Thanks for this PR, I really like the result of the proposed on-the-fly algorithm, i.e. the second version in your screenshots.
Below I have written some thoughts about the code.
...ipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/HSBImageProcessingDescriptor.java
Outdated
Show resolved
Hide resolved
...eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/ImageProcessingDescriptor.java
Outdated
Show resolved
Hide resolved
...eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/ImageProcessingDescriptor.java
Outdated
Show resolved
Hide resolved
8394e09 to
b4e063b
Compare
...eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/ImageProcessingDescriptor.java
Outdated
Show resolved
Hide resolved
...eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/ImageProcessingDescriptor.java
Show resolved
Hide resolved
b89f20a to
8045613
Compare
HannesWell
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.
As already written I really like the enhanced on-the-fly algorithm, i.e. the second version in your screenshots.
If I understand this PR correctly this is only applied for Windows and Mac. Wouldn't it make sense to use it on Linux as well for consistency?
Besides that this looks good generally. Thanks to everyone involved.
bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/graphics/Image.java
Outdated
Show resolved
Hide resolved
8045613 to
eff45c7
Compare
We can of course do it for Linux as well. I didn't do this as Linux uses an adapted algorithm (fitting with what GTK does) anyway. But for the sake of being/becoming consistent again, we could unify the algorithm across all OSes, as we keep the previous algorithms in a legacy mode anyway. I have adapted the PR accordingly. |
eff45c7 to
66cc605
Compare
5514efb to
c88552e
Compare
|
@HannesWell Can you please have another look at this? |
HannesWell
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.
Thanks for the update. All what you have described makes sense to me and I'm generally fine with this change and look forward to it. I didn't exactly follow the algorithm changes in all three Image implementations, but I trust your change.
I just have a remark regarding the naming of the values.
...org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/ImageColorTransformer.java
Outdated
Show resolved
Hide resolved
...org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/internal/image/ImageColorTransformer.java
Outdated
Show resolved
Hide resolved
b2ebdc5 to
fc96636
Compare
|
All comments have been resolved. If no one objects on this, I plan to merge this by end of today. |
HannesWell
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.
Thank you, looks good to me.
ac5af8e to
cd9e2d7
Compare
|
Thank you, @HannesWell! |
HannesWell
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.
Sounds good. Thanks for finding it.
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/graphics/Image.java
Show resolved
Hide resolved
bc84800 to
46faeaf
Compare
e4d89ec to
1ee3c47
Compare
Each OS-specific implementation of the Image class has its own implementation of an algorithm to calculate a disabled representation of a given image. In addition, the algorithm used on Windows and MacOS produces bad results, which is why usually pre-generated disabled icons are used. This change centralizes the implementations of those algorithms in ImageColorTransformers. The implementations used for the pre-generated disabled icons is added as default algorithm with an enhanced and the existing GTK-conforming algorithms being provided as options. Co-authored-by: Manuel Killinger <Manuel.Killinger@vector.com>
1ee3c47 to
677dd56
Compare
|
There was a successful Jenkins build without any new isues for this PR yesterday: https://ci.eclipse.org/releng/job/eclipse.platform.swt/job/PR-1936/7/ Thus merging despite Jenkins build failing due to https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/5893 |
|
Since Jenkins build failed for the PR: the subsequent master build after merging was successful has no new issues (https://ci.eclipse.org/releng/job/eclipse.platform.swt/job/master/1108/) |
This contributes an N&N informing about the icon disablement algorithm in SWT being improved and made configurable and the according removal of the usage of pre-generated disabled icons. See eclipse-platform/eclipse.platform.swt#1936
This contributes an N&N informing about the icon disablement algorithm in SWT being improved and made configurable and the according removal of the usage of pre-generated disabled icons. See eclipse-platform/eclipse.platform.swt#1936
This contributes an N&N informing about the icon disablement algorithm in SWT being improved and made configurable and the according removal of the usage of pre-generated disabled icons. See eclipse-platform/eclipse.platform.swt#1936
This contributes an N&N informing about the icon disablement algorithm in SWT being improved and made configurable and the according removal of the usage of pre-generated disabled icons. See eclipse-platform/eclipse.platform.swt#1936
This contributes an N&N informing about the icon disablement algorithm in SWT being improved and made configurable and the according removal of the usage of pre-generated disabled icons. See eclipse-platform/eclipse.platform.swt#1936
Each OS-specific implementation of the Image class has its own implementation of an algorithm to calculate a disabled representation of a given image. In addition, the algorithm used on Windows and MacOS produces bad results, which is why usually pre-generated disabled icons are used.
This change centralizes the implementations of those algorithms in ImageColorTransformers. The implementations used for the pre-generated disabled icons is added as default algorithm with an enhanced and the existing GTK-conforming algorithms being provided as options. It is supposed to render the usage of pre-generated disabled version of icons obsolete in many cases.
This is based on the snippet for testing different algorithms proposed by @killingerm and the according discussion in #1741
How to test
Most icons Eclipse are provided in a pre-generated, disabled version. To completely disable this and enforce all icons to be generated on-the-fly via the disablement algorithm, you can change the value of
IWorkbenchRegistryConstants#ATT_DISABLEDICONso that the according attribute defining the disabled icon path does not match.The following screenshot shows how the three version of icons look like:
enhancedon-the-fly algorithm