From 5fd4ea52653c57ce2c0072a15ebe454a92a91df6 Mon Sep 17 00:00:00 2001 From: ptief Date: Thu, 25 Aug 2022 16:28:34 +0200 Subject: [PATCH] add support for zoom level of program images add support for zoom level of program images --- .../misc/ExternalProgramImageDescriptor.java | 28 +++++-------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/ExternalProgramImageDescriptor.java b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/ExternalProgramImageDescriptor.java index bd685f79db5..bef0b2e3595 100644 --- a/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/ExternalProgramImageDescriptor.java +++ b/bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/misc/ExternalProgramImageDescriptor.java @@ -62,29 +62,15 @@ public Image getImage() { return createImage(); } - /** - * Returns an SWT Image that is described by the information in this descriptor. - * Each call returns a new Image. - */ @Override - public ImageData getImageData() { - ImageData data = null; - ImageData defaultImage = WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE).getImageData(); - if (defaultImage == null) { - return null; + public ImageData getImageData(int zoom) { + if (program != null) { + ImageData imageData = program.getImageData(zoom); + if (imageData != null) { + return imageData; + } } - - if (program == null || ((data = program.getImageData()) == null)) { - return defaultImage; - } - - // The images in GNOME are too big. Scaling them does not give nice result so - // return defaultImage; - if (data.height > defaultImage.height || data.width > defaultImage.width) { - return defaultImage; - } - - return data; + return WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE).getImageData(zoom); } /**