Skip to content

Commit 6a9a5c5

Browse files
committed
mac, linux: Lots of errors in Tip of the Day dialog
- Fixed SWT.ERROR_UNSUPPORTED_DEPTH error on Image.init() (called from org.eclipse.tips.ui.internal.Slider.CircleNumberDescriptor.getImageData(int)), because of the wrong PaletteData. - Fixed ugly 1 pixel border around image Fixes #1217
1 parent 1690bab commit 6a9a5c5

File tree

1 file changed

+4
-4
lines changed
  • ua/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal

1 file changed

+4
-4
lines changed

ua/org.eclipse.tips.ui/src/org/eclipse/tips/ui/internal/Slider.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import org.eclipse.swt.graphics.ImageData;
3838
import org.eclipse.swt.graphics.PaletteData;
3939
import org.eclipse.swt.graphics.Point;
40-
import org.eclipse.swt.graphics.RGB;
4140
import org.eclipse.swt.layout.GridData;
4241
import org.eclipse.swt.layout.GridLayout;
4342
import org.eclipse.swt.widgets.Button;
@@ -424,9 +423,10 @@ public ImageData getImageData(int zoom) {
424423
int imageHeight = textExtent.y + 5;
425424
int imageWidth = number > 9 ? textExtent.x + 8 : imageHeight;
426425

427-
PaletteData palette = new PaletteData(new RGB(255, 255, 255));
428-
ImageData transparentBackground = new ImageData(imageWidth, imageHeight, 32, palette);
429-
transparentBackground.transparentPixel = transparentBackground.getPixel(0, 0);
426+
/* Create a 24 bit image data with alpha channel */
427+
PaletteData palette = new PaletteData(0xFF, 0xFF00, 0xFF0000);
428+
ImageData transparentBackground = new ImageData(imageWidth, imageHeight, 24, palette);
429+
transparentBackground.alpha = 0;
430430

431431
Image image = new Image(display, transparentBackground);
432432
GC gc = new GC(image);

0 commit comments

Comments
 (0)