Skip to content
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

Avoid ImageIcon use in more places, to preserve HiDPI icon resolution #7472

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

eirikbakke
Copy link
Contributor

@eirikbakke eirikbakke commented Jun 13, 2024

Replace various instances of 'new ImageIcon' with ImageUtilities.image2Icon in the platform module. This preserves HiDPI icons (e.g. SVG icons loaded by ImageUtilities) when relevant, and preserves rendering hints in ImageUtilities for bitmap icon scaling.

(These changes were made to ensure that the SVG icons added in #7463 actually show up in high resolution in various places.)

…e2Icon in the platform module. This preserves HiDPI icons (e.g. SVG icons loaded by ImageUtilities) where relevant.
@eirikbakke eirikbakke added UI User Interface Platform [ci] enable platform tests (platform/*) ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) labels Jun 13, 2024
Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

Build from source - saw no change on "normal DPI", but changes look sane to me.

@eirikbakke
Copy link
Contributor Author

@matthiasblaesing Thanks! Yeah, with no HiDPI scaling, icons should look identical.

Copy link
Contributor

@matthiasblaesing matthiasblaesing left a comment

Choose a reason for hiding this comment

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

Yeah I suspected as much, I was between Comment and Approve. I eyeballed it, it builds, so it should work. If it does what it promises, would need someone with HiDPI setup.

@eirikbakke
Copy link
Contributor Author

Verifying that things don't break on regular 1:1 scaling is probably good enough, since any visual difference is purely cosmetic. I've also tested the patch in my working IDE and NetBeans Platform app for the last 6 months, confirming no breakage.

(On Windows, I think scaling can be enabled from the "Display settings" control panel app whether or not the screen is actually HiDPI. On MacOS, every MacBook or Apple display is Retina i.e. 2x scaling these days.)

@eirikbakke eirikbakke merged commit 37bdd47 into apache:master Jul 2, 2024
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Platform [ci] enable platform tests (platform/*) UI User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants