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:
Kovid Goyal 2024-07-17 13:07:55 +05:30
parent b04bc87f66
commit 6bff175993
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -136,10 +136,15 @@ def read_theme_from_folder(path):
name_map = read_images_from_folder(path) name_map = read_images_from_folder(path)
name_map.pop(THEME_COVER, None) name_map.pop(THEME_COVER, None)
name_map.pop('blank.png', 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 extra = names - current_names
missing = current_names - names missing = current_names - names
missing.discard('blank.png')
try: try:
with open(os.path.join(path, THEME_METADATA), 'rb') as f: with open(os.path.join(path, THEME_METADATA), 'rb') as f:
metadata = json.load(f) metadata = json.load(f)