mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-11 09:13:57 -04:00
Icon theme creation dialog: Fix icons with light/dark variants that do not have light/dark variants in the builtin icons incorrectly being reported as missing.
This commit is contained in:
parent
b04bc87f66
commit
6bff175993
@ -136,10 +136,15 @@ def read_theme_from_folder(path):
|
||||
name_map = read_images_from_folder(path)
|
||||
name_map.pop(THEME_COVER, None)
|
||||
name_map.pop('blank.png', None)
|
||||
current_names = frozenset(current_image_map)
|
||||
names = frozenset(name_map)
|
||||
|
||||
def canonical_name(x):
|
||||
return x.replace('-for-dark-theme', '').replace('-for-light-theme', '')
|
||||
|
||||
current_names = set(map(canonical_name, current_image_map))
|
||||
names = set(map(canonical_name, name_map))
|
||||
extra = names - current_names
|
||||
missing = current_names - names
|
||||
missing.discard('blank.png')
|
||||
try:
|
||||
with open(os.path.join(path, THEME_METADATA), 'rb') as f:
|
||||
metadata = json.load(f)
|
||||
|
Loading…
x
Reference in New Issue
Block a user