windingwind / zotero-plugin-toolkit

Toolkit for Zotero Plugin Developers.
https://www.npmjs.com/package/zotero-plugin-toolkit
MIT License
115 stars 13 forks source link

Prompt css style and customization? #20

Closed lifan0127 closed 1 year ago

lifan0127 commented 1 year ago

This is really nice library. I noticed a display issue related to the prompt window under Ubuntu dark mode:

image

I believe it is related to the border-radius setting for the input: https://github.com/windingwind/zotero-plugin-toolkit/blob/e896eaa1a9f6d1ba80be7bbf3cae6b5ef2548651/src/managers/prompt.ts#L638

More broadly, how can I customize this prompt UI element, such as its style and keyboard shortcut?

Thanks!

windingwind commented 1 year ago

Hi, thanks for the feedback. I will look into this bug later.

The Prompt is shared by all plugins, thus changing its style will also affect other plugins. Adding CSS to the main window can change the looking of the Prompt.

lifan0127 commented 1 year ago

"The Prompt is shared by all plugins" - so if multiple plug-ins use the prompt feature, what happens when user press shift+p?

windingwind commented 1 year ago

The register and unregister of all Manager modules work under a global scope. One and only one prompt will be initialized on the first call of register from any plugin, and since then any register from any plugin will add a new command to the prompt.

Multiple plugins share the same Prompt and their commands can all be called or searched. This is actually happening in Zotero already.

lifan0127 commented 1 year ago

Thanks for your reply! I understand how the prompt works now.