Page 1 of 1

[Solved] Change Toolbar button icon displays weird image

Posted: Mon May 20, 2019 5:35 pm
by BenDev
Hello,

I'm trying to simply change the icon of a button on a toolbar.
Even if I choose a pre-existing LibreOffice Icon, when applying the change, the icon is not displayed as it should be...
The issue occurs whatever image I choose.

I've put an image in attachement so you can understand what the problem is.

Note that I'm on LibreOffice 6.1.5.2

Any clue on this ?
Thanks in advance for any help or advice ;)

Re: Change Toolbar button icon displays weird image

Posted: Mon May 20, 2019 8:56 pm
by Zizi64
Which icon set are you using?

Can you upload the test.odt file here (with the embedded macro and with the embedded Custom toolbar)?

Re: Change Toolbar button icon displays weird image

Posted: Mon May 20, 2019 9:11 pm
by BenDev
To Zizi64:

Well, I'm using the default icon library that is automatically loaded on the interface...So I don't really know if the set has a specific name...

I've attached the file.
But notice that this example has no real content,I've only created the architecture needed to be able to create a button linked on a macro.

Re: Change Toolbar button icon displays weird image

Posted: Mon May 20, 2019 11:53 pm
by Bill
Select Tools > Options > LibreOffice > View. The icon set is the Icon style listed under User Interface.

Re: Change Toolbar button icon displays weird image

Posted: Tue May 21, 2019 6:51 am
by Zizi64
I I know it exactly, the default icon set ids the Colibre in the LO 6.1.5.
(I am using the Galaxy icon set. The newer LO versions not contain the Galaxy icon set by default, it must install as an extension.)

I just tried to set the icon set to Colibre, but I can not find the right arrow-like triangle in the set Colibre.

Maybe you have set this icon in an older version of the LibreOffice for your document, therefore the document may contains the icon, but the default icon set of the new LibreOffice has not.

(The Galaxy icon set, and the Tango icon set have such icon. That labelled as ".uno:RunBasic" icon. And the Tango was the default icon set in the previous versions.)

Re: Change Toolbar button icon displays weird image

Posted: Tue May 21, 2019 3:17 pm
by BenDev
Hello,

Thanks for your answers.
So:
Effectively, the Icon set is called "Colibre". It's the default icon set with the LibreOffice Installer as @Zizi64 said I suppose, as I've not changed those parameters by myself.

Note that the problem I'm facing is not specific to the right arrow icon, but it occurs whith any icon I try to set.

The test file has no history, It's a new file created with the LibreOffice version 6.1.5.2. So not set with an older version...

Re: Change Toolbar button icon displays weird image

Posted: Tue May 21, 2019 3:40 pm
by BenDev
I've finally found the origin of the display problem.
In the Menu Options / LibreOffice / View panel, the option "Use openGL for every rendered was checked...
If I uncheck this option, the icon is well displayed (see attached Image).

But this option seems to be checked by default, so I guess that the issue can occur on any computer the file will be used...

Re: Change Toolbar button icon displays weird image

Posted: Tue May 21, 2019 6:06 pm
by BenDev
As display of specific set icon is working now, I've tried to import a custom icon (not in pre-installed icon set then).
It works well but I notice that the icon is not embedded in the document and "only" linked to the original source paht...So it will not be displayed if the file doesn't exists at the original source path...

Is there any way to embed a custom icon on a toolbar button into the document ?

Re: Change Toolbar button icon displays weird image

Posted: Tue May 21, 2019 6:09 pm
by RoryOF
You could, perhaps, insert the icon file into the OO archive that is your default template, and link to it there. That will need quite a lot of research on your part to discover the ways and means. I think it might be simpler to get used to the existing icon structure and forget about this.

Re: Change Toolbar button icon displays weird image

Posted: Tue May 21, 2019 6:23 pm
by BenDev
Hi @RoryOF,
No problems with ways and means, I really like to search and find solutions while learning ;)
I'm now working on a development project on LibreOffice.
But it needs to get things embeded because the final file will be deployed on many computers as a standalone file working by itself.

Your idea would certainly mean to deploy an installer at least to install the icon for it to exist on the target computer.

Re: Change Toolbar button icon displays weird image

Posted: Tue May 21, 2019 6:49 pm
by RoryOF
If the icon is embedded in the OO template used, that will ensure its presence on any other computer using a file based on that template.

Search for "OpenOffice macro metadata" for some clues on how you might embed extra information in an OO file. The same methods can be used to modify the default template.

Re: Change Toolbar button icon displays weird image

Posted: Tue May 21, 2019 7:21 pm
by BenDev
Thanks @RoryOF !

Like a docx file, an odt file is a collection of xml files packed as a .zip format.
So I've found the folder where the static button icon is stored and replaced it by my custom icon.

Seems to work.