From 1bc1879f5597dcdcd05e618be97c968a7141efc3 Mon Sep 17 00:00:00 2001 From: ptief Date: Thu, 25 Aug 2022 16:28:34 +0200 Subject: [PATCH 1/2] regard external program images if zoom value is > 100% and removed deprecated method Signed-off-by: Patrick Tief --- .../misc/ExternalProgramImageDescriptor.java | 25 +++---------------- 1 file changed, 4 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..b5daeeb3938 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,12 @@ 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 && program.getImageData() != null) { + return program.getImageData(); } - - 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); } /** From 2d3e3c4211ced40612815df058798884634f5eee Mon Sep 17 00:00:00 2001 From: Patrick Tief Date: Wed, 21 Sep 2022 17:56:21 +0200 Subject: [PATCH 2/2] add support for zoom level of program images Signed-off-by: Patrick Tief --- .../ui/internal/misc/ExternalProgramImageDescriptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b5daeeb3938..09e43512b91 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 @@ -65,7 +65,7 @@ public Image getImage() { @Override public ImageData getImageData(int zoom) { if (program != null && program.getImageData() != null) { - return program.getImageData(); + return program.getImageData(zoom); } return WorkbenchImages.getImageDescriptor(ISharedImages.IMG_OBJ_FILE).getImageData(zoom); }