ironbar icon indicating copy to clipboard operation
ironbar copied to clipboard

Force scaling icon

Open ogios opened this issue 11 months ago • 4 comments

fix https://github.com/JakeStanger/ironbar/issues/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: image

AFTER: image

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

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

ogios avatar Dec 13 '24 13:12 ogios

and also, should we find a proper size in pixmap function instead of just use the first one? https://github.com/JakeStanger/ironbar/blob/8a06ec04b098d662188426d7eaf0e9d108725cc5/src/modules/tray/icon.rs#L90

or since we have re-scale as post-process, we can just choose the largest one.

ogios avatar Dec 13 '24 13:12 ogios

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.

JakeStanger avatar Dec 13 '24 16:12 JakeStanger

I think it would make sense to pick the next biggest size and scale that down.

i've added the functionality for this if i understand correctly.

One thing bothering me is that, whether the Vec<IconPixmap> is sorted with height, if so then we can use a better way to speed up the search.

ogios avatar Dec 15 '24 12:12 ogios

One thing bothering me is that, whether the Vec<IconPixmap> is sorted with height, if so then we can use a better way to speed up the search.

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 avatar Dec 15 '24 16:12 JakeStanger