Customizing toolbar buttons and non default icons
-
I’m currently running the Standard Icons small for my toolbar icon set. I’ve further customized the toolbar with some extra buttons for scripts I regularly use with the Customize Toolbar plugin. For the custom toolbars I’ve made my own buttons, so I don’t have to guess at the questionmarks that CT plugin shows per default. So far so good, my icons live in .\NPP\plugins\Config as .bmp, they show up in the program.
Now, I’ve replaced some of the build in icons with some of a set… They live in .\NPP\toolbaricons\default\ as .ico. But as soon as there is any icon in the folder my own custom icons revert back to the default questionmark icons.
I’ve tried to put my own icons in .\NPP\toolbaricons\default\ but that doesn’t work.
So the question now is, how do I get new icons to work with the customize toolbar plugin and my own icons?
-
Using the following as the icons in my
...\plugins\Config
directory (for the CustomizeToolbar plugin):
And this as my
new.ico
for use in my...\toolbarIcons\myAwesomeIcons
folder:
CustomizeToolbar.btn:
View,Show Symbol,Show All Characters,,allChars.bmp,allChars_off.ico,allChars_off_dark.ico Plugins,Converter,Conversion Panel,,convert.bmp,convert.ico Plugins,MIME Tools,Base64 Encode,,b64.bmp,b64.ico
When I don’t have toolbarIcons enabled, I see:
… Based on the images, Notepad++ is using thestandard icons: small
for the toolbar, and CustomizeToolbar thus picks the BMP versions (down arrow for convert.bmp and64
for b64.bmp)When I enable toolbarIcons, I see
… The single red strawberry is convert.ico, and the four red dots are b64.ico… And you’ll also notice that Notepad++ switches to theFluent UI: small
icons (even though my settings still saystandard icons: small
– because with toolbarIcons enabled, Notepad++ always uses one of the Fluent sets as the starting point)Because enabling toolbarIcons switches Notepad++ to the Fluent mode, it switches CustomizeToolbar to the ICO mode. So you must define at least the light-mode icon field.
If I remove the
,convert.ico
from the CustomizeToolbar.btn and restart,View,Show Symbol,Show All Characters,,allChars.bmp,allChars_off.ico,allChars_off_dark.ico Plugins,Converter,Conversion Panel,,convert.bmp Plugins,MIME Tools,Base64 Encode,,b64.bmp,b64.ico
… I can replicate your problem, and the Conversion Panel button shows up as the
?
error:
To fix your problem, you need to create and reference an appropriate .ico file for all your custom buttons
If you ever don’t want to create the button, you can use the Customize Toolbar “Quick Codes” (which are described in Plugins > Customize Toolbar > Help - Custom Buttons or the comments in the default CustomizeToolbar.btn file. For example, here is a version with using a red
CP
for Conversion Panel, and a grayish64
for the Base64 Encode:View,Show Symbol,Show All Characters,,allChars.bmp,allChars_off.ico,allChars_off_dark.ico Plugins,Converter,Conversion Panel,,convert.bmp,*R:CP Plugins,MIME Tools,Base64 Encode,,b64.bmp,*#123456:64
So, you either need to set a .ico or a Quick Code in the field after the bmp, and it should work for you.
-
@PeterJones Thank you. That worked like a charm.
I had made my own .icos, but they would not show. I figured out why now, the CustomizeToolbar referenced .icos need to be in
.\N++\plugins\ConfigI’ve always put them in the same folder as the Fluent icons. Never occurred to me to put them anywhere else.
A final question, what format settings do the fluent icons have? Mine are lacking transparency at the moment.
-
@Michkovy said in Customizing toolbar buttons and non default icons:
A final question, what format settings do the fluent icons have? Mine are lacking transparency at the moment.
Sounds like yours have 24bpp. You need 32bpp to have transparency.
The Plugins > Customize Toolbar > Help - Custom Buttons actually tells that you need the 32bpp, though it doesn’t explain why. And it also just mentions the 32x32 size – but that means that it has to be downscaled to 16x16 when running with small toolbar icons, so I recommend having both.
(Note on icon editors: VS2022’s icon editor will show the 32bpp image types in the ico file, but won’t let you create a new one with transparency. I generally use GIMP for icon editing, which has no such limitation; a dedicated icon editor like IcoFX will generally work, too. [I believe you have to find a copy of 1.4.6 or older to have a freeware version; the newer versions are commercial products and will stop being able to save after a 30day trial.])
Actually, I didn’t answer your question as asked, I answered what I thought you really meant. But to answer the actual question, the fluent icons in the source code actually use 8bpp with one color index being dedicated to 100% transparent pixel. So if your icon editor will allow that, and 255 colors are sufficient for your icon (probably should be), then you could try that, instead (I believe VS can do transparent in 8bpp mode). If you want to use the same palette as Notepad++'s fluent icons, you could even grab one of the fluent icons from the source code and use that as the basis for your icon(s) – just replacing the image for each of the sizes.
update: the user manual now explains that you need 24bpp or 8bpp to get the transparency.