Quote:
Originally Posted by kiwidude
Quote:
Originally Posted by meme
By the way, in preferences->customize the toolbar how do I put my custom icon next to the text name of the icon like the built-in entries?
|
Your other question about the icons for the Preferences->Customize the toolbar is something that has been bugging me for a while. I did look at the code once and found the reason why it would not display them - there is nothing we as plugin developers can do, it needs Calibre code changes.
|
I just took another look at this to remind myself what the issue is. The way the code is written currently (in gui2\preferences\toolbar.py line 50), it uses the action_spec of the InterfaceAction to get a name of the icon.
Unfortunately in our plugins we have to set the icon name in that action spec to None, because our icons are coming from the plugin zip file. Your plugin used to have an icon appear for it because you used to set that action_spec value to the name of an icon that was in Calibre.
One workaround for this that comes to mind is if the Calibre code was to support grabbing the icon from the .qaction of the InterfaceAction. I added these lines of code at line 58:
Code:
if hasattr(self._data[row], 'qaction'):
icon = self._data[row].qaction.icon()
if not icon.isNull():
return QVariant(icon)
And as per the screenshot icons magically appear