windingwind / zotero-plugin-template

A plugin template for Zotero.
GNU Affero General Public License v3.0
455 stars 116 forks source link

Can I register a new function to the toolbar? #173

Closed brick-pid closed 1 month ago

brick-pid commented 1 month ago

I am trying to develop a new plugin designed to randomly open a file when clicked. Currently, this plugin can be activated through a menu item, but this requires first clicking on the menu and then on the corresponding feature, which is rather cumbersome. I referred to the UI Examples, but it seems they do not mention any relevant information.

The target behavior is as shown in the following diagram, when this button is clicked, the related function will be activated.

CleanShot 2024-08-31 at 15 46 51

northword commented 1 month ago

https://github.com/syt2/zotero-addons/blob/a9647a586cf104c353b99ab82727b52c16d576ac/src/modules/addonTable.ts#L71

windingwind commented 1 month ago

Generally I don’t recommend adding new buttons to the library toolbar, as most of the plugins’ icons are not well designed and can be distracting, unless the entry is very frequently used and highly related to the items in library.

brick-pid commented 1 month ago

Generally I don’t recommend adding new buttons to the library toolbar, as most of the plugins’ icons are not well designed and can be distracting, unless the entry is very frequently used and highly related to the items in library.

Thanks for your answer. I think your answer makes sense. I've now bound it to a shortcut key, which I think might be better.