Skip to content

Conversation

@amartya4256
Copy link
Contributor

@amartya4256 amartya4256 commented Feb 11, 2025

This PR contributes to better scaling of Images obtained from Display::getSystemImage using better windows API LoadIconWithScaleDown for scaling. The new API also changes the old system icons to the modern Windows System Icons.
The idea is to have an ImageDataProvider for such Images which retrieve the image from the OS for the specified dimensions relevant to the zoom level and obtain its imageData instead of scaling the ImageData obtained from the handle of initialNativeZoom.

Standard Icons loaded using LoadImage (using user32.dll):
image

Standard Icons loaded using LoadIconWithScaleDown (using imageres.dll):
image

Contributes to
#62 and #127

@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2025

Test Results

   505 files   -  1     505 suites   - 1   7m 56s ⏱️ -5s
 4 304 tests  - 37   4 292 ✅  - 35   11 💤  - 3  1 ❌ +1 
16 560 runs   - 37  16 453 ✅  - 35  106 💤  - 3  1 ❌ +1 

For more details on these failures, see this check.

Results for commit f6f11bf. ± Comparison against base commit 9b1bcf4.

This pull request removes 37 tests.
org.eclipse.swt.graphics.ImageWin32Tests ‑ testImageDataForDifferentFractionalZoomsShouldBeDifferent
org.eclipse.swt.graphics.ImageWin32Tests ‑ testImageShouldHaveDimesionAsPerZoomLevel
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testByteArrayTransfer
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testFileTransfer
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testHtmlTransfer
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromCopiedImage
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImage
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImageData
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testImageTransfer_fromImageDataFromImage
org.eclipse.swt.tests.win32.Test_org_eclipse_swt_dnd_DND ‑ testRtfTransfer
…

♻️ This comment has been updated with latest results.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a first glance, the change looks sound and moving to up-to-date system icons that can be retrieved in proper scaling is great.

For now, I have one question regarding the used scale value.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, the change looks good. I've tested it and it also works quite fine. Only the sizes of the retrieved icons do not make sense to me.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now. When taking another look, I only came across a chance for a little code cleanup. Maybe you can update the PR to incorporate that.

@amartya4256 amartya4256 force-pushed the amartya4256/getSystemImage_fix branch from 782efc3 to a326140 Compare February 24, 2025 15:10
@HeikoKlare
Copy link
Contributor

Please revert the formatting changes reintroduced with the recent change.

@amartya4256 amartya4256 force-pushed the amartya4256/getSystemImage_fix branch from a326140 to a0e3e16 Compare March 4, 2025 08:39
@HeikoKlare HeikoKlare force-pushed the amartya4256/getSystemImage_fix branch 3 times, most recently from c0478f1 to f720b02 Compare March 8, 2025 09:10
This commit contributes to better scaling of Images obtained from
Display::getSystemImage using better windows API LoadIconWithScaleDown
for scaling. The new API also changes the old system icons to the new Windows System Icons.

Contributes to
eclipse-platform#62 and
eclipse-platform#127
@HeikoKlare HeikoKlare force-pushed the amartya4256/getSystemImage_fix branch from f720b02 to f6f11bf Compare March 8, 2025 10:48
@HeikoKlare
Copy link
Contributor

Failing test is unrelated and documented: #1843

@HeikoKlare HeikoKlare merged commit f48b2ad into eclipse-platform:master Mar 8, 2025
12 of 14 checks passed
@HeikoKlare HeikoKlare deleted the amartya4256/getSystemImage_fix branch March 8, 2025 10:59
@HeikoKlare
Copy link
Contributor

FTR: binaries successfully built and pushsed on 2nd attempt: d25bdc3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor Display::getSystemImage to return dynamically scalable images

2 participants