Better icon names/ easier icon themes (fdo#30425)

Michael Meeks michael.meeks at suse.com
Tue Apr 9 10:17:40 PDT 2013


Hi Rodolfo,

On Tue, 2013-04-09 at 10:40 -0300, Rodolfo wrote:
> I'm thinking (again) on work on this request.

	That is an old easy-hack :-)

> Looking at the code, I got that icons for UNO commands are derived by
> prepending "lc_" or "sc_" to the command name (with lower case).

	Correct.

> So, if someone think it's good enough to reuse an icon (like a "Next"
> arrow), it will duplicate images files, am I right?

	Also correct.

> Shouldn't the icon theme decides what image it's used to each thing?
> An xml file could bind them (image name -> uno command name). And
> then, internally keep (yeckt) using hrc/src files to binding them to
> numeric ids.

	Well, we could include a text file with a mapping from uno command ->
image name in the code if you want; it might even not slow us down too
horribly at startup if we're lucky ;-) [ perhaps we might save something
from reducing duplication ].

> Any thoughts? Or should I just rename the images (and their references
> in hrc/src files)?

	In general short filenames have some benefits - they are duplicated
twice un-compressed in each .zip file - in the directory and also in the
zip pre-amble to each file. We saved a chunk of space there by moving a
ton of images into cmd/ instead of res/commandimagelist/ - there are a
lot of icons.

> P.S.: I remember I saw a wiki page about this issue, but I can't find
> it. Does anyone know where is it?

	Not sure; ace_dent had a nice Google Docs spreadsheet of things to fix
back in the day - but we fixed ~all of them IIRC.

	So - I'd like a clearer idea of what we want to achieve in fdo#30425
before going too much further.

	In particular, we can't rename UNO commands without breaking backwards
compatibility - so IMHO the only really useful approach here is to have
a mapping.

	Perhaps starting by adding a concept of textual symlinks (to reduce
duplication) that are theme specific might be helpful. You can see where
images are loaded:

	vcl/source/gdi/impimagetree.cxx

	IIRC there is really only one 'real' method there: doLoadImage - I
guess we could build a symlink cache in there that would (on first icon
lookup) try to load & parse a 'links.txt' file in the .zip (preferably
we'd pack that at the beginning), that had:

cmd/lc_notthere.png cmd/lc_isthere.png
...

	or whatever (?).

	How does that sound ? :-)

	ATB,

		Michael.

-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list