← Back to team overview

kicad-developers team mailing list archive

Re: [PATCH] RFC: toolbar button support for action plugins

 

Hi Konstantin,

Thanks for feedback.

I like the idea that plugin writers can opt out of showing the button on
toolbar, I will add this.

Ultimately user should have control over it. If all plugin writers start
adding icons top
toolbar will run out of space. User should be able to choose which plugins
to keep on the
toolbar and which ones should be just in the menus. But that is a separate
problem to solve.

> Also, probles with icon don't must take affect on visibility of toolbar
button. Just use default icon.

I'm not sure about this one. It sounds good for one plugin but if there are
few with icons that failed
to load they will be indistinguishable without hovering with mouse until
tooltip pops up which is far
from ideal.
I would argue that it's best to keep those in menu where you can read the
plugin name right away.

Andrew

On Thu, Aug 16, 2018 at 5:26 AM Константин Барановский <
baranovskiykonstantin@xxxxxxxxx> wrote:

> чт, 16 авг. 2018 г. в 12:26, Andrew Lutsenko <anlutsenko@xxxxxxxxx>:
>
>> If icon file doesn't exist or can't be loaded (wrong format for example)
>> pcbnew will throw an error message
>> and will continue with no button for that plugin and generic hammer icon
>> in menu.
>>
>
> Hi Andrew!
>  I think will be better to add the separate option that will controls
> visibility of plugin on toolbar. For example:
>
> import os
> import pcbnew
> import wx
>
> class Plugin1(pcbnew.ActionPlugin):
>
>     def defaults(self):
>         self.name = "Dummy Plugin 1"
>         self.category = "Read PCB"
>         self.description = ""
>         *self.show_on_toolbar = true*
>         self.icon_file_name = os.path.join(os.path.dirname(__file__),
> 'icon.png')
>
>     def Run(self):
>         wx.MessageBox("Plugin 1")
>
> Plugin1().register()
>
> Also, probles with icon don't must take affect on visibility of toolbar
> button. Just use default icon.
>
> Anyway, good work. Thanks.
>

References