[SailfishDevel] using icon image provider with custom icons

David Llewellyn-Jones david at flypig.co.uk
Mon May 25 11:47:58 UTC 2020


On 25/05/2020 14:31, Julien Blanc wrote:
[snip]
> I’d like to benefit from icon coloring and correct size selection.
> However, it seems the "theme" icon provider only looks in the system
> folders, not the app folder (at least that's what strace shows).
> 
> From a quick look, it seems every app is somehow reinventing the wheel
> here, using its own custom image provider or other techniques to
> provide the path.
> 
> Isn't there something smarter to do ? I can't find where the theme
> image provider gets registered, but i suppose it would be a far better
> solution to just extend it somehow, and provide a search path for the
> app folder (the logic being the same).

Creating an ImageProvider as you've described, is the approach I've
always used. This has always been my go-to reference for this:

https://sailfishdev.tumblr.com/post/87464226712/iconbutton-how-to-use-own-icons-with-highlight

Even though I agree it'd be good to have a simpler, more generic
approach, as far as I'm aware there isn't one. I'd be happy to be proven
wrong though.

David
-- 
Website: https://www.flypig.co.uk


More information about the Devel mailing list