Only square icons possible?
HanSolo opened this issue · 8 comments
It looks like in the latest version only square icons are possible (on macos). In the older version I could also use an rectangular icon but in 4.0.1 it only accepts square icons even if I define the icon like 64x32. Is this on purpose?
@HanSolo - In my experience, MacOS won't even allow icons to be larger than 22 x 22 in the system tray. Though admittedly I haven't tried any rectangular dimensions. Can the system tray even display 64 x 32 without resizing it?
I did display the rectangular version in an older version of FXTrayIcon but not in the newer version anymore. And yes it will scale down the image (I’ve choosen a higher resolution to get a sharper result because it is text).
@HanSolo thank you for catching this!
Looks like my commit 1f0b55e probably broke this for MacOS users. 😞
Unfortunately I don't have a machine running MacOS, so it's hard for me to test each change on each platform. I will see if there's a way to make this drop back to the old behavior without affecting people that wanted the improvements that 1f0b55e provided. Should be a quick fix.
@HanSolo How are you instantiating FXTrayIcon? When I try that icon with 3.1.2, it looks like this
This is the icon that I'm using
Here is the dependency declaration
<dependency>
<groupId>com.dustinredmond.fxtrayicon</groupId>
<artifactId>FXTrayIcon</artifactId>
<version>3.1.2</version>
</dependency>
And this is how I'm instantiating
FXTrayIcon icon = new FXTrayIcon.Builder(stage,iconurl,22,22).addExitMenuItem().show().build();
@HanSolo I even tried making the same icon with proportional dimensions
But I get the same results from 3.1.2 and 4.0.1
Nonetheless, based on What Dustin said about that commit causing the issue, this one here only executes that change if the machine is not running MacOS, so it will not run that code if it's being ran on a mac ... try this and see if it doesn't solve the problem:
If it does, I'll submit the PR
Sorry, was on vacation and on travel. It looks like the patch from @EasyG0ing1 fixes the issue 👍🏻
Closing issue as @EasyG0ing1 pushed a commit to fix this issue. Looks like it's another one of those issues specific to MacOS.