Merge pull request #30167 from Xrayez/module-editor-icons
Add support for creating editor icons per module
10
SConstruct
|
@ -399,6 +399,7 @@ if selected_platform in platform_list:
|
||||||
sys.modules.pop('detect')
|
sys.modules.pop('detect')
|
||||||
|
|
||||||
env.module_list = []
|
env.module_list = []
|
||||||
|
env.module_icons_paths = []
|
||||||
env.doc_class_path = {}
|
env.doc_class_path = {}
|
||||||
|
|
||||||
for x in module_list:
|
for x in module_list:
|
||||||
|
@ -421,6 +422,8 @@ if selected_platform in platform_list:
|
||||||
if (can_build):
|
if (can_build):
|
||||||
config.configure(env)
|
config.configure(env)
|
||||||
env.module_list.append(x)
|
env.module_list.append(x)
|
||||||
|
|
||||||
|
# Get doc classes paths (if present)
|
||||||
try:
|
try:
|
||||||
doc_classes = config.get_doc_classes()
|
doc_classes = config.get_doc_classes()
|
||||||
doc_path = config.get_doc_path()
|
doc_path = config.get_doc_path()
|
||||||
|
@ -428,6 +431,13 @@ if selected_platform in platform_list:
|
||||||
env.doc_class_path[c] = "modules/" + x + "/" + doc_path
|
env.doc_class_path[c] = "modules/" + x + "/" + doc_path
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
# Get icon paths (if present)
|
||||||
|
try:
|
||||||
|
icons_path = config.get_icons_path()
|
||||||
|
env.module_icons_paths.append("modules/" + x + "/" + icons_path)
|
||||||
|
except:
|
||||||
|
# Default path for module icons
|
||||||
|
env.module_icons_paths.append("modules/" + x + "/" + "icons")
|
||||||
|
|
||||||
sys.path.remove(tmppath)
|
sys.path.remove(tmppath)
|
||||||
sys.modules.pop('config')
|
sys.modules.pop('config')
|
||||||
|
|
|
@ -10,4 +10,12 @@ make_editor_icons_builder = Builder(action=run_in_subprocess(editor_icons_builde
|
||||||
src_suffix='.svg')
|
src_suffix='.svg')
|
||||||
|
|
||||||
env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder
|
env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder
|
||||||
env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.h', Glob("*.svg"))])
|
|
||||||
|
# Editor's own icons
|
||||||
|
icon_sources = Glob("*.svg")
|
||||||
|
|
||||||
|
# Module icons
|
||||||
|
for module_icons in env.module_icons_paths:
|
||||||
|
icon_sources += Glob('#' + module_icons + "/*.svg")
|
||||||
|
|
||||||
|
env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.h', icon_sources)])
|
||||||
|
|
Before Width: | Height: | Size: 754 B After Width: | Height: | Size: 754 B |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 649 B After Width: | Height: | Size: 649 B |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 941 B After Width: | Height: | Size: 941 B |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1 KiB After Width: | Height: | Size: 1 KiB |
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 725 B After Width: | Height: | Size: 725 B |
Before Width: | Height: | Size: 713 B After Width: | Height: | Size: 713 B |
Before Width: | Height: | Size: 786 B After Width: | Height: | Size: 786 B |
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 300 B |
Before Width: | Height: | Size: 332 B After Width: | Height: | Size: 332 B |
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 794 B |