-
Notifications
You must be signed in to change notification settings - Fork 214
Converting Support tray to use Image with constructor that utilizes imageGCDrawer instead of imageData #3013
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?
Converting Support tray to use Image with constructor that utilizes imageGCDrawer instead of imageData #3013
Conversation
data.transparentPixel = 0; | ||
|
||
normal = new Image(display, data); | ||
normal.setBackground(transparent); |
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.
The setBackground call on the image has been omitted because it has no visible impact; the GC sets the image background to transparent.
dc8b9d4
to
9b3b3a6
Compare
I drafted this PR because it contains a commit that shall not be merged. I use that commit to start the checks in our organization: @arunjose696 once your PR is ready to be reviewed and merged, please rebase on |
9b3b3a6
to
dc8b9d4
Compare
Done |
Workflows approved |
dc8b9d4
to
d71bf53
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.
The code in itself looks good and I have also tested the behaviour and it seems to not change anything visually but it rather has a functional impact over SupportTray by using GcDrawer instead of ImageData to create the close button which provides a better scaling as compared to while using ImageData. I have a nit-picky suggestion to add on tops.
I think the commit title can be re-phrased: Use GcDrawer instead of ImageData for SupportTray images
...s/org.eclipse.ui.workbench/eclipseui/org/eclipse/ui/internal/statushandlers/SupportTray.java
Outdated
Show resolved
Hide resolved
This PR modifies SupportTray to use the Image constructor that utilizes ImageGCDrawer instead of ImageData, since scaling ImageData is a destructive operation.
d71bf53
to
8f317be
Compare
Done |
The
SupportTray
class previously used theImage(Device, ImageData)
constructor to draw the close button on the ToolBar positioned alongside the support tray.This PR modifies SupportTray to use the
Image
constructor that utilizesImageGCDrawer
instead ofImageData
, since scaling ImageData is a destructive operation.Triggering a supporttray is not so straight forward in runtime workspace. To test this implementation, the following example can be used. It simply opens a support tray with a toolbar and waits for it to be closed.
Note To run this example, you may need to temporarily add the following to the MANIFEST.MF file in the org.eclipse.swt.snippets project:
Alternatively, you can fix the project setup by following the error prompts in the IDE for this example.