Skip to content

Commit

Permalink
Allow for-light/dark-theme icon overrides to work for plugin icons pl…
Browse files Browse the repository at this point in the history
…aced by the user in the override dir
  • Loading branch information
kovidgoyal committed Sep 15, 2023
1 parent c552076 commit fe29b9a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/calibre/gui2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ def overriden_icon_path(self, name):
ans = os.path.join(self.override_icon_path, sq)
elif len(parts) == 2:
entries = self.override_items.get(parts[0], ())
if not entries and self.override_icon_path and parts[0] not in self.override_items:
try:
self.override_items[parts[0]] = entries = frozenset(os.listdir(os.path.join(self.override_icon_path, parts[0])))
except OSError:
self.override_items[parts[0]] = entries = frozenset()
if entries:
sq, ext = os.path.splitext(parts[1])
sq = f'{sq}-for-{self.color_palette}-theme{ext}'
Expand Down

0 comments on commit fe29b9a

Please sign in to comment.