How to edit the Theme to add a customized "Large" (24×24 px) icon to a command?

Dear Community,

I’m using Libreoffice Draw: in Tango Theme, I’d like to assign an icon to the command Format>Text…, which seems not to have a proper one. This would be quite simple through the Tools>Customize…>Toolbar functions, with Modifiy>Change icon… for the selected command, but only 16×16 px icons are allowed, and if you opt for "Large" as Toolbar icon size, no icon at all is viewed for this button.

I understood that when default icons tolerate both Large and Small as dimensions, is because they exist both in 16×16 and 24×24 versions, named sc_xxx.png (small, 16×16 px) and lc_xxx.png (large, 24×24 px). These icons are generally stored within the cmd folder of the archive.

So, I’m trying to directly modify the Tango Theme, adding my 16×16 and 24×24 icons and assinging them to the "Format>Text…" comand. After adding my icons, I think I should edit link.txt in the main Theme folder, and some other theme file to assing the icons to the command.

How to do?

I think, that direct adding is not possible, but you would need to compile LibreOffice. What you can do is, to give an icon to the command via Customize>Modify>Change icon. The icon added for the toolbar will be used in the menu as well. If you try that and fail, please reword your question.

I had already tried with Modify>Change icon… but, as I stated, this works only if the dimension chosen for icons in general (LibreOffice general Options window) is “Small”. This is because the cutom icon imported is automatically resized to 16×16 px.

If I choose “Large” or “Automatic” for the dimension, the icons shown in the toolbar are 24×24 px, and so my one, unsuitable, disappears, replaced by the decription of the command (its label).

I refined the title of my question.

You cannot add custom icons, if your setting in Tools > Options > LibreOffice View is automatic. So do this:

  1. Prepare an icon image in size 16x16 and one in size 24x24. Use png image in 24-bit, that is without alpha-channel. I’m not sure whether 32-bit will work too.
  2. Use Tools > Customize and add the command “Text Attributes” to a toolbar. You can get it from the alphabetical list “All categories”.
  3. Set all entries to small in section User Interface in Tools > Options > LibreOffice View.
  4. Use Tools > Customize, go to the newly inserted command “Text Attributes” and click on Modify and then on item Change icon. It opens the “Change Icon” dialog.
  5. Click on button Import and import the 16x16 image.
  6. Click on the just imported image and then on OK. Close customize dialog.
  7. Set all entries to large in section User Interface in Tools > Options > LibreOffice View.
  8. Repeat step 4.
  9. Repeat step 5, but now import the 24x24 image.
  10. Repeat step 6.
  11. Set all entries to automatic in section User Interface in Tools > Options > LibreOffice View.
  12. I’m not sure, but you might need to restart LibreOffice.

If you have set your menus to always show icons, you should have an icon in front of “Text…” now. You can disable the command in the toolbar, in case you do not want it there.

Excellent. Thank you, Regina.

In fact, this is the right way to operate: to separately import the two icons in both Small (16x16 px) and “Large” (24x24 px) configurations for the icons dimension. It seems that these imported icons are saved somewhere within the LO system files, so there’s no need to keep them stored in their original location, then.

→ 32x32 px is related to Extra Large, the third option available.

→ I used 32bit .png picture (alpha channel): all works great.