Add method for providing disabled image descriptors#4094
Open
HeikoKlare wants to merge 2 commits into
Open
Conversation
Image descriptors are often shared and used with a ResourceManager to share an image created from the same descriptor. To do this with the disabled version of the image of a descriptor, a descriptor for the disabled image has to be managed in addition to the descriptor for the ordinary image. This change adds a method to an image descriptor for providing a shared image descriptor for the disabled version of the same image. This allows to only manage the original image's descriptor while also sharing the disabled version of that image. It is applied as a replacement at all placed which used the createWithFlags() operation of an image descriptor for creating an image descriptor for the disabled version of the image to ensure that a shared image descriptor is used there.
Contributor
|
This pull request changes some projects for the first time in this development cycle. An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch. Git patchFurther information are available in Common Build Issues - Missing version increments. |
Contributor
laeubi
reviewed
Jun 13, 2026
| * @return a shared image descriptor for a disabled version of the icon for this | ||
| * descriptor. | ||
| */ | ||
| public ImageDescriptor getDisabledDescriptor() { |
Contributor
There was a problem hiding this comment.
since there is no way to set it maybe it should be
Suggested change
| public ImageDescriptor getDisabledDescriptor() { | |
| public ImageDescriptor asDisabledDescriptor() { |
Also one might want to check if this is already a disabled one and then return this?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Image descriptors are often shared and used with a
ResourceManagerto share an image created from the same descriptor. To do this with the disabled version of the image of a descriptor, a descriptor for the disabled image has to be managed in addition to the descriptor for the ordinary image. This is what is also done in shared workbench images where an image descriptor for the original and the disabled image are managed independently.This change adds a method to an image descriptor for providing a shared image descriptor for the disabled version of the same image. This allows to only manage the original image's descriptor while also sharing the disabled version of that image. The disabled image descriptor is created lazy upon first access.
It is applied as a replacement at all placed which used the
createWithFlags()operation of an image descriptor for creating an image descriptor for the disabled version of the image to ensure that a shared image descriptor is used there.As a further follow-up task, remaining usages of independently managed image descriptors for disabled image versions can be exchanged with usage of the new API.
This also contributes to:
Feedback
Like always, feedback is welcome, in particular since this will introduce new API at the
ImageDescriptorclass. In case you have other proposals for sharing the image descriptor for a disabled version of another image descriptor, please share it.