[SailfishDevel] Resolution-independent in-app icons

Кожевников Андрей Андреевич coderusinbox at gmail.com
Thu Jul 21 04:47:05 UTC 2016


Prefer using svg images. Carrying multiple sizes png images is so 2000.


21.07.2016 02:27, Osmo Salomaa пишет:
> Hello,
>
> SFOS has standard sizes for application launcher icons and Silica has 
> stock icons, whose sizes (I assume) vary by device, but how should I 
> handle custom in-app icons, e.g. a position icon in a map application, 
> so that it would look right on different pixel-density screens?
>
> I tried using a large PNG or SVG and having QML scale that to one of 
> the Theme.iconSize* constants, but the result of such downscaling is 
> not smooth, even when using Image's smooth=true. Additionally the QML 
> documentation says there's a possibly significant performace cost to 
> smooth scaling. This implies that I'd need different size PNGs on 
> different devices and show those 1:1 without scaling.
>
> So, is there some SFOS image resizing script I can run on RPM's 
> post-install to generate the right size icons from SVGs or large PNGs? 
> Or should I just roll my own solution that packs in icons of different 
> sizes and loads the closest match at runtime?
>



More information about the Devel mailing list