Skip to content

Feat(macOS): Scale oversized icons down to menubar height instead of hard 16x16 - #126

Open
forfuncsake wants to merge 4 commits into
fyne-io:masterfrom
forfuncsake:port-to-fyne-io
Open

Feat(macOS): Scale oversized icons down to menubar height instead of hard 16x16#126
forfuncsake wants to merge 4 commits into
fyne-io:masterfrom
forfuncsake:port-to-fyne-io

Conversation

@forfuncsake

@forfuncsake forfuncsake commented Aug 6, 2026

Copy link
Copy Markdown

The default size of 16x16 is fine, but it can be nice to use up a little more space with a 22-height icon. Leave smaller icon files their current size, but resize larger icons to fit the menu bar, scaling the input image proportionally to avoid any kind of squish effect.

This is a port of getlantern#280

Here's a sample of the default(16) and custom(22) icon height from our menubar app:
Screenshot 2026-08-06 at 16 04 15

Implemented via functional options, so as to be
backwards-compatible for existing importers. Allow
the height of the menubar icon on MacOS to be set,
scaling the input image proportionally to avoid
any kind of squish effect.

The default size of 16x16 is fine, but it can be
nice to use up a little more space with a 22-height
icon.

@andydotxyz andydotxyz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the right solution here would be to replace the fixed numbers with a "standard size for bar" looked up in the OS instead.
Consistency in system areas is important.

@forfuncsake

forfuncsake commented Aug 11, 2026

Copy link
Copy Markdown
Author

@andydotxyz thanks for the feedback - it could be entirely dependent on the input image too, and numeric tweaking could make sense. I could add some constants with like a default(16) and large(22) if you think that might work?

Alternatively, any suggestions for how to get the standard size from the OS?

16x16 icons were a bit small, instead of using magic
numbers as in 5c21c49, select the icon size based on
the current thickness (in points) of the bar.
@forfuncsake

Copy link
Copy Markdown
Author

I found out how to get the bar thickness and pushed. My app logo looks good using that size, but this change will affect all importers of this package - which might be considered a "breaking change".

I could also refactor slightly to only override the height if it's taller than the bar, and leave smaller images alone (as a workaround for folks who want a smaller icon not to be scaled up). Thoughts?

@andydotxyz

Copy link
Copy Markdown
Member

I found out how to get the bar thickness and pushed. My app logo looks good using that size, but this change will affect all importers of this package - which might be considered a "breaking change".

I could also refactor slightly to only override the height if it's taller than the bar, and leave smaller images alone (as a workaround for folks who want a smaller icon not to be scaled up). Thoughts?

That sounds really smart, thanks.

@forfuncsake forfuncsake changed the title Feat: Allow MacOS menubar icon height to be overridden Feat(macOS): Scale oversized icons down to menubar height Aug 11, 2026
If someone has a smaller icon deliberately, persist its
size. If the provided icon file is taller than the menu
bar, scale it down to fit.

While this may change the size of somee existing app
icons, the constraints should be suitable for all
callers.
@forfuncsake

Copy link
Copy Markdown
Author

done

@forfuncsake forfuncsake changed the title Feat(macOS): Scale oversized icons down to menubar height Feat(macOS): Scale oversized icons down to menubar height instead of hard 16x16 Aug 12, 2026
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

Successfully merging this pull request may close these issues.

2 participants