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

Only square icons possible? #69

Closed
HanSolo opened this issue Dec 6, 2022 · 8 comments
Closed

Only square icons possible? #69

HanSolo opened this issue Dec 6, 2022 · 8 comments

Comments

@HanSolo
Copy link
Contributor

HanSolo commented Dec 6, 2022

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?

@EasyG0ing1
Copy link
Contributor

EasyG0ing1 commented Dec 6, 2022

@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?

@HanSolo
Copy link
Contributor Author

HanSolo commented Dec 7, 2022

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
Copy link
Contributor Author

HanSolo commented Dec 7, 2022

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.

@dustinkredmond
Copy link
Owner

@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.

@EasyG0ing1
Copy link
Contributor

@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();

@EasyG0ing1
Copy link
Contributor

EasyG0ing1 commented Dec 26, 2022

@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

@HanSolo
Copy link
Contributor Author

HanSolo commented Jan 20, 2023

Sorry, was on vacation and on travel. It looks like the patch from @EasyG0ing1 fixes the issue 👍🏻

@dustinkredmond
Copy link
Owner

Closing issue as @EasyG0ing1 pushed a commit to fix this issue. Looks like it's another one of those issues specific to MacOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants