Skip to content

Follow-Up Feature: Icon-Enablement with Rasterization of SVGs #2621

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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,23 @@ public URLImageDataProvider(String url) {
public ImageData getImageData(int zoom) {
return URLImageDescriptor.getImageData(url, zoom);
}

//
// @Override
// public ImageData getCustomizedImageData(int zoom, int flag) {
// return URLImageDescriptor.getCustomizedImageData(url, zoom, flag);
// }

// @Override
// public boolean supportsRasterizationFlag(int flag) {
// boolean supportsFlag = flag == SWT.IMAGE_DISABLE || flag == SWT.IMAGE_GRAY || flag == SWT.IMAGE_COPY;
// URL tempURL = getURL(url);
// if (tempURL != null) {
// if (tempURL.toString().endsWith(".svg") && supportsFlag) { //$NON-NLS-1$
// return true;
// }
// }
// return false;
// }
}

private static long cumulativeTime;
Expand Down Expand Up @@ -139,6 +155,9 @@ public ImageData getImageData(int zoom) {
private static ImageData getImageData(String url, int zoom) {
URL tempURL = getURL(url);
if (tempURL != null) {
// if (tempURL.toString().endsWith(".svg")) { //$NON-NLS-1$
// return getImageData(tempURL, zoom);
// }
if (zoom == 100) {
return getImageData(tempURL);
}
Expand Down Expand Up @@ -177,6 +196,28 @@ private static ImageData getImageData(URL url) {
return result;
}

// private static ImageData getImageData(URL url, int zoom, int flag) {
// ImageData result = null;
// try (InputStream in = getStream(url)) {
// if (in != null) {
// result = new ImageData(in, zoom, flag);
// }
// } catch (SWTException e) {
// if (e.code != SWT.ERROR_INVALID_IMAGE) {
// throw e;
// // fall through otherwise
// }
// } catch (IOException e) {
// Policy.getLog().log(new Status(IStatus.ERROR, Policy.JFACE, e.getLocalizedMessage(), e));
// }
// return result;
// }
//
// private static ImageData getCustomizedImageData(String url, int zoom, int flag) {
// URL tempURL = getURL(url);
// return getImageData(tempURL, zoom, flag);
// }

/**
* Returns a stream on the image contents. Returns null if a stream could
* not be opened.
Expand Down
4 changes: 4 additions & 0 deletions features/org.eclipse.e4.rcp/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@
arch="aarch64"
version="0.0.0"/>

<plugin
id="org.eclipse.swt.svg"
version="0.0.0"/>

<plugin
id="org.eclipse.jface"
version="0.0.0"/>
Expand Down