RFR: 8181084: JavaFX show big icons in system menu on macOS with Retina display [v6]
Paul
duke at openjdk.org
Mon Jul 25 16:07:22 UTC 2022
> I hit on JDK-8181084 while making some changes to Scene Builder, so I decided to investigate.
>
> Please note: I have not done any Objective-C or MacOS development before. So I would really like some feedback from someone else who knows this stuff better.
>
> Anyway, after some googling, I discovered that MacOS uses points values for measurements and not pixels, so the actual fix for this issue was this block in `GlassMenu.m`:-
>
>
> if ((sx > 1) && (sy > 1) && (width > 1) && (height > 1)) {
> NSSize imgSize = {width / sx, height / sy};
> [image setSize: imgSize];
> }
>
>
> The rest of the changes were needed in order to get the `scaleX` and `scaleY` values down from `PixelUtils.java` into `GlassMenu.m`.
>
> Before this fix:-
>
> <img width="239" alt="Screenshot 2022-02-26 at 22 16 30" src="https://user-images.githubusercontent.com/437990/155880981-92163087-696b-4442-b047-845c276deb27.png">
>
> After this fix:-
>
> <img width="218" alt="Screenshot 2022-02-26 at 22 18 17" src="https://user-images.githubusercontent.com/437990/155880985-6bff0a06-9aee-4db2-b696-64730b0a6feb.png">
Paul has updated the pull request incrementally with one additional commit since the last revision:
Minor refactoring and code cleanup based on review feedback.
-------------
Changes:
- all: https://git.openjdk.org/jfx/pull/743/files
- new: https://git.openjdk.org/jfx/pull/743/files/90971eeb..5c428549
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jfx&pr=743&range=05
- incr: https://webrevs.openjdk.org/?repo=jfx&pr=743&range=04-05
Stats: 64 lines in 6 files changed: 29 ins; 18 del; 17 mod
Patch: https://git.openjdk.org/jfx/pull/743.diff
Fetch: git fetch https://git.openjdk.org/jfx pull/743/head:pull/743
PR: https://git.openjdk.org/jfx/pull/743
More information about the openjfx-dev
mailing list