Page 1 of 1
Custom Toolbar Icons
Posted: 24 Jun 2023 19:56
by avivariba
Whenever I would like an existing toolbar button to have a custom icon, I manually recreate and script that button on a User Button. This is quite tedious, especially if a button has a lot of functions and features (and it also is not future-proof would something change or be added to the original button in an update).
I would love for there to be a way to change the icon of a toolbar button to any custom or other internal icon, much like as is the case for User Buttons.
Or a way to easily trigger (or copy over/duplicate) an existing button's functionality into a User Button script.
Or, alternatively, having access to the original icons (or icon sprite), so that those could be edited manually.
Re: Custom Toolbar Icons
Posted: 24 Jun 2023 20:04
by jupe
This is all already possible, lookup patchimage in the scripting help.
Re: Custom Toolbar Icons
Posted: 24 Jun 2023 20:07
by avivariba
jupe wrote: ↑24 Jun 2023 20:04
This is all already possible, lookup patchimage in the scripting help.
And here am I thinking I went through the entire Help and didn't find any such thing.
Thanks!!

Seems that it won't work with other internal icons, but that isn't as much of an issue with this being a possibility.
Just in case, does there happen to be any way to extract/save internal icons (so that those could be used either for this or elsewhere)?
Feel free to change this topic to 'Tips & Tricks, Questions & Answers'. Seems that I can't do that myself.
Re: Custom Toolbar Icons
Posted: 24 Jun 2023 20:53
by eil
avivariba wrote: ↑24 Jun 2023 20:07
Just in case, does there happen to be any way to extract/save internal icons (so that those could be used either for this or elsewhere)
Why extract when you can assign internal icons to any custom created button. Add any user button(say empty one), right click on it and select Customize Toolbar, you'll see names in [brackets] = that's the name of icon of that button. Now state one that you want in icon field of your custom created button, adding : sign at start, like= :go or :ghost.
Re: Custom Toolbar Icons
Posted: 24 Jun 2023 20:57
by avivariba
eil wrote: ↑24 Jun 2023 20:53
Why extract when you can assign internal icons to any custom created button.
That doesn't work with PatchImagesPath/patchimage.
Re: Custom Toolbar Icons
Posted: 24 Jun 2023 21:00
by jupe
For internal icons you can manually extract them from the exe, and make them individual external images, here is an old image map already on the forum if it helps, you'd need to cut it up. Not sure if Don would want you using them "elsewhere" though.

Re: Custom Toolbar Icons
Posted: 24 Jun 2023 21:08
by avivariba
jupe wrote: ↑24 Jun 2023 21:00
For internal icons you can manually extract them from the exe, and make them individual external images, here is an old image map already on the forum if it helps, you'd need to cut it up. Not sure if Don would want you using them "elsewhere" though.
Fair!
One big problem I'm running into now is that PatchImagesPath/patchimage doesn't seem to work with different states, for example for the Folder View Settings (fvs). It shows only when active but not enabled.
How does one include different states (inactve, enabled)? I see it are 3 different icons in the image map, but I can't find the icon codes for those versions.
Re: Custom Toolbar Icons
Posted: 24 Jun 2023 21:12
by jupe
Yeah the different states can be tricky to find, you need to forum research, anyway for your example the 3 states of fvs are fvs, fvsd, fvsp.
>>>>>> Moved topic to T&T, Q&A
Re: Custom Toolbar Icons
Posted: 24 Jun 2023 21:29
by avivariba
jupe wrote: ↑24 Jun 2023 21:12
Yeah the different states can be tricky to find, you need to forum research, anyway for your example the 3 states of fvs are fvs, fvsd, fvsp.
Perfect! Couldn't find it from the forum search but found it via Google (just for if someone else needs it too):
XYplorer Icon Resources