dustinkredmond/FXTrayIcon

Only square icons possible?

Closed 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).

FXTrayIcon_3_1_2

FXTrayIcon_4_0_1

The first image is with FXTrayIcon 3.1.2 and the other with 4.0.1, I guess you can see the difference, just changed the version of FXTrayIcon, no code changes.

@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

Screenshot 2022-12-26 at 8 46 45 AM

This is the icon that I'm using

icon

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

icon

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:

FXTrayIcon-4.0.1-SIMS.jar.zip

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.