feat: modules moved and engine moved to submodule
This commit is contained in:
parent
dfb5e645cd
commit
c33d2130cc
5136 changed files with 225275 additions and 64485 deletions
|
|
@ -3,17 +3,14 @@ from misc.utility.scons_hints import *
|
|||
|
||||
Import("env")
|
||||
|
||||
import glob
|
||||
|
||||
import editor_theme_builders
|
||||
|
||||
# Fonts
|
||||
flist = glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.ttf")
|
||||
flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.otf"))
|
||||
flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.woff"))
|
||||
flist.extend(glob.glob(env.Dir("#thirdparty").abspath + "/fonts/*.woff2"))
|
||||
flist = Glob("#thirdparty/fonts/*.ttf")
|
||||
flist.extend(Glob("#thirdparty/fonts/*.otf"))
|
||||
flist.extend(Glob("#thirdparty/fonts/*.woff"))
|
||||
flist.extend(Glob("#thirdparty/fonts/*.woff2"))
|
||||
flist.sort()
|
||||
env.Depends("#editor/themes/builtin_fonts.gen.h", flist)
|
||||
env.CommandNoCache(
|
||||
"#editor/themes/builtin_fonts.gen.h",
|
||||
flist,
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef EDITOR_COLOR_MAP_H
|
||||
#define EDITOR_COLOR_MAP_H
|
||||
#pragma once
|
||||
|
||||
#include "core/math/color.h"
|
||||
#include "core/string/string_name.h"
|
||||
|
|
@ -56,5 +55,3 @@ public:
|
|||
static void create();
|
||||
static void finish();
|
||||
};
|
||||
|
||||
#endif // EDITOR_COLOR_MAP_H
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
|||
String noto_cjk_path;
|
||||
String noto_cjk_bold_path;
|
||||
String var_suffix[] = { "HK", "KR", "SC", "TC", "JP" }; // Note: All Noto Sans CJK versions support all glyph variations, it should not match current locale.
|
||||
for (size_t i = 0; i < sizeof(var_suffix) / sizeof(String); i++) {
|
||||
for (size_t i = 0; i < std::size(var_suffix); i++) {
|
||||
if (noto_cjk_path.is_empty()) {
|
||||
noto_cjk_path = OS::get_singleton()->get_system_font_path("Noto Sans CJK " + var_suffix[i], 400, 100);
|
||||
}
|
||||
|
|
@ -210,13 +210,14 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
|||
Ref<FontVariation> japanese_font_bold = make_bold_font(japanese_font, embolden_strength, &fallbacks_bold);
|
||||
|
||||
if (OS::get_singleton()->has_feature("system_fonts")) {
|
||||
PackedStringArray emoji_font_names;
|
||||
emoji_font_names.push_back("Apple Color Emoji");
|
||||
emoji_font_names.push_back("Segoe UI Emoji");
|
||||
emoji_font_names.push_back("Noto Color Emoji");
|
||||
emoji_font_names.push_back("Twitter Color Emoji");
|
||||
emoji_font_names.push_back("OpenMoji");
|
||||
emoji_font_names.push_back("EmojiOne Color");
|
||||
PackedStringArray emoji_font_names = {
|
||||
"Apple Color Emoji",
|
||||
"Segoe UI Emoji",
|
||||
"Noto Color Emoji",
|
||||
"Twitter Color Emoji",
|
||||
"OpenMoji",
|
||||
"EmojiOne Color"
|
||||
};
|
||||
Ref<SystemFont> emoji_font = load_system_font(emoji_font_names, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps, false);
|
||||
fallbacks.push_back(emoji_font);
|
||||
fallbacks_bold.push_back(emoji_font);
|
||||
|
|
@ -238,8 +239,7 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
|||
if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font);
|
||||
TypedArray<Font> fallback_custom = { default_font };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
default_fc->set_base_font(custom_font);
|
||||
|
|
@ -255,8 +255,7 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
|||
if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps, font_allow_msdf);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_msdf);
|
||||
TypedArray<Font> fallback_custom = { default_font_msdf };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
default_fc_msdf->set_base_font(custom_font);
|
||||
|
|
@ -272,16 +271,14 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
|||
if (custom_font_path_bold.length() > 0 && dir->file_exists(custom_font_path_bold)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path_bold, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_bold);
|
||||
TypedArray<Font> fallback_custom = { default_font_bold };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
bold_fc->set_base_font(custom_font);
|
||||
} else if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_bold);
|
||||
TypedArray<Font> fallback_custom = { default_font_bold };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
bold_fc->set_base_font(custom_font);
|
||||
|
|
@ -298,16 +295,14 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
|||
if (custom_font_path_bold.length() > 0 && dir->file_exists(custom_font_path_bold)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path_bold, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps, font_allow_msdf);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_bold_msdf);
|
||||
TypedArray<Font> fallback_custom = { default_font_bold_msdf };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
bold_fc_msdf->set_base_font(custom_font);
|
||||
} else if (custom_font_path.length() > 0 && dir->file_exists(custom_font_path)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path, font_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps, font_allow_msdf);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_bold_msdf);
|
||||
TypedArray<Font> fallback_custom = { default_font_bold_msdf };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
bold_fc_msdf->set_base_font(custom_font);
|
||||
|
|
@ -324,8 +319,7 @@ void editor_register_fonts(const Ref<Theme> &p_theme) {
|
|||
if (custom_font_path_source.length() > 0 && dir->file_exists(custom_font_path_source)) {
|
||||
Ref<FontFile> custom_font = load_external_font(custom_font_path_source, font_mono_hinting, font_antialiasing, true, font_subpixel_positioning, font_disable_embedded_bitmaps);
|
||||
{
|
||||
TypedArray<Font> fallback_custom;
|
||||
fallback_custom.push_back(default_font_mono);
|
||||
TypedArray<Font> fallback_custom = { default_font_mono };
|
||||
custom_font->set_fallbacks(fallback_custom);
|
||||
}
|
||||
mono_fc->set_base_font(custom_font);
|
||||
|
|
|
|||
|
|
@ -28,11 +28,8 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef EDITOR_FONTS_H
|
||||
#define EDITOR_FONTS_H
|
||||
#pragma once
|
||||
|
||||
#include "scene/resources/theme.h"
|
||||
|
||||
void editor_register_fonts(const Ref<Theme> &p_theme);
|
||||
|
||||
#endif // EDITOR_FONTS_H
|
||||
|
|
|
|||
|
|
@ -94,21 +94,37 @@ void editor_register_icons(const Ref<Theme> &p_theme, bool p_dark_theme, float p
|
|||
// And then some icons are completely excluded from the conversion.
|
||||
|
||||
// Standard color conversion map.
|
||||
HashMap<Color, Color> color_conversion_map;
|
||||
HashMap<Color, Color> color_conversion_map_light;
|
||||
HashMap<Color, Color> color_conversion_map_dark;
|
||||
// Icons by default are set up for the dark theme, so if the theme is light,
|
||||
// we apply the dark-to-light color conversion map.
|
||||
if (!p_dark_theme) {
|
||||
for (KeyValue<Color, Color> &E : EditorColorMap::get_color_conversion_map()) {
|
||||
color_conversion_map[E.key] = E.value;
|
||||
}
|
||||
for (KeyValue<Color, Color> &E : EditorColorMap::get_color_conversion_map()) {
|
||||
color_conversion_map_light[E.key] = E.value;
|
||||
}
|
||||
// These colors should be converted even if we are using a dark theme.
|
||||
const Color error_color = p_theme->get_color(SNAME("error_color"), EditorStringName(Editor));
|
||||
const Color success_color = p_theme->get_color(SNAME("success_color"), EditorStringName(Editor));
|
||||
const Color warning_color = p_theme->get_color(SNAME("warning_color"), EditorStringName(Editor));
|
||||
color_conversion_map[Color::html("#ff5f5f")] = error_color;
|
||||
color_conversion_map[Color::html("#5fff97")] = success_color;
|
||||
color_conversion_map[Color::html("#ffdd65")] = warning_color;
|
||||
color_conversion_map_dark[Color::html("#ff5f5f")] = error_color;
|
||||
color_conversion_map_dark[Color::html("#5fff97")] = success_color;
|
||||
color_conversion_map_dark[Color::html("#ffdd65")] = warning_color;
|
||||
color_conversion_map_light[Color::html("#ff5f5f")] = error_color;
|
||||
color_conversion_map_light[Color::html("#5fff97")] = success_color;
|
||||
color_conversion_map_light[Color::html("#ffdd65")] = warning_color;
|
||||
|
||||
HashMap<Color, Color> color_conversion_map = p_dark_theme ? color_conversion_map_dark : color_conversion_map_light;
|
||||
|
||||
// The names of the icons used in native menus.
|
||||
HashSet<StringName> native_menu_icons;
|
||||
native_menu_icons.insert("HelpSearch");
|
||||
native_menu_icons.insert("ActionCopy");
|
||||
native_menu_icons.insert("Heart");
|
||||
native_menu_icons.insert("PackedScene");
|
||||
native_menu_icons.insert("FileAccess");
|
||||
native_menu_icons.insert("Folder");
|
||||
native_menu_icons.insert("AnimationTrackList");
|
||||
native_menu_icons.insert("Object");
|
||||
native_menu_icons.insert("History");
|
||||
|
||||
// The names of the icons to exclude from the standard color conversion.
|
||||
HashSet<StringName> conversion_exceptions = EditorColorMap::get_color_conversion_exceptions();
|
||||
|
|
@ -141,25 +157,38 @@ void editor_register_icons(const Ref<Theme> &p_theme, bool p_dark_theme, float p
|
|||
// Generate icons.
|
||||
{
|
||||
for (int i = 0; i < editor_icons_count; i++) {
|
||||
Ref<ImageTexture> icon;
|
||||
|
||||
const String &editor_icon_name = editor_icons_names[i];
|
||||
if (accent_color_icons.has(editor_icon_name)) {
|
||||
icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name, p_gizmo_handle_scale), 1.0, accent_color_map);
|
||||
} else {
|
||||
if (native_menu_icons.has(editor_icon_name)) {
|
||||
float saturation = p_icon_saturation;
|
||||
if (saturation_exceptions.has(editor_icon_name)) {
|
||||
saturation = 1.0;
|
||||
}
|
||||
|
||||
if (conversion_exceptions.has(editor_icon_name)) {
|
||||
icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name, p_gizmo_handle_scale), saturation);
|
||||
} else {
|
||||
icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name, p_gizmo_handle_scale), saturation, color_conversion_map);
|
||||
}
|
||||
}
|
||||
Ref<ImageTexture> icon_dark = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name, p_gizmo_handle_scale), saturation, color_conversion_map_dark);
|
||||
Ref<ImageTexture> icon_light = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name, p_gizmo_handle_scale), saturation, color_conversion_map_light);
|
||||
|
||||
p_theme->set_icon(editor_icon_name, EditorStringName(EditorIcons), icon);
|
||||
p_theme->set_icon(editor_icon_name + "Dark", EditorStringName(EditorIcons), icon_dark);
|
||||
p_theme->set_icon(editor_icon_name + "Light", EditorStringName(EditorIcons), icon_light);
|
||||
p_theme->set_icon(editor_icon_name, EditorStringName(EditorIcons), p_dark_theme ? icon_dark : icon_light);
|
||||
} else {
|
||||
Ref<ImageTexture> icon;
|
||||
if (accent_color_icons.has(editor_icon_name)) {
|
||||
icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name, p_gizmo_handle_scale), 1.0, accent_color_map);
|
||||
} else {
|
||||
float saturation = p_icon_saturation;
|
||||
if (saturation_exceptions.has(editor_icon_name)) {
|
||||
saturation = 1.0;
|
||||
}
|
||||
|
||||
if (conversion_exceptions.has(editor_icon_name)) {
|
||||
icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name, p_gizmo_handle_scale), saturation);
|
||||
} else {
|
||||
icon = editor_generate_icon(i, get_gizmo_handle_scale(editor_icon_name, p_gizmo_handle_scale), saturation, color_conversion_map);
|
||||
}
|
||||
}
|
||||
|
||||
p_theme->set_icon(editor_icon_name, EditorStringName(EditorIcons), icon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef EDITOR_ICONS_H
|
||||
#define EDITOR_ICONS_H
|
||||
#pragma once
|
||||
|
||||
#include "scene/resources/theme.h"
|
||||
|
||||
|
|
@ -38,5 +37,3 @@ void editor_register_icons(const Ref<Theme> &p_theme, bool p_dark_theme, float p
|
|||
void editor_copy_icons(const Ref<Theme> &p_theme, const Ref<Theme> &p_old_theme);
|
||||
|
||||
String get_default_project_icon();
|
||||
|
||||
#endif // EDITOR_ICONS_H
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef EDITOR_SCALE_H
|
||||
#define EDITOR_SCALE_H
|
||||
#pragma once
|
||||
|
||||
class EditorScale {
|
||||
static float _scale;
|
||||
|
|
@ -40,5 +39,3 @@ public:
|
|||
};
|
||||
|
||||
#define EDSCALE (EditorScale::get_scale())
|
||||
|
||||
#endif // EDITOR_SCALE_H
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef EDITOR_THEME_H
|
||||
#define EDITOR_THEME_H
|
||||
#pragma once
|
||||
|
||||
#include "scene/resources/theme.h"
|
||||
|
||||
|
|
@ -62,5 +61,3 @@ public:
|
|||
static void initialize();
|
||||
static void finalize();
|
||||
};
|
||||
|
||||
#endif // EDITOR_THEME_H
|
||||
|
|
|
|||
|
|
@ -2,28 +2,20 @@
|
|||
|
||||
import os
|
||||
|
||||
import methods
|
||||
|
||||
|
||||
def make_fonts_header(target, source, env):
|
||||
dst = str(target[0])
|
||||
with methods.generated_wrapper(str(target[0])) as file:
|
||||
for src in map(str, source):
|
||||
# Saving uncompressed, since FreeType will reference from memory pointer.
|
||||
buffer = methods.get_buffer(src)
|
||||
name = os.path.splitext(os.path.basename(src))[0]
|
||||
|
||||
with open(dst, "w", encoding="utf-8", newline="\n") as g:
|
||||
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
|
||||
g.write("#ifndef _EDITOR_FONTS_H\n")
|
||||
g.write("#define _EDITOR_FONTS_H\n")
|
||||
file.write(f"""\
|
||||
inline constexpr int _font_{name}_size = {len(buffer)};
|
||||
inline constexpr unsigned char _font_{name}[] = {{
|
||||
{methods.format_buffer(buffer, 1)}
|
||||
}};
|
||||
|
||||
# Saving uncompressed, since FreeType will reference from memory pointer.
|
||||
for i in range(len(source)):
|
||||
file = str(source[i])
|
||||
with open(file, "rb") as f:
|
||||
buf = f.read()
|
||||
|
||||
name = os.path.splitext(os.path.basename(file))[0]
|
||||
|
||||
g.write("static const int _font_" + name + "_size = " + str(len(buf)) + ";\n")
|
||||
g.write("static const unsigned char _font_" + name + "[] = {\n")
|
||||
for j in range(len(buf)):
|
||||
g.write("\t" + str(buf[j]) + ",\n")
|
||||
|
||||
g.write("};\n")
|
||||
|
||||
g.write("#endif")
|
||||
""")
|
||||
|
|
|
|||
|
|
@ -957,6 +957,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
p_theme->set_color(SceneStringName(font_color), "Tree", p_config.font_color);
|
||||
p_theme->set_color("font_hovered_color", "Tree", p_config.mono_color);
|
||||
p_theme->set_color("font_hovered_dimmed_color", "Tree", p_config.font_color);
|
||||
p_theme->set_color("font_hovered_selected_color", "Tree", p_config.mono_color);
|
||||
p_theme->set_color("font_selected_color", "Tree", p_config.mono_color);
|
||||
p_theme->set_color("font_disabled_color", "Tree", p_config.font_disabled_color);
|
||||
p_theme->set_color("font_outline_color", "Tree", p_config.font_outline_color);
|
||||
|
|
@ -1017,6 +1018,13 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
style_tree_hover_dimmed->set_border_width_all(0);
|
||||
p_theme->set_stylebox("hovered_dimmed", "Tree", style_tree_hover_dimmed);
|
||||
|
||||
Ref<StyleBoxFlat> style_tree_hover_selected = style_tree_selected->duplicate();
|
||||
style_tree_hover_selected->set_bg_color(p_config.highlight_color * Color(1, 1, 1, 1.2));
|
||||
style_tree_hover_selected->set_border_width_all(0);
|
||||
|
||||
p_theme->set_stylebox("hovered_selected", "Tree", style_tree_hover_selected);
|
||||
p_theme->set_stylebox("hovered_selected_focus", "Tree", style_tree_hover_selected);
|
||||
|
||||
p_theme->set_stylebox("selected_focus", "Tree", style_tree_focus);
|
||||
p_theme->set_stylebox("selected", "Tree", style_tree_selected);
|
||||
|
||||
|
|
@ -1051,7 +1059,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
|
||||
Ref<StyleBoxFlat> style_itemlist_cursor = p_config.base_style->duplicate();
|
||||
style_itemlist_cursor->set_draw_center(false);
|
||||
style_itemlist_cursor->set_border_width_all(p_config.border_width);
|
||||
style_itemlist_cursor->set_border_width_all(MAX(1 * EDSCALE, p_config.border_width));
|
||||
style_itemlist_cursor->set_border_color(p_config.highlight_color);
|
||||
|
||||
Ref<StyleBoxFlat> style_itemlist_hover = style_tree_selected->duplicate();
|
||||
|
|
@ -1287,6 +1295,40 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
|
||||
// GridContainer.
|
||||
p_theme->set_constant("v_separation", "GridContainer", Math::round(p_config.widget_margin.y - 2 * EDSCALE));
|
||||
|
||||
// FoldableContainer
|
||||
|
||||
Ref<StyleBoxFlat> foldable_container_title = make_flat_stylebox(p_config.dark_color_1.darkened(0.125), p_config.base_margin, p_config.base_margin, p_config.base_margin, p_config.base_margin);
|
||||
foldable_container_title->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
|
||||
foldable_container_title->set_corner_radius(CORNER_BOTTOM_RIGHT, 0);
|
||||
p_theme->set_stylebox("title_panel", "FoldableContainer", foldable_container_title);
|
||||
Ref<StyleBoxFlat> foldable_container_hover = make_flat_stylebox(p_config.dark_color_1.lerp(p_config.base_color, 0.4), p_config.base_margin, p_config.base_margin, p_config.base_margin, p_config.base_margin);
|
||||
foldable_container_hover->set_corner_radius(CORNER_BOTTOM_LEFT, 0);
|
||||
foldable_container_hover->set_corner_radius(CORNER_BOTTOM_RIGHT, 0);
|
||||
p_theme->set_stylebox("title_hover_panel", "FoldableContainer", foldable_container_hover);
|
||||
p_theme->set_stylebox("title_collapsed_panel", "FoldableContainer", make_flat_stylebox(p_config.dark_color_1.darkened(0.125), p_config.base_margin, p_config.base_margin, p_config.base_margin, p_config.base_margin));
|
||||
p_theme->set_stylebox("title_collapsed_hover_panel", "FoldableContainer", make_flat_stylebox(p_config.dark_color_1.lerp(p_config.base_color, 0.4), p_config.base_margin, p_config.base_margin, p_config.base_margin, p_config.base_margin));
|
||||
Ref<StyleBoxFlat> foldable_container_panel = make_flat_stylebox(p_config.dark_color_1, p_config.base_margin, p_config.base_margin, p_config.base_margin, p_config.base_margin);
|
||||
foldable_container_panel->set_corner_radius(CORNER_TOP_LEFT, 0);
|
||||
foldable_container_panel->set_corner_radius(CORNER_TOP_RIGHT, 0);
|
||||
p_theme->set_stylebox(SceneStringName(panel), "FoldableContainer", foldable_container_panel);
|
||||
p_theme->set_stylebox("focus", "FoldableContainer", p_config.button_style_focus);
|
||||
|
||||
p_theme->set_font(SceneStringName(font), "FoldableContainer", p_theme->get_font(SceneStringName(font), SNAME("HeaderSmall")));
|
||||
p_theme->set_font_size(SceneStringName(font_size), "FoldableContainer", p_theme->get_font_size(SceneStringName(font_size), SNAME("HeaderSmall")));
|
||||
|
||||
p_theme->set_color(SceneStringName(font_color), "FoldableContainer", p_config.font_color);
|
||||
p_theme->set_color("hover_font_color", "FoldableContainer", p_config.font_hover_color);
|
||||
p_theme->set_color("collapsed_font_color", "FoldableContainer", p_config.font_pressed_color);
|
||||
p_theme->set_color("font_outline_color", "FoldableContainer", p_config.font_outline_color);
|
||||
|
||||
p_theme->set_icon("expanded_arrow", "FoldableContainer", p_theme->get_icon(SNAME("GuiTreeArrowDown"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("expanded_arrow_mirrored", "FoldableContainer", p_theme->get_icon(SNAME("GuiArrowUp"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("folded_arrow", "FoldableContainer", p_theme->get_icon(SNAME("GuiTreeArrowRight"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("folded_arrow_mirrored", "FoldableContainer", p_theme->get_icon(SNAME("GuiTreeArrowLeft"), EditorStringName(EditorIcons)));
|
||||
|
||||
p_theme->set_constant("outline_size", "FoldableContainer", 0);
|
||||
p_theme->set_constant("h_separation", "FoldableContainer", p_config.separation_margin);
|
||||
}
|
||||
|
||||
// Window and dialogs.
|
||||
|
|
@ -1380,9 +1422,6 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
p_theme->set_icon("radio_unchecked_disabled", "PopupMenu", p_theme->get_icon(SNAME("GuiRadioUncheckedDisabled"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("submenu", "PopupMenu", p_theme->get_icon(SNAME("ArrowRight"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("submenu_mirrored", "PopupMenu", p_theme->get_icon(SNAME("ArrowLeft"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("visibility_hidden", "PopupMenu", p_theme->get_icon(SNAME("GuiVisibilityHidden"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("visibility_visible", "PopupMenu", p_theme->get_icon(SNAME("GuiVisibilityVisible"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("visibility_xray", "PopupMenu", p_theme->get_icon(SNAME("GuiVisibilityXray"), EditorStringName(EditorIcons)));
|
||||
|
||||
p_theme->set_constant("v_separation", "PopupMenu", p_config.forced_even_separation * EDSCALE);
|
||||
p_theme->set_constant("outline_size", "PopupMenu", 0);
|
||||
|
|
@ -1475,6 +1514,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
// Label.
|
||||
|
||||
p_theme->set_stylebox(CoreStringName(normal), "Label", p_config.base_empty_style);
|
||||
p_theme->set_stylebox("focus", "Label", p_config.button_style_focus);
|
||||
|
||||
p_theme->set_color(SceneStringName(font_color), "Label", p_config.font_color);
|
||||
p_theme->set_color("font_shadow_color", "Label", Color(0, 0, 0, 0));
|
||||
|
|
@ -1541,6 +1581,7 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
// GraphEdit.
|
||||
|
||||
p_theme->set_stylebox(SceneStringName(panel), "GraphEdit", p_config.tree_panel_style);
|
||||
p_theme->set_stylebox("panel_focus", "GraphEdit", p_config.button_style_focus);
|
||||
p_theme->set_stylebox("menu_panel", "GraphEdit", make_flat_stylebox(p_config.dark_color_1 * Color(1, 1, 1, 0.6), 4, 2, 4, 2, 3));
|
||||
|
||||
float grid_base_brightness = p_config.dark_theme ? 1.0 : 0.0;
|
||||
|
|
@ -1672,9 +1713,11 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
|
||||
p_theme->set_stylebox(SceneStringName(panel), "GraphNode", gn_panel_style);
|
||||
p_theme->set_stylebox("panel_selected", "GraphNode", gn_panel_selected_style);
|
||||
p_theme->set_stylebox("panel_focus", "GraphNode", p_config.button_style_focus);
|
||||
p_theme->set_stylebox("titlebar", "GraphNode", gn_titlebar_style);
|
||||
p_theme->set_stylebox("titlebar_selected", "GraphNode", gn_titlebar_selected_style);
|
||||
p_theme->set_stylebox("slot", "GraphNode", gn_slot_style);
|
||||
p_theme->set_stylebox("slot_selected", "GraphNode", p_config.button_style_focus);
|
||||
|
||||
p_theme->set_color("resizer_color", "GraphNode", gn_decoration_color);
|
||||
|
||||
|
|
@ -1750,6 +1793,9 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
// ColorPicker and related nodes.
|
||||
{
|
||||
// ColorPicker.
|
||||
p_config.circle_style_focus = p_config.button_style_focus->duplicate();
|
||||
p_config.circle_style_focus->set_corner_radius_all(256 * EDSCALE);
|
||||
p_config.circle_style_focus->set_corner_detail(32 * EDSCALE);
|
||||
|
||||
p_theme->set_constant("margin", "ColorPicker", p_config.base_margin);
|
||||
p_theme->set_constant("sv_width", "ColorPicker", 256 * EDSCALE);
|
||||
|
|
@ -1758,6 +1804,11 @@ void EditorThemeManager::_populate_standard_styles(const Ref<EditorTheme> &p_the
|
|||
p_theme->set_constant("label_width", "ColorPicker", 10 * EDSCALE);
|
||||
p_theme->set_constant("center_slider_grabbers", "ColorPicker", 1);
|
||||
|
||||
p_theme->set_stylebox("sample_focus", "ColorPicker", p_config.button_style_focus);
|
||||
p_theme->set_stylebox("picker_focus_rectangle", "ColorPicker", p_config.button_style_focus);
|
||||
p_theme->set_stylebox("picker_focus_circle", "ColorPicker", p_config.circle_style_focus);
|
||||
p_theme->set_color("focused_not_editing_cursor_color", "ColorPicker", p_config.highlight_color);
|
||||
|
||||
p_theme->set_icon("screen_picker", "ColorPicker", p_theme->get_icon(SNAME("ColorPick"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("shape_circle", "ColorPicker", p_theme->get_icon(SNAME("PickerShapeCircle"), EditorStringName(EditorIcons)));
|
||||
p_theme->set_icon("shape_rect", "ColorPicker", p_theme->get_icon(SNAME("PickerShapeRectangle"), EditorStringName(EditorIcons)));
|
||||
|
|
@ -2609,6 +2660,7 @@ void EditorThemeManager::_generate_text_editor_defaults(ThemeConfiguration &p_co
|
|||
const Color function_color = p_config.dark_theme ? Color(0.34, 0.7, 1.0) : Color(0, 0.225, 0.9, 1);
|
||||
const Color member_variable_color = p_config.dark_theme ? Color(0.34, 0.7, 1.0).lerp(p_config.mono_color, 0.6) : Color(0, 0.4, 0.68, 1);
|
||||
const Color mark_color = Color(p_config.error_color.r, p_config.error_color.g, p_config.error_color.b, 0.3);
|
||||
const Color warning_color = Color(p_config.warning_color.r, p_config.warning_color.g, p_config.warning_color.b, 0.15);
|
||||
const Color bookmark_color = Color(0.08, 0.49, 0.98);
|
||||
const Color breakpoint_color = p_config.dark_theme ? p_config.error_color : Color(1, 0.27, 0.2, 1);
|
||||
const Color executing_line_color = Color(0.98, 0.89, 0.27);
|
||||
|
|
@ -2652,6 +2704,7 @@ void EditorThemeManager::_generate_text_editor_defaults(ThemeConfiguration &p_co
|
|||
setting->set_initial_value("text_editor/theme/highlighting/function_color", function_color, true);
|
||||
setting->set_initial_value("text_editor/theme/highlighting/member_variable_color", member_variable_color, true);
|
||||
setting->set_initial_value("text_editor/theme/highlighting/mark_color", mark_color, true);
|
||||
setting->set_initial_value("text_editor/theme/highlighting/warning_color", warning_color, true);
|
||||
setting->set_initial_value("text_editor/theme/highlighting/bookmark_color", bookmark_color, true);
|
||||
setting->set_initial_value("text_editor/theme/highlighting/breakpoint_color", breakpoint_color, true);
|
||||
setting->set_initial_value("text_editor/theme/highlighting/executing_line_color", executing_line_color, true);
|
||||
|
|
|
|||
|
|
@ -28,8 +28,7 @@
|
|||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef EDITOR_THEME_MANAGER_H
|
||||
#define EDITOR_THEME_MANAGER_H
|
||||
#pragma once
|
||||
|
||||
#include "editor/themes/editor_theme.h"
|
||||
#include "scene/resources/style_box_flat.h"
|
||||
|
|
@ -134,6 +133,8 @@ class EditorThemeManager {
|
|||
Ref<StyleBoxFlat> button_style_pressed;
|
||||
Ref<StyleBoxFlat> button_style_hover;
|
||||
|
||||
Ref<StyleBoxFlat> circle_style_focus;
|
||||
|
||||
Ref<StyleBoxFlat> popup_style;
|
||||
Ref<StyleBoxFlat> popup_border_style;
|
||||
Ref<StyleBoxFlat> window_style;
|
||||
|
|
@ -171,5 +172,3 @@ public:
|
|||
static void initialize();
|
||||
static void finalize();
|
||||
};
|
||||
|
||||
#endif // EDITOR_THEME_MANAGER_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue