IconTextSwitch icon color wrong for non-theme provided images

asked 2019-10-05 18:37:00 +0200

grumpycat3051 gravatar image

updated 2019-10-05 20:08:50 +0200

If I do this, the icon will show according to the theme foreground text color.

IconTextSwitch {
     text: "Location"
     icon.source: "image://theme/icon-m-gps"
     description: "Allow applications to use GPS for mobile networks to pin point your location"
 }

If I copy the icon file into the app's directory and use the file as icon source, it will render as white. Note, the use of icon-m-gps is just to illustrate that even Jolla's own images don't work.

IconTextSwitch {
     text: "Location"
     icon.source: "file://path/to/my/app/icon-m-gps.png"
     description: "Allow applications to use GPS for mobile networks to pin point your location"
 }
edit retag flag offensive close delete

Comments

@grumpycat3051

Your second example is because you have moved the image out of the sailfish theme directory. In my limited opinion, this is not a bug.

Why would you want to basically duplicate the image by having a copy in your app's directory?, makes no sense to me when you can already call it using the icon.source URL already given in your first example.

Spam Hunter ( 2019-10-05 18:52:30 +0200 )edit

My wild guess is that pictures in general are shown as they are, but white in pictures in image:// is replaced by theme colors.

hsjpekka ( 2019-10-05 19:45:06 +0200 )edit

The use of icon-m-gps serves to illustrate the point. Any image with transparent background should do. My point is the coloring doesn't occur even with the Jolla supplied images.

Compare Silica's Icon vs. Image: Icon colorizes the image according to theme colors, Image doesn't. IconTextSwitch should do the same.

grumpycat3051 ( 2019-10-05 20:07:34 +0200 )edit

to my knowlegde it is theme imageprovider is doing coloring magic, not the other magic components

coderus ( 2019-10-05 23:56:49 +0200 )edit