[Gambas-user] Stock

Fabien Bodard gambas.fr at gmail.com
Sun Jan 3 14:46:29 CET 2021

Le dim. 3 janv. 2021 à 02:30, Tony Morehen <tmorehen at ajm-software.com> a écrit :
> Why not use Picture["theme/..."] to access freedesktop icons? Instead of
> "theme", you could use "themeicon", "freedesktop", "freedesktopicon",
> "desktop", "desktopicon" or whatever.
> This could be done either as a re-write to the current picture class as
> it won't impact current uses or as a sub-class of Picture in the
> gb.desktop component.
> BTW, you don't need the "devices" sub-path.  Freedesktop icon names are
> unique.  Benoit is right about theme icon names not being standardized.
> Some are organized theme/class/size and some theme/size/class

Well you surely don't know that but the Stock code is really powerful
and resolves these problems since many years now :-)

In the past I've begun to work on that when I've started to implement
DesktopMime to get mime infos and by the way Mimetype Icon of the
current theme.

So the class gets the current desktop theme, resolves the inheritance
of the theme (and adapts to different structures) , try to find the
icon in a degressive order, or svg.

So the problem is only on Icons names. But hard work have been done on
these to have Symbolic links with standart names for devices and
mimetype... truely its not perfect :-)

That's why Benoit made the map file. So for example for my device
viewer, I will need to add entries for devices icons in this file and
in the gb.form.stock.

I'm not a good programmer so fortunately Benoit keep an eye on my work
and make correction and improvement on my work ... often ... too often



More information about the User mailing list