![]() |
#211 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 161
Karma: 1842
Join Date: Jan 2016
Device: Kobo Glo HD
|
Quote:
![]() It works for me with your plugin Check books but it's not working with @JimmXinu plugin for example. If someone has the time to check does light and dark theming work with calibre example plugin? https://calibre-ebook.com/downloads/...emo_plugin.zip Sorry I don't get why I can't get it to work... And to make things more complicated, I saw that in FanFicFare code, the comments say : Code:
# For theme creators, use: # FanFicFare/images/icon.png # (optionally) # FanFicFare/images/icon-for-dark-theme.png # FanFicFare/images/icon-for-light-theme.png |
|
![]() |
![]() |
![]() |
#212 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Sorry. My mistake. This does not work here! I forgot I had another call to my custom get_icon() function when rebuilding menus. |
|
![]() |
![]() |
![]() |
#213 | |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,993
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
The last time I remember discussing this, Kovid said:
Quote:
As mentioned, thiago.eec put extra code in Check Books to allow for light/dark themed icons in the resources dir that my plugins don't have. And honestly, IMO, that's not code that should be in every plugin. |
|
![]() |
![]() |
![]() |
#214 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,218
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Besides, it's harmless for those who does not need it. |
|
![]() |
![]() |
![]() |
#215 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,993
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
I'm not saying you shouldn't, I'm just saying I'm not. :-)
|
![]() |
![]() |
![]() |
#216 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,393
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
As far as I recall, get_icon() uses QIcon.ic() which is what the rest of calibre uses ad that supports light/dark variants automatically. If it isnt working then it will require investigation.
|
![]() |
![]() |
![]() |
#217 | |||
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,993
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
That's what Nicolas F was reporting.
Quote:
From what I see, '-for-X-theme' is implemented in calibre/utils/rcc/__init__.py, not in QIcon. Our discussion from last year: Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
#218 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,393
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes but compile_icon_dir_as_themes() is how themes are installed into calibre so it should work for any theme. And QIcon.ic() uses the output of compile_icon_dir_as_themes().
|
![]() |
![]() |
![]() |
#219 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,993
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Is there a step where Calibre automatically uses the old resources dir on disk to create a theme for custom icons?
Unless I misunderstand, that's the only way that code could apply to custom icons in the resources dir... |
![]() |
![]() |
![]() |
#220 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,393
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
I thought this was about icons from themes not customised icons. IIRC, when loading from resources dir these are looked for via the overriden_icon_path() function
|
![]() |
![]() |
![]() |
#221 |
Plugin Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,993
Karma: 4604635
Join Date: Dec 2011
Location: Midwest USA
Device: Kobo Clara Colour running KOReader
|
Okay, I've taken a look at overriden_icon_path() in calibre/gui2/__init__.py. I think it's broken for plugins.
overriden_icon_path() is looking for -for-light/dark-theme files in override_items, which is built from looking for files in 'devices', 'mimetypes', 'plugins' dirs under resources/images. Probably works fine for devices and mimetypes, but not for plugin custom icons. Currently, plugin custom icons are under resources/images/<pluginname> for each plugin, not under resources/images/plugins. And just putting the pluginname dir under 'plugins' doesn't work because the code doesn't recurse. Adding 'FanFicFare' to the 'devices', 'mimetypes', 'plugins' list works, but I don't know if adding all plugin names to that list is an appropriate solution. |
![]() |
![]() |
![]() |
#222 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,393
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#223 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
My steps:
|
|
![]() |
![]() |
![]() |
#224 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,393
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
It should be just
resources\images\Interface Plugin Demo\ no extra images sub-folder. |
![]() |
![]() |
![]() |
#225 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,393
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
that commit assumes images are in the plugin root which. I suppose adding support for an extra images sub-folder shouldnt be too bad.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Suggestion for PI Devs | BetterRed | Plugins | 11 | 09-27-2020 06:18 PM |
Attn plugin devs: porting to python 3 | kovidgoyal | Plugins | 129 | 06-16-2020 01:31 AM |
Attention All Plugin Devs: Remove vestiges from python 2? | KevinH | Plugins | 11 | 05-29-2020 03:16 PM |
Plugin Devs: Should we include a License or COPYING file? | KevinH | Plugins | 3 | 08-15-2017 01:09 PM |
New Plugin Features in the upcoming Sigil 0.8.900 | KevinH | Plugins | 6 | 09-14-2015 02:48 PM |