Community
    • Login

    Customizing toolbar buttons and non default icons

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 189 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      Michkovy
      last edited by

      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?

      PeterJonesP 1 Reply Last reply Reply Quote 0
      • PeterJonesP
        PeterJones @Michkovy
        last edited by

        @Michkovy ,

        Using the following as the icons in my ...\plugins\Config directory (for the CustomizeToolbar plugin):
        eb6bd13b-b0bb-4f0b-9e05-358595a4d9d7-image.png

        And this as my new.ico for use in my ...\toolbarIcons\myAwesomeIcons folder:
        6c772062-9baa-4ac5-8c0c-b87f3fab4339-image.png

        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:
        9a756de6-96fd-4084-ae6a-7994bf5c7bbe-image.png
        … Based on the images, Notepad++ is using the standard icons: small for the toolbar, and CustomizeToolbar thus picks the BMP versions (down arrow for convert.bmp and 64 for b64.bmp)

        When I enable toolbarIcons, I see
        4fd4278e-85b7-4a91-b38e-c86c96f57f04-image.png
        … The single red strawberry is convert.ico, and the four red dots are b64.ico… And you’ll also notice that Notepad++ switches to the Fluent UI: small icons (even though my settings still say standard 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:
        8411a882-4968-43da-98b2-c4fe17e7eb1f-image.png

        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 grayish 64 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
        

        cb53531d-a2c1-45c6-85e6-a43b4fde49d9-image.png

        So, you either need to set a .ico or a Quick Code in the field after the bmp, and it should work for you.

        M 1 Reply Last reply Reply Quote 1
        • M
          Michkovy @PeterJones
          last edited by

          @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\Config

          I’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.

          PeterJonesP 1 Reply Last reply Reply Quote 0
          • PeterJonesP
            PeterJones @Michkovy
            last edited by PeterJones

            @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.

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors