-
Notifications
You must be signed in to change notification settings - Fork 89
Tray - Force scaling icon #812
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
base: master
Are you sure you want to change the base?
Conversation
|
and also, should we find a proper size in pixmap function instead of just use the first one? ironbar/src/modules/tray/icon.rs Line 90 in 8a06ec0
or since we have re-scale as post-process, we can just choose the largest one. |
|
Thanks for this, haven't given a full review yet but looks good. I think it would make sense to pick the next biggest size and scale that down. That'd be cheaper than always scaling the largest. |
i've added the functionality for this if i understand correctly. One thing bothering me is that, whether the |
The spec is so incredibly vague and has so many incorrect implementations that I'd keep away from trying to do anything like that. The good news is in reality there will only be a few entries on rare occasions so the search will be fast enough always. |
JakeStanger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm really sorry, going through old PRs and I didn't realise I left this review in draft. Let me know if you're still up for picking up the changes, if not I'll get it finished up and merged
| .as_ref() | ||
| .and_then(|pixmap| pixmap.first()) | ||
| // The vec is sorted(ASC) with size(width==height) most of the time, | ||
| // but we can not be sure that it'll always sorted by `height` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a slight catch here that ideally needs to be incorporated. I'm hoping it shouldn't be too hard as it's just a switch on the value to check, but for vertical bars the bar "height" property actually refers to its width. We'd need to perform all operations here off the width instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to use width in find_approx_size 455545e
fix #809
this make sure that all the icon's height are the same.
but some might considered "ok" size before may seem a bit off than usual:
BEFORE:

AFTER:

But we can change the icon size ourself (used to be 16, now 24):

So this is just one way of fixing the problem
i can close this if it's not a proper solution.