Feat(macOS): Scale oversized icons down to menubar height instead of hard 16x16 - #126
Feat(macOS): Scale oversized icons down to menubar height instead of hard 16x16#126forfuncsake wants to merge 4 commits into
Conversation
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
left a comment
There was a problem hiding this comment.
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.
|
@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? |
|
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. |
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.
|
done |
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:
