84a69d7429
The new default project theme uses StyleBoxFlat extensively for a more modern design and better scalability to multiple resolutions. SVG icons are now used in place of PNG icons. While this does not allow for true vector-based icon drawing (icons are still rasterized at load-time), this makes the design work easier for contributors and opens the door to vector drawing in the future (e.g. with polygons or SDFs). Like for editor icons, the SVG header file is now built automatically when a SVG file is changed. This removing the need for running `make_header.py` manually (TODO). The "Use Hidpi" project setting has been removed in favor of a "Default Theme Scale" project setting, which allows creating the default theme at a higher/lower scale than the default. This can be used when designing GUIs with a high base resolution to ensure crisp visuals. Co-authored-by: Yuri Sizov <yuris@humnom.net>
32 lines
956 B
Python
32 lines
956 B
Python
#!/usr/bin/env python
|
|
|
|
Import("env")
|
|
|
|
from platform_methods import run_in_subprocess
|
|
import default_theme_builders
|
|
import default_theme_icons_builders
|
|
|
|
env.add_source_files(env.scene_sources, "*.cpp")
|
|
|
|
env.Depends("#scene/resources/default_theme/default_font.gen.h", "#thirdparty/fonts/OpenSans_SemiBold.ttf")
|
|
env.CommandNoCache(
|
|
"#scene/resources/default_theme/default_font.gen.h",
|
|
"#thirdparty/fonts/OpenSans_SemiBold.ttf",
|
|
run_in_subprocess(default_theme_builders.make_fonts_header),
|
|
)
|
|
|
|
env["BUILDERS"]["MakeDefaultThemeIconsBuilder"] = Builder(
|
|
action=env.Run(
|
|
default_theme_icons_builders.make_default_theme_icons_action, "Generating default project theme icons header."
|
|
),
|
|
suffix=".h",
|
|
src_suffix=".svg",
|
|
)
|
|
|
|
# Default theme icons
|
|
icon_sources = Glob("*.svg")
|
|
|
|
env.Alias(
|
|
"default_theme_icons",
|
|
[env.MakeDefaultThemeIconsBuilder("#scene/resources/default_theme/default_theme_icons.gen.h", icon_sources)],
|
|
)
|