Skip to content

Commit f0b1071

Browse files
ptiefHeikoKlare
authored andcommitted
add support for zoom level of program images
add support for zoom level of program images
1 parent 33cdc2a commit f0b1071

File tree

1 file changed

+7
-21
lines changed

1 file changed

+7
-21
lines changed

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/ExternalProgramImageDescriptor.java

+7-21
Original file line numberDiff line numberDiff line change
@@ -62,29 +62,15 @@ public Image getImage() {
6262
return createImage();
6363
}
6464

65-
/**
66-
* Returns an SWT Image that is described by the information in this descriptor.
67-
* Each call returns a new Image.
68-
*/
6965
@Override
70-
public ImageData getImageData() {
71-
ImageData data = null;
72-
ImageData defaultImage = WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE).getImageData();
73-
if (defaultImage == null) {
74-
return null;
66+
public ImageData getImageData(int zoom) {
67+
if (program != null) {
68+
ImageData imageData = program.getImageData(zoom);
69+
if (imageData != null) {
70+
return imageData;
71+
}
7572
}
76-
77-
if (program == null || ((data = program.getImageData()) == null)) {
78-
return defaultImage;
79-
}
80-
81-
// The images in GNOME are too big. Scaling them does not give nice result so
82-
// return defaultImage;
83-
if (data.height > defaultImage.height || data.width > defaultImage.width) {
84-
return defaultImage;
85-
}
86-
87-
return data;
73+
return WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE).getImageData(zoom);
8874
}
8975

9076
/**

0 commit comments

Comments
 (0)