[prev in list] [next in list] [prev in thread] [next in thread]
List: openjdk-openjfx-dev
Subject: RFR: 8181084: JavaFX show big icons in system menu on macOS with Retina display
From: Paul <duke () openjdk ! java ! net>
Date: 2022-02-27 11:53:10
Message-ID: r78AiBfZMTWGbmWFdRQ2qFku1ryHjVyYxFAG8WG75kY=.7b29181f-277d-41c0-9e40-66d88c958af9 () github ! com
[Download RAW message or body]
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">
-------------
Commit messages:
- Removing trailing whitespace.
- Correctly scales hi-res icons in MacOS system menu items
Changes: https://git.openjdk.java.net/jfx/pull/743/files
Webrev: https://webrevs.openjdk.java.net/?repo=jfx&pr=743&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8181084
Stats: 86 lines in 14 files changed: 84 ins; 0 del; 2 mod
Patch: https://git.openjdk.java.net/jfx/pull/743.diff
Fetch: git fetch https://git.openjdk.java.net/jfx pull/743/head:pull/743
PR: https://git.openjdk.java.net/jfx/pull/743
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic