Merge pull request #11072 from djrm/pr_better_theme
Several visual improvements
@ -1038,7 +1038,7 @@ void AnimationKeyEditor::_track_pos_draw() {
|
||||
//draw position
|
||||
int pixel = (timeline_pos - h_scroll->get_value()) * zoom_scale;
|
||||
pixel += name_limit;
|
||||
track_pos->draw_line(ofs + Point2(pixel, 0), ofs + Point2(pixel, size.height), get_color("highlight_color", "Editor"));
|
||||
track_pos->draw_line(ofs + Point2(pixel, 0), ofs + Point2(pixel, size.height), get_color("accent_color", "Editor"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1101,7 +1101,7 @@ void AnimationKeyEditor::_track_editor_draw() {
|
||||
Color select_color = color;
|
||||
select_color.a = 0.1;
|
||||
Color invalid_path_color = get_color("error_color", "Editor");
|
||||
Color track_select_color = get_color("highlight_color", "Editor");
|
||||
Color track_select_color = get_color("accent", "Editor");
|
||||
|
||||
Ref<Texture> remove_icon = get_icon("Remove", "EditorIcons");
|
||||
Ref<Texture> move_up_icon = get_icon("MoveUp", "EditorIcons");
|
||||
@ -1487,7 +1487,7 @@ void AnimationKeyEditor::_track_editor_draw() {
|
||||
switch (click.click) {
|
||||
case ClickOver::CLICK_SELECT_KEYS: {
|
||||
|
||||
Color box_color = get_color("highlight_color", "Editor");
|
||||
Color box_color = get_color("accent_color", "Editor");
|
||||
box_color.a = 0.35;
|
||||
te->draw_rect(Rect2(click.at, click.to - click.at), box_color);
|
||||
|
||||
|
@ -1709,6 +1709,10 @@ void EditorHelp::_notification(int p_what) {
|
||||
//forward->set_icon(get_icon("Forward","EditorIcons"));
|
||||
//back->set_icon(get_icon("Back","EditorIcons"));
|
||||
_update_doc();
|
||||
|
||||
class_desc->add_style_override("normal", class_desc->get_stylebox("code_normal", "RichTextLabel"));
|
||||
class_desc->add_style_override("focus", class_desc->get_stylebox("code_focus", "RichTextLabel"));
|
||||
|
||||
} break;
|
||||
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
@ -1784,12 +1788,10 @@ EditorHelp::EditorHelp() {
|
||||
//class_list->set_selection_enabled(true);
|
||||
|
||||
{
|
||||
background_panel = memnew(Panel);
|
||||
background_panel->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
vbc->add_child(background_panel);
|
||||
class_desc = memnew(RichTextLabel);
|
||||
background_panel->add_child(class_desc);
|
||||
vbc->add_child(class_desc);
|
||||
class_desc->set_area_as_parent_rect();
|
||||
class_desc->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
class_desc->add_color_override("selection_color", EDITOR_DEF("text_editor/highlighting/selection_color", Color(0.2, 0.2, 1)));
|
||||
class_desc->connect("meta_clicked", this, "_class_desc_select");
|
||||
class_desc->connect("gui_input", this, "_class_desc_input");
|
||||
|
@ -130,7 +130,6 @@ class EditorHelp : public VBoxContainer {
|
||||
HSplitContainer *h_split;
|
||||
static DocData *doc;
|
||||
|
||||
Panel *background_panel;
|
||||
ConfirmationDialog *search_dialog;
|
||||
LineEdit *search;
|
||||
|
||||
|
@ -61,9 +61,6 @@ void EditorLog::_notification(int p_what) {
|
||||
|
||||
//button->set_icon(get_icon("Console","EditorIcons"));
|
||||
}
|
||||
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
||||
_override_logger_styles();
|
||||
}
|
||||
|
||||
/*if (p_what==NOTIFICATION_DRAW) {
|
||||
|
||||
@ -129,7 +126,6 @@ void EditorLog::_undo_redo_cbk(void *p_self, const String &p_name) {
|
||||
void EditorLog::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_clear_request"), &EditorLog::_clear_request);
|
||||
ClassDB::bind_method("_override_logger_styles", &EditorLog::_override_logger_styles);
|
||||
//ClassDB::bind_method(D_METHOD("_dragged"),&EditorLog::_dragged );
|
||||
ADD_SIGNAL(MethodInfo("clear_request"));
|
||||
}
|
||||
@ -151,21 +147,15 @@ EditorLog::EditorLog() {
|
||||
clearbutton->set_text(TTR("Clear"));
|
||||
clearbutton->connect("pressed", this, "_clear_request");
|
||||
|
||||
ec = memnew(Control);
|
||||
vb->add_child(ec);
|
||||
ec->set_custom_minimum_size(Size2(0, 180) * EDSCALE);
|
||||
ec->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
|
||||
pc = memnew(PanelContainer);
|
||||
ec->add_child(pc);
|
||||
pc->set_area_as_parent_rect();
|
||||
pc->connect("tree_entered", this, "_override_logger_styles");
|
||||
|
||||
log = memnew(RichTextLabel);
|
||||
log->set_scroll_follow(true);
|
||||
log->set_selection_enabled(true);
|
||||
log->set_focus_mode(FOCUS_CLICK);
|
||||
pc->add_child(log);
|
||||
log->set_custom_minimum_size(Size2(0, 180) * EDSCALE);
|
||||
log->set_area_as_parent_rect();
|
||||
log->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
log->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
vb->add_child(log);
|
||||
add_message(VERSION_FULL_NAME " (c) 2008-2017 Juan Linietsky, Ariel Manzur.");
|
||||
//log->add_text("Initialization Complete.\n"); //because it looks cool.
|
||||
|
||||
@ -183,10 +173,5 @@ void EditorLog::deinit() {
|
||||
remove_error_handler(&eh);
|
||||
}
|
||||
|
||||
void EditorLog::_override_logger_styles() {
|
||||
|
||||
pc->add_style_override("panel", get_stylebox("normal", "TextEdit"));
|
||||
}
|
||||
|
||||
EditorLog::~EditorLog() {
|
||||
}
|
||||
|
@ -50,8 +50,6 @@ class EditorLog : public VBoxContainer {
|
||||
RichTextLabel *log;
|
||||
HBoxContainer *title_hb;
|
||||
//PaneDrag *pd;
|
||||
Control *ec;
|
||||
PanelContainer *pc;
|
||||
|
||||
static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, ErrorHandlerType p_type);
|
||||
|
||||
@ -66,7 +64,6 @@ class EditorLog : public VBoxContainer {
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
void _notification(int p_what);
|
||||
void _override_logger_styles();
|
||||
|
||||
public:
|
||||
void add_message(const String &p_msg, bool p_error = false);
|
||||
|
@ -4872,6 +4872,7 @@ EditorNode::EditorNode() {
|
||||
gui_base->add_child(dependency_fixer);
|
||||
|
||||
settings_config_dialog = memnew(EditorSettingsDialog);
|
||||
// settings_config_dialog->add_style_override("panel", gui_base->get_stylebox("EditorSettingsDialog", "EditorStyles"));
|
||||
gui_base->add_child(settings_config_dialog);
|
||||
|
||||
project_settings = memnew(ProjectSettingsEditor(&editor_data));
|
||||
@ -5029,7 +5030,7 @@ EditorNode::EditorNode() {
|
||||
p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Issue Tracker"), HELP_ISSUES);
|
||||
p->add_icon_item(gui_base->get_icon("Instance", "EditorIcons"), TTR("Community"), HELP_COMMUNITY);
|
||||
p->add_separator();
|
||||
p->add_icon_item(gui_base->get_icon("GodotDocs", "EditorIcons"), TTR("About"), HELP_ABOUT);
|
||||
p->add_icon_item(gui_base->get_icon("Godot", "EditorIcons"), TTR("About"), HELP_ABOUT);
|
||||
|
||||
play_cc = memnew(CenterContainer);
|
||||
play_cc->set_mouse_filter(Control::MOUSE_FILTER_IGNORE);
|
||||
|
@ -574,10 +574,10 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
||||
set("interface/theme/icon_and_font_color", 0);
|
||||
hints["interface/theme/icon_and_font_color"] = PropertyInfo(Variant::INT, "interface/theme/icon_and_font_color", PROPERTY_HINT_ENUM, "Auto,Dark,Light", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
set("interface/theme/base_color", Color::html("#323b4f"));
|
||||
hints["interface/theme/highlight_color"] = PropertyInfo(Variant::COLOR, "interface/theme/highlight_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
set("interface/theme/highlight_color", Color::html("#699ce8"));
|
||||
hints["interface/theme/accent_color"] = PropertyInfo(Variant::COLOR, "interface/theme/accent_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
set("interface/theme/accent_color", Color::html("#699ce8"));
|
||||
hints["interface/theme/base_color"] = PropertyInfo(Variant::COLOR, "interface/theme/base_color", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
set("interface/theme/contrast", 0.2);
|
||||
set("interface/theme/contrast", 0.25);
|
||||
hints["interface/theme/contrast"] = PropertyInfo(Variant::REAL, "interface/theme/contrast", PROPERTY_HINT_RANGE, "0.01, 1, 0.01");
|
||||
set("interface/theme/highlight_tabs", false);
|
||||
set("interface/theme/border_size", 1);
|
||||
|
@ -86,7 +86,7 @@ static Ref<StyleBoxFlat> change_border_color(Ref<StyleBoxFlat> p_style, Color p_
|
||||
return style;
|
||||
}
|
||||
|
||||
Ref<ImageTexture> editor_generate_icon(int p_index, bool dark_theme = true, Dictionary *p_colors = NULL) {
|
||||
Ref<ImageTexture> editor_generate_icon(int p_index, bool dark_theme = true, Dictionary *p_colors = NULL, float p_scale = EDSCALE, bool force_filter = false) {
|
||||
|
||||
Ref<ImageTexture> icon = memnew(ImageTexture);
|
||||
Ref<Image> img = memnew(Image);
|
||||
@ -94,9 +94,9 @@ Ref<ImageTexture> editor_generate_icon(int p_index, bool dark_theme = true, Dict
|
||||
// dumb gizmo check
|
||||
bool is_gizmo = String(editor_icons_names[p_index]).begins_with("Gizmo");
|
||||
|
||||
ImageLoaderSVG::create_image_from_string(img, editor_icons_sources[p_index], EDSCALE, true, dark_theme ? NULL : p_colors);
|
||||
ImageLoaderSVG::create_image_from_string(img, editor_icons_sources[p_index], p_scale, true, dark_theme ? NULL : p_colors);
|
||||
|
||||
if ((EDSCALE - (float)((int)EDSCALE)) > 0.0 || is_gizmo)
|
||||
if ((p_scale - (float)((int)p_scale)) > 0.0 || is_gizmo || force_filter)
|
||||
icon->create_from_image(img); // in this case filter really helps
|
||||
else
|
||||
icon->create_from_image(img, 0);
|
||||
@ -108,10 +108,9 @@ Ref<ImageTexture> editor_generate_icon(int p_index, bool dark_theme = true, Dict
|
||||
#define ADD_CONVERT_COLOR(dictionary, old_color, new_color) dictionary[Color::html(old_color)] = Color::html(new_color)
|
||||
#endif
|
||||
|
||||
void editor_register_and_generate_icons(Ref<Theme> p_theme, bool dark_theme = true) {
|
||||
void editor_register_and_generate_icons(Ref<Theme> p_theme, bool dark_theme = true, int p_thumb_size = 32, bool only_thumbs = false) {
|
||||
|
||||
#ifdef SVG_ENABLED
|
||||
|
||||
Dictionary dark_icon_color_dictionary;
|
||||
//convert color: FROM TO
|
||||
ADD_CONVERT_COLOR(dark_icon_color_dictionary, "#e0e0e0", "#4f4f4f"); // common icon color
|
||||
@ -161,13 +160,32 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool dark_theme = tr
|
||||
|
||||
clock_t begin_time = clock();
|
||||
|
||||
for (int i = 0; i < editor_icons_count; i++) {
|
||||
List<String>::Element *is_exception = exceptions.find(editor_icons_names[i]);
|
||||
if (is_exception) {
|
||||
exceptions.erase(is_exception);
|
||||
if (!only_thumbs)
|
||||
for (int i = 0; i < editor_icons_count; i++) {
|
||||
List<String>::Element *is_exception = exceptions.find(editor_icons_names[i]);
|
||||
if (is_exception) {
|
||||
exceptions.erase(is_exception);
|
||||
}
|
||||
Ref<ImageTexture> icon = editor_generate_icon(i, dark_theme, is_exception ? NULL : &dark_icon_color_dictionary);
|
||||
p_theme->set_icon(editor_icons_names[i], "EditorIcons", icon);
|
||||
}
|
||||
|
||||
bool force_filter = !(p_thumb_size == 64 && p_thumb_size == 32); // we dont need filter with original resolution
|
||||
// generate thumb files with the given thumb size
|
||||
if (p_thumb_size >= 64) {
|
||||
float scale = (float)p_thumb_size / 64.0 * EDSCALE;
|
||||
for (int i = 0; i < editor_bg_thumbs_count; i++) {
|
||||
int index = editor_bg_thumbs_indices[i];
|
||||
Ref<ImageTexture> icon = editor_generate_icon(index, dark_theme, &dark_icon_color_dictionary, scale, force_filter);
|
||||
p_theme->set_icon(editor_icons_names[index], "EditorIcons", icon);
|
||||
}
|
||||
} else {
|
||||
float scale = (float)p_thumb_size / 32.0 * EDSCALE;
|
||||
for (int i = 0; i < editor_md_thumbs_count; i++) {
|
||||
int index = editor_md_thumbs_indices[i];
|
||||
Ref<ImageTexture> icon = editor_generate_icon(index, dark_theme, &dark_icon_color_dictionary, scale, force_filter);
|
||||
p_theme->set_icon(editor_icons_names[index], "EditorIcons", icon);
|
||||
}
|
||||
Ref<ImageTexture> icon = editor_generate_icon(i, dark_theme, is_exception ? NULL : &dark_icon_color_dictionary);
|
||||
p_theme->set_icon(editor_icons_names[i], "EditorIcons", icon);
|
||||
}
|
||||
|
||||
clock_t end_time = clock();
|
||||
@ -179,9 +197,6 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool dark_theme = tr
|
||||
#endif
|
||||
}
|
||||
|
||||
#define HIGHLIGHT_COLOR_FONT highlight_color.linear_interpolate(dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1), 0.5)
|
||||
#define HIGHLIGHT_COLOR_BG highlight_color.linear_interpolate(dark_theme ? Color(0, 0, 0, 1) : Color(1, 1, 1, 1), 0.5)
|
||||
|
||||
Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
|
||||
Ref<Theme> theme = Ref<Theme>(memnew(Theme));
|
||||
@ -189,7 +204,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
const float default_contrast = 0.25;
|
||||
|
||||
//Theme settings
|
||||
Color highlight_color = EDITOR_DEF("interface/theme/highlight_color", Color::html("#000000"));
|
||||
Color accent_color = EDITOR_DEF("interface/theme/accent_color", Color::html("#000000"));
|
||||
Color base_color = EDITOR_DEF("interface/theme/base_color", Color::html("#000000"));
|
||||
float contrast = EDITOR_DEF("interface/theme/contrast", default_contrast);
|
||||
|
||||
@ -202,27 +217,27 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
|
||||
switch (preset) {
|
||||
case 0: { // Default
|
||||
highlight_color = Color::html("#699ce8");
|
||||
accent_color = Color::html("#699ce8");
|
||||
base_color = Color::html("#323b4f");
|
||||
contrast = default_contrast;
|
||||
} break;
|
||||
case 1: { // Grey
|
||||
highlight_color = Color::html("#3e3e3e");
|
||||
accent_color = Color::html("#3e3e3e");
|
||||
base_color = Color::html("#3d3d3d");
|
||||
contrast = 0.2;
|
||||
} break;
|
||||
case 2: { // Godot 2
|
||||
highlight_color = Color::html("#86ace2");
|
||||
accent_color = Color::html("#86ace2");
|
||||
base_color = Color::html("#3C3A44");
|
||||
contrast = 0.25;
|
||||
} break;
|
||||
case 3: { // Arc
|
||||
highlight_color = Color::html("#5294e2");
|
||||
accent_color = Color::html("#5294e2");
|
||||
base_color = Color::html("#383c4a");
|
||||
contrast = 0.25;
|
||||
} break;
|
||||
case 4: { // Light
|
||||
highlight_color = Color::html("#2070ff");
|
||||
accent_color = Color::html("#2070ff");
|
||||
base_color = Color::html("#ffffff");
|
||||
contrast = 0.08;
|
||||
} break;
|
||||
@ -233,22 +248,29 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
int LIGHT_COLOR = 2;
|
||||
bool dark_theme = (icon_font_color_setting == AUTO_COLOR && ((base_color.r + base_color.g + base_color.b) / 3.0) < 0.5) || icon_font_color_setting == LIGHT_COLOR;
|
||||
|
||||
Color dark_color_1 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast);
|
||||
Color dark_color_2 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 1.5);
|
||||
Color dark_color_3 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 2);
|
||||
const Color dark_color_1 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast);
|
||||
const Color dark_color_2 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 1.5);
|
||||
const Color dark_color_3 = base_color.linear_interpolate(Color(0, 0, 0, 1), contrast * 2);
|
||||
|
||||
Color contrast_color_1 = base_color.linear_interpolate((dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)), MAX(contrast, default_contrast));
|
||||
Color contrast_color_2 = base_color.linear_interpolate((dark_theme ? Color(1, 1, 1, 1) : Color(0, 0, 0, 1)), MAX(contrast * 1.5, default_contrast * 1.5));
|
||||
const Color background_color = dark_color_2;
|
||||
|
||||
Color font_color = dark_theme ? Color(1, 1, 1) : Color(0, 0, 0);
|
||||
Color font_color_disabled = dark_theme ? Color(0.6, 0.6, 0.6) : Color(0.45, 0.45, 0.45);
|
||||
// white (dark theme) or black (light theme), will be used to generate the rest of the colors
|
||||
const Color mono_color = dark_theme ? Color(1, 1, 1) : Color(0, 0, 0);
|
||||
|
||||
Color separator_color = dark_theme ? Color(1, 1, 1, 0.1) : Color(0, 0, 0, 0.1);
|
||||
const Color contrast_color_1 = base_color.linear_interpolate(mono_color, MAX(contrast, default_contrast));
|
||||
const Color contrast_color_2 = base_color.linear_interpolate(mono_color, MAX(contrast * 1.5, default_contrast * 1.5));
|
||||
|
||||
Color tab_color = highlight_tabs ? base_color.linear_interpolate(font_color, contrast) : base_color;
|
||||
const int border_width = CLAMP(border_size, 0, 3) * EDSCALE;
|
||||
const Color font_color = mono_color.linear_interpolate(base_color, 0.25);
|
||||
const Color font_color_hl = mono_color.linear_interpolate(base_color, 0.15);
|
||||
const Color font_color_disabled = Color(mono_color.r, mono_color.g, mono_color.b, 0.3);
|
||||
const Color color_disabled = mono_color.inverted().linear_interpolate(base_color, 0.7);
|
||||
const Color color_disabled_bg = mono_color.inverted().linear_interpolate(base_color, 0.9);
|
||||
|
||||
theme->set_color("highlight_color", "Editor", highlight_color);
|
||||
const Color separator_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.1);
|
||||
|
||||
const Color highlight_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.2);
|
||||
|
||||
theme->set_color("accent_color", "Editor", accent_color);
|
||||
theme->set_color("base_color", "Editor", base_color);
|
||||
theme->set_color("dark_color_1", "Editor", dark_color_1);
|
||||
theme->set_color("dark_color_2", "Editor", dark_color_2);
|
||||
@ -256,14 +278,16 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_color("contrast_color_1", "Editor", contrast_color_1);
|
||||
theme->set_color("contrast_color_2", "Editor", contrast_color_2);
|
||||
|
||||
Color success_color = highlight_color.linear_interpolate(Color(.6, 1, .6), 0.8);
|
||||
Color warning_color = highlight_color.linear_interpolate(Color(1, 1, .2), 0.8);
|
||||
Color error_color = highlight_color.linear_interpolate(Color(1, .2, .2), 0.8);
|
||||
Color success_color = accent_color.linear_interpolate(Color(.6, 1, .6), 0.8);
|
||||
Color warning_color = accent_color.linear_interpolate(Color(1, 1, .2), 0.8);
|
||||
Color error_color = accent_color.linear_interpolate(Color(1, .2, .2), 0.8);
|
||||
theme->set_color("success_color", "Editor", success_color);
|
||||
theme->set_color("warning_color", "Editor", warning_color);
|
||||
theme->set_color("error_color", "Editor", error_color);
|
||||
|
||||
const int thumb_size = EDITOR_DEF("filesystem/file_dialog/thumbnail_size", 64);
|
||||
theme->set_constant("scale", "Editor", EDSCALE);
|
||||
theme->set_constant("thumb_size", "Editor", thumb_size);
|
||||
theme->set_constant("dark_theme", "Editor", dark_theme);
|
||||
|
||||
//Register icons + font
|
||||
@ -275,23 +299,85 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_icon(editor_icons_names[i], "EditorIcons", p_theme->get_icon(editor_icons_names[i], "EditorIcons"));
|
||||
}
|
||||
} else {
|
||||
editor_register_and_generate_icons(theme, dark_theme);
|
||||
editor_register_and_generate_icons(theme, dark_theme, thumb_size);
|
||||
}
|
||||
// thumbnail size has changed, so we regenerate the medium sizes
|
||||
if (p_theme != NULL && fabs(p_theme->get_constant("thumb_size", "Editor") - thumb_size) > 0.00001) {
|
||||
editor_register_and_generate_icons(p_theme, dark_theme, thumb_size, true);
|
||||
}
|
||||
|
||||
editor_register_fonts(theme);
|
||||
|
||||
// Highlighted tabs and border width
|
||||
Color tab_color = highlight_tabs ? base_color.linear_interpolate(font_color, contrast) : base_color;
|
||||
const int border_width = CLAMP(border_size, 0, 3) * EDSCALE;
|
||||
|
||||
const int default_margin_size = 4 * EDSCALE;
|
||||
// styleboxes
|
||||
// this is the most commonly used stylebox, variations should be made as duplicate of this
|
||||
Ref<StyleBoxFlat> style_default = make_flat_stylebox(base_color, default_margin_size, default_margin_size, default_margin_size, default_margin_size);
|
||||
style_default->set_border_width_all(border_width);
|
||||
style_default->set_border_color_all(base_color);
|
||||
style_default->set_draw_center(true);
|
||||
|
||||
// Button and widgets
|
||||
Ref<StyleBoxFlat> style_widget = style_default->duplicate();
|
||||
|
||||
// style_widget->set_bg_color(dark_color_1.linear_interpolate(base_color, 0.4));
|
||||
style_widget->set_bg_color(dark_color_1);
|
||||
style_widget->set_default_margin(MARGIN_LEFT, 6 * EDSCALE);
|
||||
style_widget->set_default_margin(MARGIN_RIGHT, 6 * EDSCALE);
|
||||
// style_widget->set_border_color_all(contrast_color_1);
|
||||
style_widget->set_border_color_all(dark_color_2);
|
||||
|
||||
Ref<StyleBoxFlat> style_widget_disabled = style_widget->duplicate();
|
||||
style_widget_disabled->set_border_color_all(color_disabled);
|
||||
style_widget_disabled->set_bg_color(color_disabled_bg);
|
||||
|
||||
Ref<StyleBoxFlat> style_widget_focus = style_widget->duplicate();
|
||||
style_widget_focus->set_border_color_all(accent_color);
|
||||
|
||||
Ref<StyleBoxFlat> style_widget_pressed = style_widget->duplicate();
|
||||
style_widget_pressed->set_border_color_all(accent_color);
|
||||
|
||||
Ref<StyleBoxFlat> style_widget_hover = style_widget->duplicate();
|
||||
style_widget_hover->set_border_color_all(contrast_color_1);
|
||||
|
||||
// style for windows, popups, etc..
|
||||
Ref<StyleBoxFlat> style_popup = style_default->duplicate();
|
||||
style_popup->set_default_margin(MARGIN_LEFT, default_margin_size * 2);
|
||||
style_popup->set_default_margin(MARGIN_TOP, default_margin_size * 2);
|
||||
style_popup->set_default_margin(MARGIN_RIGHT, default_margin_size * 2);
|
||||
style_popup->set_default_margin(MARGIN_BOTTOM, default_margin_size * 2);
|
||||
style_popup->set_border_color_all(contrast_color_1);
|
||||
style_popup->set_border_width_all(MAX(EDSCALE, border_width));
|
||||
const Color shadow_color = Color(0, 0, 0, dark_theme ? 0.3 : 0.1);
|
||||
style_popup->set_shadow_color(shadow_color);
|
||||
style_popup->set_shadow_size(4 * EDSCALE);
|
||||
|
||||
Ref<StyleBoxEmpty> style_empty = make_empty_stylebox(default_margin_size, default_margin_size, default_margin_size, default_margin_size);
|
||||
|
||||
// Tabs
|
||||
Ref<StyleBoxFlat> style_tab_selected = style_default->duplicate();
|
||||
style_tab_selected->set_default_margin(MARGIN_LEFT, 10 * EDSCALE);
|
||||
style_tab_selected->set_default_margin(MARGIN_RIGHT, 10 * EDSCALE);
|
||||
style_tab_selected->set_bg_color(tab_color);
|
||||
|
||||
Ref<StyleBoxEmpty> style_tab_unselected = style_empty->duplicate();
|
||||
style_tab_unselected->set_default_margin(MARGIN_LEFT, 10 * EDSCALE);
|
||||
style_tab_unselected->set_default_margin(MARGIN_RIGHT, 10 * EDSCALE);
|
||||
|
||||
// Editor background
|
||||
theme->set_stylebox("Background", "EditorStyles", make_flat_stylebox(dark_color_2, 4, 4, 4, 4));
|
||||
theme->set_stylebox("Background", "EditorStyles", make_flat_stylebox(background_color, default_margin_size, default_margin_size, default_margin_size, default_margin_size));
|
||||
|
||||
// Focus
|
||||
Ref<StyleBoxFlat> focus_sbt = make_flat_stylebox(contrast_color_1, 4, 4, 4, 4);
|
||||
focus_sbt->set_draw_center(false);
|
||||
focus_sbt->set_border_width_all(1 * EDSCALE);
|
||||
focus_sbt = change_border_color(focus_sbt, contrast_color_2);
|
||||
theme->set_stylebox("Focus", "EditorStyles", focus_sbt);
|
||||
Ref<StyleBoxFlat> style_focus = style_default->duplicate();
|
||||
style_focus->set_draw_center(false);
|
||||
style_focus->set_border_color_all(contrast_color_2);
|
||||
theme->set_stylebox("Focus", "EditorStyles", style_focus);
|
||||
|
||||
// Menu
|
||||
Ref<StyleBoxEmpty> style_menu = make_empty_stylebox(4, 4, 4, 4);
|
||||
Ref<StyleBoxEmpty> style_menu = style_empty;
|
||||
theme->set_stylebox("panel", "PanelContainer", style_menu);
|
||||
theme->set_stylebox("MenuPanel", "EditorStyles", style_menu);
|
||||
|
||||
@ -300,15 +386,18 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_stylebox("ScriptEditor", "EditorStyles", make_empty_stylebox(0, 0, 0, 0));
|
||||
|
||||
// Play button group
|
||||
theme->set_stylebox("PlayButtonPanel", "EditorStyles", make_empty_stylebox(8, 4, 8, 4)); //make_stylebox(theme->get_icon("GuiPlayButtonGroup", "EditorIcons"), 16, 16, 16, 16, 8, 4, 8, 4));
|
||||
theme->set_stylebox("PlayButtonPanel", "EditorStyles", style_empty); //make_stylebox(theme->get_icon("GuiPlayButtonGroup", "EditorIcons"), 16, 16, 16, 16, 8, 4, 8, 4));
|
||||
|
||||
//MenuButton
|
||||
Ref<StyleBoxFlat> style_menu_hover_border = make_flat_stylebox(highlight_color, 4, 4, 4, 4);
|
||||
Ref<StyleBoxFlat> style_menu_hover_bg = make_flat_stylebox(dark_color_2, 4, 4, 4, 4);
|
||||
|
||||
Ref<StyleBoxFlat> style_menu_hover_border = style_default->duplicate();
|
||||
style_menu_hover_border->set_draw_center(false);
|
||||
style_menu_hover_border->set_border_width(MARGIN_BOTTOM, 2 * EDSCALE);
|
||||
style_menu_hover_border->set_border_color_all(highlight_color);
|
||||
style_menu_hover_border->set_border_width_all(0);
|
||||
style_menu_hover_border->set_border_width(MARGIN_BOTTOM, border_width * EDSCALE);
|
||||
style_menu_hover_border->set_border_color_all(accent_color);
|
||||
|
||||
Ref<StyleBoxFlat> style_menu_hover_bg = style_default->duplicate();
|
||||
style_menu_hover_bg->set_border_width_all(0);
|
||||
style_menu_hover_bg->set_bg_color(dark_color_1);
|
||||
|
||||
theme->set_stylebox("normal", "MenuButton", style_menu);
|
||||
theme->set_stylebox("hover", "MenuButton", style_menu);
|
||||
@ -329,72 +418,66 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_stylebox("disabled", "ToolButton", style_menu);
|
||||
|
||||
theme->set_color("font_color", "MenuButton", font_color);
|
||||
theme->set_color("font_color_hover", "MenuButton", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("font_color_hover", "MenuButton", font_color_hl);
|
||||
theme->set_color("font_color", "ToolButton", font_color);
|
||||
theme->set_color("font_color_hover", "ToolButton", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("font_color_pressed", "ToolButton", highlight_color);
|
||||
theme->set_color("font_color_hover", "ToolButton", font_color_hl);
|
||||
theme->set_color("font_color_pressed", "ToolButton", accent_color);
|
||||
|
||||
theme->set_stylebox("MenuHover", "EditorStyles", style_menu_hover_border);
|
||||
|
||||
// Content of each tab
|
||||
Ref<StyleBoxFlat> style_content_panel = make_flat_stylebox(base_color, 4, 4, 4, 4);
|
||||
Ref<StyleBoxFlat> style_content_panel = style_default->duplicate();
|
||||
style_content_panel->set_border_color_all(base_color);
|
||||
style_content_panel->set_border_width_all(border_width);
|
||||
Ref<StyleBoxFlat> style_content_panel_vp = make_flat_stylebox(base_color, border_width, 4, border_width, border_width);
|
||||
style_content_panel_vp->set_border_color_all(base_color);
|
||||
style_content_panel_vp->set_border_width_all(border_width);
|
||||
|
||||
// this is the stylebox used in 3d and 2d viewports (no borders)
|
||||
Ref<StyleBoxFlat> style_content_panel_vp = style_content_panel->duplicate();
|
||||
style_content_panel_vp->set_default_margin(MARGIN_LEFT, border_width);
|
||||
style_content_panel_vp->set_default_margin(MARGIN_TOP, default_margin_size);
|
||||
style_content_panel_vp->set_default_margin(MARGIN_LEFT, border_width);
|
||||
style_content_panel_vp->set_default_margin(MARGIN_BOTTOM, border_width);
|
||||
theme->set_stylebox("panel", "TabContainer", style_content_panel);
|
||||
theme->set_stylebox("Content", "EditorStyles", style_content_panel_vp);
|
||||
|
||||
Ref<StyleBoxFlat> style_button_type = make_flat_stylebox(dark_color_1, 6, 4, 6, 4);
|
||||
style_button_type->set_draw_center(true);
|
||||
style_button_type->set_border_width_all(border_width);
|
||||
style_button_type->set_border_color_all(contrast_color_2);
|
||||
// Buttons
|
||||
theme->set_stylebox("normal", "Button", style_widget);
|
||||
theme->set_stylebox("hover", "Button", style_widget_hover);
|
||||
theme->set_stylebox("pressed", "Button", style_widget_pressed);
|
||||
theme->set_stylebox("focus", "Button", style_widget_focus);
|
||||
theme->set_stylebox("disabled", "Button", style_widget_disabled);
|
||||
|
||||
Ref<StyleBoxFlat> style_button_type_disabled = change_border_color(style_button_type, contrast_color_1);
|
||||
|
||||
Color button_font_color = contrast_color_1.linear_interpolate(font_color, .6);
|
||||
|
||||
// Button
|
||||
theme->set_stylebox("normal", "Button", style_button_type);
|
||||
theme->set_stylebox("hover", "Button", change_border_color(style_button_type, HIGHLIGHT_COLOR_FONT));
|
||||
theme->set_stylebox("pressed", "Button", change_border_color(style_button_type, highlight_color));
|
||||
theme->set_stylebox("focus", "Button", change_border_color(style_button_type, highlight_color));
|
||||
theme->set_stylebox("disabled", "Button", style_button_type_disabled);
|
||||
|
||||
theme->set_color("font_color", "Button", button_font_color);
|
||||
theme->set_color("font_color_hover", "Button", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("font_color_pressed", "Button", highlight_color);
|
||||
theme->set_color("font_color", "Button", font_color);
|
||||
theme->set_color("font_color_hover", "Button", font_color_hl);
|
||||
theme->set_color("font_color_pressed", "Button", accent_color);
|
||||
theme->set_color("font_color_disabled", "Button", font_color_disabled);
|
||||
theme->set_color("icon_color_hover", "Button", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("icon_color_hover", "Button", font_color_hl);
|
||||
// make icon color value bigger because icon image is not complete white
|
||||
theme->set_color("icon_color_pressed", "Button", Color(highlight_color.r * 1.15, highlight_color.g * 1.15, highlight_color.b * 1.15, highlight_color.a));
|
||||
theme->set_color("icon_color_pressed", "Button", Color(accent_color.r * 1.15, accent_color.g * 1.15, accent_color.b * 1.15, accent_color.a));
|
||||
|
||||
// OptionButton
|
||||
theme->set_stylebox("normal", "OptionButton", style_button_type);
|
||||
theme->set_stylebox("hover", "OptionButton", change_border_color(style_button_type, contrast_color_1));
|
||||
theme->set_stylebox("pressed", "OptionButton", change_border_color(style_button_type, HIGHLIGHT_COLOR_FONT));
|
||||
theme->set_stylebox("focus", "OptionButton", change_border_color(style_button_type, highlight_color));
|
||||
theme->set_stylebox("disabled", "OptionButton", style_button_type_disabled);
|
||||
theme->set_stylebox("normal", "OptionButton", style_widget);
|
||||
theme->set_stylebox("hover", "OptionButton", style_widget_hover);
|
||||
theme->set_stylebox("pressed", "OptionButton", style_widget_pressed);
|
||||
theme->set_stylebox("focus", "OptionButton", style_widget_focus);
|
||||
theme->set_stylebox("disabled", "OptionButton", style_widget_disabled);
|
||||
|
||||
theme->set_color("font_color", "OptionButton", button_font_color);
|
||||
theme->set_color("font_color_hover", "OptionButton", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("font_color_pressed", "OptionButton", highlight_color);
|
||||
theme->set_color("font_color", "OptionButton", font_color);
|
||||
theme->set_color("font_color_hover", "OptionButton", font_color_hl);
|
||||
theme->set_color("font_color_pressed", "OptionButton", accent_color);
|
||||
theme->set_color("font_color_disabled", "OptionButton", font_color_disabled);
|
||||
theme->set_color("icon_color_hover", "OptionButton", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("icon_color_hover", "OptionButton", font_color_hl);
|
||||
theme->set_icon("arrow", "OptionButton", theme->get_icon("GuiOptionArrow", "EditorIcons"));
|
||||
theme->set_constant("arrow_margin", "OptionButton", 4);
|
||||
theme->set_constant("arrow_margin", "OptionButton", 4 * EDSCALE);
|
||||
theme->set_constant("modulate_arrow", "OptionButton", true);
|
||||
|
||||
// CheckButton
|
||||
theme->set_icon("on", "CheckButton", theme->get_icon("GuiToggleOn", "EditorIcons"));
|
||||
theme->set_icon("off", "CheckButton", theme->get_icon("GuiToggleOff", "EditorIcons"));
|
||||
|
||||
theme->set_color("font_color", "CheckButton", button_font_color);
|
||||
theme->set_color("font_color_hover", "CheckButton", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("font_color_pressed", "CheckButton", highlight_color);
|
||||
theme->set_color("font_color", "CheckButton", font_color);
|
||||
theme->set_color("font_color_hover", "CheckButton", font_color_hl);
|
||||
theme->set_color("font_color_pressed", "CheckButton", accent_color);
|
||||
theme->set_color("font_color_disabled", "CheckButton", font_color_disabled);
|
||||
theme->set_color("icon_color_hover", "CheckButton", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("icon_color_hover", "CheckButton", font_color_hl);
|
||||
|
||||
// Checkbox
|
||||
theme->set_icon("checked", "CheckBox", theme->get_icon("GuiChecked", "EditorIcons"));
|
||||
@ -402,21 +485,19 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_icon("radio_checked", "CheckBox", theme->get_icon("GuiRadioChecked", "EditorIcons"));
|
||||
theme->set_icon("radio_unchecked", "CheckBox", theme->get_icon("GuiRadioUnchecked", "EditorIcons"));
|
||||
|
||||
theme->set_color("font_color", "CheckBox", button_font_color);
|
||||
theme->set_color("font_color_hover", "CheckBox", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("font_color_pressed", "CheckBox", highlight_color);
|
||||
theme->set_color("font_color", "CheckBox", font_color);
|
||||
theme->set_color("font_color_hover", "CheckBox", font_color_hl);
|
||||
theme->set_color("font_color_pressed", "CheckBox", accent_color);
|
||||
theme->set_color("font_color_disabled", "CheckBox", font_color_disabled);
|
||||
theme->set_color("icon_color_hover", "CheckBox", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("icon_color_hover", "CheckBox", font_color_hl);
|
||||
|
||||
// PopupMenu
|
||||
Ref<StyleBoxFlat> style_popup_menu = make_flat_stylebox(dark_color_1, 8, 8, 8, 8);
|
||||
style_popup_menu->set_border_width_all(MAX(EDSCALE, border_width));
|
||||
style_popup_menu->set_border_color_all(contrast_color_1);
|
||||
Ref<StyleBoxFlat> style_popup_menu = style_popup;
|
||||
theme->set_stylebox("panel", "PopupMenu", style_popup_menu);
|
||||
theme->set_stylebox("separator", "PopupMenu", make_line_stylebox(separator_color, MAX(EDSCALE, border_width), 8 - MAX(EDSCALE, border_width)));
|
||||
theme->set_color("font_color", "PopupMenu", font_color);
|
||||
theme->set_color("font_color_hover", "PopupMenu", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_color("font_color_accel", "PopupMenu", font_color);
|
||||
theme->set_color("font_color_hover", "PopupMenu", font_color_hl);
|
||||
theme->set_color("font_color_accel", "PopupMenu", font_color_disabled);
|
||||
theme->set_color("font_color_disabled", "PopupMenu", font_color_disabled);
|
||||
theme->set_icon("checked", "PopupMenu", theme->get_icon("GuiChecked", "EditorIcons"));
|
||||
theme->set_icon("unchecked", "PopupMenu", theme->get_icon("GuiUnchecked", "EditorIcons"));
|
||||
@ -424,8 +505,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_icon("radio_unchecked", "PopupMenu", theme->get_icon("GuiUnchecked", "EditorIcons"));
|
||||
|
||||
// Tree & ItemList background
|
||||
Ref<StyleBoxFlat> style_tree_bg = make_flat_stylebox(dark_color_1, 2, 4, 2, 4);
|
||||
style_tree_bg->set_border_width_all(border_width);
|
||||
Ref<StyleBoxFlat> style_tree_bg = style_default->duplicate();
|
||||
style_tree_bg->set_bg_color(dark_color_1);
|
||||
style_tree_bg->set_border_color_all(dark_color_3);
|
||||
theme->set_stylebox("bg", "Tree", style_tree_bg);
|
||||
|
||||
@ -435,78 +516,84 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_icon("arrow", "Tree", theme->get_icon("GuiTreeArrowDown", "EditorIcons"));
|
||||
theme->set_icon("arrow_collapsed", "Tree", theme->get_icon("GuiTreeArrowRight", "EditorIcons"));
|
||||
theme->set_icon("select_arrow", "Tree", theme->get_icon("GuiDropdown", "EditorIcons"));
|
||||
theme->set_stylebox("bg_focus", "Tree", focus_sbt);
|
||||
theme->set_stylebox("bg_focus", "Tree", style_focus);
|
||||
theme->set_stylebox("custom_button", "Tree", make_empty_stylebox());
|
||||
theme->set_stylebox("custom_button_pressed", "Tree", make_empty_stylebox());
|
||||
theme->set_stylebox("custom_button_hover", "Tree", style_button_type);
|
||||
theme->set_color("custom_button_font_highlight", "Tree", HIGHLIGHT_COLOR_FONT);
|
||||
theme->set_stylebox("custom_button_hover", "Tree", style_widget);
|
||||
theme->set_color("custom_button_font_highlight", "Tree", font_color_hl);
|
||||
theme->set_color("font_color", "Tree", font_color);
|
||||
theme->set_color("font_color_selected", "Tree", font_color);
|
||||
|
||||
Ref<StyleBox> style_tree_btn = make_flat_stylebox(contrast_color_1, 2, 4, 2, 4);
|
||||
Ref<StyleBoxFlat> style_tree_btn = style_default->duplicate();
|
||||
style_tree_btn->set_bg_color(contrast_color_1);
|
||||
style_tree_btn->set_border_width_all(0);
|
||||
theme->set_stylebox("button_pressed", "Tree", style_tree_btn);
|
||||
|
||||
Ref<StyleBoxFlat> style_tree_focus = make_flat_stylebox(HIGHLIGHT_COLOR_BG, 2, 2, 2, 2);
|
||||
Ref<StyleBoxFlat> style_tree_focus = style_default->duplicate();
|
||||
style_tree_focus->set_bg_color(highlight_color);
|
||||
style_tree_focus->set_border_width_all(0);
|
||||
theme->set_stylebox("selected_focus", "Tree", style_tree_focus);
|
||||
|
||||
Ref<StyleBoxFlat> style_tree_selected = make_flat_stylebox(HIGHLIGHT_COLOR_BG, 2, 2, 2, 2);
|
||||
Ref<StyleBoxFlat> style_tree_selected = style_tree_focus->duplicate();
|
||||
theme->set_stylebox("selected", "Tree", style_tree_selected);
|
||||
|
||||
Ref<StyleBoxFlat> style_tree_cursor = make_flat_stylebox(HIGHLIGHT_COLOR_BG, 4, 4, 4, 4);
|
||||
Ref<StyleBoxFlat> style_tree_cursor = style_default->duplicate();
|
||||
style_tree_cursor->set_draw_center(false);
|
||||
style_tree_cursor->set_border_width_all(border_width);
|
||||
style_tree_cursor->set_border_color_all(contrast_color_1);
|
||||
|
||||
Ref<StyleBoxFlat> style_tree_title = make_flat_stylebox(dark_color_3, 4, 4, 4, 4);
|
||||
Ref<StyleBoxFlat> style_tree_title = style_default->duplicate();
|
||||
style_tree_title->set_bg_color(dark_color_3);
|
||||
style_tree_title->set_border_width_all(0);
|
||||
theme->set_stylebox("cursor", "Tree", style_tree_cursor);
|
||||
theme->set_stylebox("cursor_unfocused", "Tree", style_tree_cursor);
|
||||
theme->set_stylebox("title_button_normal", "Tree", style_tree_title);
|
||||
theme->set_stylebox("title_button_hover", "Tree", style_tree_title);
|
||||
theme->set_stylebox("title_button_pressed", "Tree", style_tree_title);
|
||||
|
||||
Color prop_category_color = dark_theme ? dark_color_1.linear_interpolate(Color(1, 1, 1, 1), 0.12) : dark_color_1.linear_interpolate(Color(0, 0, 0, 1), 0.2);
|
||||
Color prop_section_color = dark_theme ? dark_color_1.linear_interpolate(Color(1, 1, 1, 1), 0.09) : dark_color_1.linear_interpolate(Color(0, 1, 0, 1), 0.1);
|
||||
Color prop_subsection_color = dark_theme ? dark_color_1.linear_interpolate(Color(1, 1, 1, 1), 0.06) : dark_color_1.linear_interpolate(Color(0, 0, 0, 1), 0.1);
|
||||
// Color prop_category_color = dark_color_1.linear_interpolate(mono_color, 0.12) : dark_color_1.linear_interpolate(Color(0, 0, 0, 1), 0.2);
|
||||
// Color prop_section_color = dark_color_1.linear_interpolate(mono_color, 0.09) : dark_color_1.linear_interpolate(Color(0, 1, 0, 1), 0.1);
|
||||
// Color prop_subsection_color = dark_color_1.linear_interpolate(mono_color, 0.06) : dark_color_1.linear_interpolate(Color(0, 0, 0, 1), 0.1);
|
||||
Color prop_category_color = dark_color_1.linear_interpolate(mono_color, 0.12);
|
||||
Color prop_section_color = dark_color_1.linear_interpolate(mono_color, 0.09);
|
||||
Color prop_subsection_color = dark_color_1.linear_interpolate(mono_color, 0.06);
|
||||
theme->set_color("prop_category", "Editor", prop_category_color);
|
||||
theme->set_color("prop_section", "Editor", prop_section_color);
|
||||
theme->set_color("prop_subsection", "Editor", prop_subsection_color);
|
||||
theme->set_color("drop_position_color", "Tree", highlight_color);
|
||||
theme->set_color("drop_position_color", "Tree", accent_color);
|
||||
|
||||
// ItemList
|
||||
Ref<StyleBoxFlat> style_itemlist_bg = make_flat_stylebox(dark_color_1, 4, 4, 4, 4);
|
||||
Ref<StyleBoxFlat> style_itemlist_bg = style_default->duplicate();
|
||||
style_itemlist_bg->set_bg_color(dark_color_1);
|
||||
style_itemlist_bg->set_border_width_all(border_width);
|
||||
style_itemlist_bg->set_border_color_all(dark_color_3);
|
||||
|
||||
Ref<StyleBoxFlat> style_itemlist_cursor = make_flat_stylebox(highlight_color, 0, 0, 0, 0);
|
||||
Ref<StyleBoxFlat> style_itemlist_cursor = style_default->duplicate();
|
||||
style_itemlist_cursor->set_draw_center(false);
|
||||
style_itemlist_cursor->set_border_width_all(border_width);
|
||||
style_itemlist_cursor->set_border_color_all(HIGHLIGHT_COLOR_BG);
|
||||
style_itemlist_cursor->set_border_color_all(highlight_color);
|
||||
theme->set_stylebox("cursor", "ItemList", style_itemlist_cursor);
|
||||
theme->set_stylebox("cursor_unfocused", "ItemList", style_itemlist_cursor);
|
||||
theme->set_stylebox("selected_focus", "ItemList", style_tree_focus);
|
||||
theme->set_stylebox("selected", "ItemList", style_tree_selected);
|
||||
theme->set_stylebox("bg_focus", "ItemList", focus_sbt);
|
||||
theme->set_stylebox("bg_focus", "ItemList", style_focus);
|
||||
theme->set_stylebox("bg", "ItemList", style_itemlist_bg);
|
||||
theme->set_constant("vseparation", "ItemList", 5 * EDSCALE);
|
||||
theme->set_color("font_color", "ItemList", font_color);
|
||||
|
||||
Ref<StyleBoxFlat> style_tab_fg = make_flat_stylebox(tab_color, 15, 5, 15, 5);
|
||||
Ref<StyleBoxFlat> style_tab_bg = make_flat_stylebox(tab_color, 15, 5, 15, 5);
|
||||
style_tab_bg->set_draw_center(false);
|
||||
|
||||
// Tabs & TabContainer
|
||||
theme->set_stylebox("tab_fg", "TabContainer", style_tab_fg);
|
||||
theme->set_stylebox("tab_bg", "TabContainer", style_tab_bg);
|
||||
theme->set_stylebox("tab_fg", "Tabs", style_tab_fg);
|
||||
theme->set_stylebox("tab_bg", "Tabs", style_tab_bg);
|
||||
theme->set_stylebox("tab_fg", "TabContainer", style_tab_selected);
|
||||
theme->set_stylebox("tab_bg", "TabContainer", style_tab_unselected);
|
||||
theme->set_stylebox("tab_fg", "Tabs", style_tab_selected);
|
||||
theme->set_stylebox("tab_bg", "Tabs", style_tab_unselected);
|
||||
theme->set_color("font_color_fg", "TabContainer", font_color);
|
||||
theme->set_color("font_color_bg", "TabContainer", font_color_disabled);
|
||||
theme->set_color("font_color_fg", "Tabs", font_color);
|
||||
theme->set_color("font_color_bg", "Tabs", font_color_disabled);
|
||||
theme->set_icon("menu", "TabContainer", theme->get_icon("GuiTabMenu", "EditorIcons"));
|
||||
theme->set_icon("menu_hl", "TabContainer", theme->get_icon("GuiTabMenu", "EditorIcons"));
|
||||
theme->set_stylebox("SceneTabFG", "EditorStyles", make_flat_stylebox(base_color, 10, 5, 10, 5));
|
||||
theme->set_stylebox("SceneTabBG", "EditorStyles", make_empty_stylebox(6, 5, 6, 5));
|
||||
theme->set_stylebox("SceneTabFG", "EditorStyles", style_tab_selected);
|
||||
theme->set_stylebox("SceneTabBG", "EditorStyles", style_tab_unselected);
|
||||
theme->set_icon("close", "Tabs", theme->get_icon("GuiClose", "EditorIcons"));
|
||||
theme->set_stylebox("button_pressed", "Tabs", style_menu);
|
||||
theme->set_stylebox("button", "Tabs", style_menu);
|
||||
@ -516,39 +603,26 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_stylebox("separator", "VSeparator", make_line_stylebox(separator_color, border_width, 0, true));
|
||||
|
||||
// Debugger
|
||||
Ref<StyleBoxFlat> style_panel_debugger = make_flat_stylebox(dark_color_2, 4, 4, 4, 4);
|
||||
Ref<StyleBoxFlat> style_panel_debugger = style_default->duplicate();
|
||||
theme->set_stylebox("DebuggerPanel", "EditorStyles", style_panel_debugger);
|
||||
|
||||
Ref<StyleBoxFlat> style_tab_fg_debugger = make_flat_stylebox(dark_color_2, 10, 5, 10, 5);
|
||||
Ref<StyleBoxFlat> style_tab_bg_debugger = make_flat_stylebox(dark_color_2, 10, 5, 10, 5);
|
||||
style_tab_bg_debugger->set_draw_center(false);
|
||||
Ref<StyleBoxFlat> style_tab_fg_debugger = style_tab_selected->duplicate();
|
||||
style_tab_fg_debugger->set_border_width_all(0);
|
||||
|
||||
theme->set_stylebox("DebuggerTabFG", "EditorStyles", style_tab_fg_debugger);
|
||||
theme->set_stylebox("DebuggerTabBG", "EditorStyles", style_tab_bg_debugger);
|
||||
theme->set_stylebox("DebuggerTabBG", "EditorStyles", style_tab_unselected);
|
||||
|
||||
// LineEdit
|
||||
Ref<StyleBoxFlat> style_line_edit = make_flat_stylebox(dark_color_1, 6, 4, 6, 4);
|
||||
style_line_edit->set_border_width_all(border_width);
|
||||
style_line_edit = change_border_color(style_line_edit, contrast_color_1);
|
||||
Ref<StyleBoxFlat> style_line_edit_disabled = change_border_color(style_line_edit, dark_color_1);
|
||||
style_line_edit_disabled->set_bg_color(Color(0, 0, 0, .1));
|
||||
Ref<StyleBoxFlat> style_line_edit_focus = change_border_color(style_line_edit, highlight_color);
|
||||
theme->set_stylebox("normal", "LineEdit", style_line_edit);
|
||||
theme->set_stylebox("focus", "LineEdit", style_line_edit_focus);
|
||||
theme->set_stylebox("read_only", "LineEdit", style_line_edit_disabled);
|
||||
theme->set_stylebox("normal", "LineEdit", style_widget);
|
||||
theme->set_stylebox("focus", "LineEdit", style_widget_focus);
|
||||
theme->set_stylebox("read_only", "LineEdit", style_widget_disabled);
|
||||
theme->set_color("read_only", "LineEdit", font_color_disabled);
|
||||
theme->set_color("font_color", "LineEdit", font_color);
|
||||
theme->set_color("cursor_color", "LineEdit", font_color);
|
||||
|
||||
// TextEdit
|
||||
Ref<StyleBoxFlat> style_textedit_normal(memnew(StyleBoxFlat));
|
||||
style_textedit_normal->set_bg_color(dark_color_2);
|
||||
style_textedit_normal->set_default_margin(MARGIN_LEFT, 0);
|
||||
style_textedit_normal->set_default_margin(MARGIN_RIGHT, 0);
|
||||
style_textedit_normal->set_default_margin(MARGIN_BOTTOM, 0);
|
||||
style_textedit_normal->set_default_margin(MARGIN_TOP, 0);
|
||||
theme->set_stylebox("normal", "TextEdit", style_textedit_normal);
|
||||
theme->set_stylebox("focus", "TextEdit", focus_sbt);
|
||||
theme->set_stylebox("normal", "TextEdit", style_widget);
|
||||
theme->set_stylebox("focus", "TextEdit", style_widget_hover);
|
||||
theme->set_constant("side_margin", "TabContainer", 0);
|
||||
|
||||
// H/VSplitContainer
|
||||
@ -558,13 +632,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_icon("grabber", "VSplitContainer", theme->get_icon("GuiVsplitter", "EditorIcons"));
|
||||
theme->set_icon("grabber", "HSplitContainer", theme->get_icon("GuiHsplitter", "EditorIcons"));
|
||||
|
||||
theme->set_constant("separation", "HSplitContainer", 8 * EDSCALE);
|
||||
theme->set_constant("separation", "VSplitContainer", 8 * EDSCALE);
|
||||
theme->set_constant("separation", "HSplitContainer", default_margin_size * 2 * EDSCALE);
|
||||
theme->set_constant("separation", "VSplitContainer", default_margin_size * 2 * EDSCALE);
|
||||
|
||||
// WindowDialog
|
||||
Ref<StyleBoxFlat> style_window = make_flat_stylebox(dark_color_2, 4, 4, 4, 4);
|
||||
style_window->set_border_width_all(MAX(EDSCALE, border_width));
|
||||
style_window->set_border_color_all(base_color);
|
||||
Ref<StyleBoxFlat> style_window = style_popup->duplicate();
|
||||
style_window->set_border_color_all(tab_color);
|
||||
style_window->set_border_width(MARGIN_TOP, 24 * EDSCALE);
|
||||
style_window->set_expand_margin_size(MARGIN_TOP, 24 * EDSCALE);
|
||||
theme->set_stylebox("panel", "WindowDialog", style_window);
|
||||
@ -575,6 +648,14 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_constant("close_v_ofs", "WindowDialog", 20 * EDSCALE);
|
||||
theme->set_constant("title_height", "WindowDialog", 24 * EDSCALE);
|
||||
|
||||
// complex window, for now only Editor settings and Project settings
|
||||
Ref<StyleBoxFlat> style_complex_window = style_window->duplicate();
|
||||
style_complex_window->set_bg_color(dark_color_2);
|
||||
style_complex_window->set_border_color_all(highlight_tabs ? tab_color : dark_color_2);
|
||||
theme->set_stylebox("panel", "EditorSettingsDialog", style_complex_window);
|
||||
theme->set_stylebox("panel", "ProjectSettingsEditor", style_complex_window);
|
||||
theme->set_stylebox("panel", "EditorAbout", style_complex_window);
|
||||
|
||||
// HScrollBar
|
||||
Ref<Texture> empty_icon = memnew(ImageTexture);
|
||||
|
||||
@ -602,12 +683,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_icon("decrement_highlight", "VScrollBar", empty_icon);
|
||||
|
||||
// HSlider
|
||||
theme->set_stylebox("slider", "HSlider", make_stylebox(theme->get_icon("GuiHsliderBg", "EditorIcons"), 4, 4, 4, 4));
|
||||
theme->set_stylebox("slider", "HSlider", make_stylebox(theme->get_icon("GuiHsliderBg", "EditorIcons"), default_margin_size, default_margin_size, default_margin_size, default_margin_size));
|
||||
theme->set_icon("grabber", "HSlider", theme->get_icon("GuiSliderGrabber", "EditorIcons"));
|
||||
theme->set_icon("grabber_highlight", "HSlider", theme->get_icon("GuiSliderGrabberHl", "EditorIcons"));
|
||||
|
||||
// VSlider
|
||||
theme->set_stylebox("slider", "VSlider", make_stylebox(theme->get_icon("GuiVsliderBg", "EditorIcons"), 4, 4, 4, 4));
|
||||
theme->set_stylebox("slider", "VSlider", make_stylebox(theme->get_icon("GuiVsliderBg", "EditorIcons"), default_margin_size, default_margin_size, default_margin_size, default_margin_size));
|
||||
theme->set_icon("grabber", "VSlider", theme->get_icon("GuiSliderGrabber", "EditorIcons"));
|
||||
theme->set_icon("grabber_highlight", "VSlider", theme->get_icon("GuiSliderGrabberHl", "EditorIcons"));
|
||||
|
||||
@ -616,7 +697,13 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
Color rtl_font_color = (rtl_combined_bg_color.r + rtl_combined_bg_color.g + rtl_combined_bg_color.b > 0.5 * 3) ? Color(0, 0, 0) : Color(1, 1, 1);
|
||||
theme->set_color("default_color", "RichTextLabel", rtl_font_color);
|
||||
theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox());
|
||||
theme->set_stylebox("normal", "RichTextLabel", make_flat_stylebox(script_bg_color, 6, 6, 6, 6));
|
||||
theme->set_stylebox("normal", "RichTextLabel", style_tree_bg);
|
||||
Ref<StyleBoxFlat> style_code = style_tree_bg->duplicate();
|
||||
style_code->set_bg_color(rtl_combined_bg_color);
|
||||
theme->set_stylebox("code_normal", "RichTextLabel", style_code);
|
||||
Ref<StyleBoxFlat> style_code_focus = style_tree_focus->duplicate();
|
||||
style_code_focus->set_bg_color(rtl_combined_bg_color);
|
||||
theme->set_stylebox("code_focus", "RichTextLabel", style_code_focus);
|
||||
|
||||
// Panel
|
||||
theme->set_stylebox("panel", "Panel", make_flat_stylebox(dark_color_1, 6, 4, 6, 4));
|
||||
@ -625,18 +712,15 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_color("font_color", "Label", font_color);
|
||||
|
||||
// TooltipPanel
|
||||
Ref<StyleBoxFlat> style_tooltip = make_flat_stylebox(Color(1, 1, 1, 0.8), 8, 8, 8, 8);
|
||||
Ref<StyleBoxFlat> style_tooltip = style_popup->duplicate();
|
||||
style_tooltip->set_bg_color(Color(mono_color.r, mono_color.g, mono_color.b, 0.9));
|
||||
style_tooltip->set_border_width_all(border_width);
|
||||
style_tooltip->set_border_color_all(HIGHLIGHT_COLOR_FONT);
|
||||
style_tooltip->set_border_color_all(mono_color);
|
||||
theme->set_color("font_color", "TooltipPanel", font_color);
|
||||
theme->set_stylebox("panel", "TooltipPanel", style_tooltip);
|
||||
|
||||
// PopupPanel
|
||||
Ref<StyleBoxFlat> style_dock_select = make_flat_stylebox(base_color);
|
||||
style_dock_select->set_border_color_all(contrast_color_1);
|
||||
style_dock_select->set_expand_margin_size_all(2);
|
||||
style_dock_select->set_border_width_all(2);
|
||||
theme->set_stylebox("panel", "PopupPanel", style_dock_select);
|
||||
theme->set_stylebox("panel", "PopupPanel", style_popup);
|
||||
|
||||
// SpinBox
|
||||
theme->set_icon("updown", "SpinBox", theme->get_icon("GuiSpinboxUpdown", "EditorIcons"));
|
||||
@ -647,21 +731,24 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_color("font_color", "ProgressBar", font_color);
|
||||
|
||||
// GraphEdit
|
||||
theme->set_stylebox("bg", "GraphEdit", make_flat_stylebox(dark_color_2, 4, 4, 4, 4));
|
||||
theme->set_color("grid_major", "GraphEdit", Color(font_color.r, font_color.g, font_color.b, 0.2));
|
||||
theme->set_color("grid_minor", "GraphEdit", Color(font_color_disabled.r, font_color_disabled.g, font_color_disabled.b, 0.2));
|
||||
theme->set_stylebox("bg", "GraphEdit", style_tree_bg);
|
||||
theme->set_color("grid_major", "GraphEdit", Color(font_color.r, font_color.g, font_color.b, 0.1));
|
||||
theme->set_color("grid_minor", "GraphEdit", Color(font_color_disabled.r, font_color_disabled.g, font_color_disabled.b, 0.05));
|
||||
theme->set_icon("minus", "GraphEdit", theme->get_icon("ZoomLess", "EditorIcons"));
|
||||
theme->set_icon("more", "GraphEdit", theme->get_icon("ZoomMore", "EditorIcons"));
|
||||
theme->set_icon("reset", "GraphEdit", theme->get_icon("ZoomReset", "EditorIcons"));
|
||||
|
||||
// GraphNode
|
||||
|
||||
Ref<StyleBoxFlat> graphsb = make_flat_stylebox(Color(0, 0, 0, 0.3), 16, 24, 16, 5);
|
||||
graphsb->set_border_width_all(border_width);
|
||||
graphsb->set_border_color_all(Color(1, 1, 1, 0.6));
|
||||
graphsb->set_border_width(MARGIN_TOP, 22 * EDSCALE + border_width);
|
||||
Ref<StyleBoxFlat> graphsbselected = make_flat_stylebox(Color(0, 0, 0, 0.4), 16, 24, 16, 5);
|
||||
graphsbselected->set_border_width_all(border_width);
|
||||
graphsbselected->set_border_color_all(Color(1, 1, 1, 0.9));
|
||||
graphsbselected->set_border_color_all(Color(accent_color.r, accent_color.g, accent_color.b, 0.9));
|
||||
graphsbselected->set_shadow_size(8 * EDSCALE);
|
||||
graphsbselected->set_shadow_color(shadow_color);
|
||||
graphsbselected->set_border_width(MARGIN_TOP, 22 * EDSCALE + border_width);
|
||||
Ref<StyleBoxFlat> graphsbcomment = make_flat_stylebox(Color(0, 0, 0, 0.3), 16, 24, 16, 5);
|
||||
graphsbcomment->set_border_width_all(border_width);
|
||||
@ -677,9 +764,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
||||
theme->set_stylebox("commentfocus", "GraphNode", graphsbcommentselected);
|
||||
|
||||
// FileDialog
|
||||
Color disable_color = contrast_color_2;
|
||||
disable_color.a = 0.7;
|
||||
theme->set_color("files_disabled", "FileDialog", disable_color);
|
||||
theme->set_color("files_disabled", "FileDialog", font_color_disabled);
|
||||
|
||||
return theme;
|
||||
}
|
||||
|
@ -215,9 +215,6 @@ void FileSystemDock::_notification(int p_what) {
|
||||
button_hist_next->set_icon(get_icon("Forward", "EditorIcons"));
|
||||
button_hist_prev->set_icon(get_icon("Back", "EditorIcons"));
|
||||
|
||||
Theme::get_default()->clear_icon("ResizedFolder", "EditorIcons");
|
||||
Theme::get_default()->clear_icon("ResizedFile", "EditorIcons");
|
||||
|
||||
if (new_mode != display_mode) {
|
||||
set_display_mode(new_mode);
|
||||
} else {
|
||||
@ -437,39 +434,15 @@ void FileSystemDock::_update_files(bool p_keep_selection) {
|
||||
files->set_max_text_lines(2);
|
||||
files->set_fixed_icon_size(Size2(thumbnail_size, thumbnail_size));
|
||||
|
||||
if (!has_icon("ResizedFolder", "EditorIcons")) {
|
||||
Ref<ImageTexture> folder = get_icon("FolderBig", "EditorIcons");
|
||||
Ref<Image> img = folder->get_data();
|
||||
img = img->duplicate();
|
||||
img->resize(thumbnail_size, thumbnail_size);
|
||||
Ref<ImageTexture> resized_folder = Ref<ImageTexture>(memnew(ImageTexture));
|
||||
resized_folder->create_from_image(img, 0);
|
||||
Theme::get_default()->set_icon("ResizedFolder", "EditorIcons", resized_folder);
|
||||
if (thumbnail_size < 64) {
|
||||
folder_thumbnail = get_icon("FolderMediumThumb", "EditorIcons");
|
||||
file_thumbnail = get_icon("FileMediumThumb", "EditorIcons");
|
||||
file_thumbnail_broken = get_icon("FileDeadMediumThumb", "EditorIcons");
|
||||
} else {
|
||||
folder_thumbnail = get_icon("FolderBigThumb", "EditorIcons");
|
||||
file_thumbnail = get_icon("FileBigThumb", "EditorIcons");
|
||||
file_thumbnail_broken = get_icon("FileDeadBigThumb", "EditorIcons");
|
||||
}
|
||||
|
||||
folder_thumbnail = get_icon("ResizedFolder", "EditorIcons");
|
||||
|
||||
if (!has_icon("ResizedFile", "EditorIcons")) {
|
||||
Ref<ImageTexture> file = get_icon("FileBig", "EditorIcons");
|
||||
Ref<Image> img = file->get_data();
|
||||
img->resize(thumbnail_size, thumbnail_size);
|
||||
Ref<ImageTexture> resized_file = Ref<ImageTexture>(memnew(ImageTexture));
|
||||
resized_file->create_from_image(img, 0);
|
||||
Theme::get_default()->set_icon("ResizedFile", "EditorIcons", resized_file);
|
||||
}
|
||||
|
||||
if (!has_icon("ResizedFileBroken", "EditorIcons")) {
|
||||
Ref<ImageTexture> file = get_icon("FileBigBroken", "EditorIcons");
|
||||
Ref<Image> img = file->get_data();
|
||||
img->resize(thumbnail_size, thumbnail_size);
|
||||
Ref<ImageTexture> resized_file = Ref<ImageTexture>(memnew(ImageTexture));
|
||||
resized_file->create_from_image(img, 0);
|
||||
Theme::get_default()->set_icon("ResizedFileBroken", "EditorIcons", resized_file);
|
||||
}
|
||||
|
||||
file_thumbnail = get_icon("ResizedFile", "EditorIcons");
|
||||
|
||||
file_thumbnail_broken = get_icon("ResizedFileBroken", "EditorIcons");
|
||||
} else {
|
||||
|
||||
files->set_icon_mode(ItemList::ICON_MODE_LEFT);
|
||||
|
@ -39,18 +39,44 @@ def make_editor_icons_action(target, source, env):
|
||||
s.write(icons_string.getvalue())
|
||||
s.write('};\n\n')
|
||||
s.write("static const char *editor_icons_names[] = {\n")
|
||||
|
||||
# this is used to store the indices of thumbnail icons
|
||||
thumb_medium_indices = [];
|
||||
thumb_big_indices = [];
|
||||
index = 0
|
||||
for f in svg_icons:
|
||||
|
||||
fname = str(f)
|
||||
|
||||
icon_name = os.path.basename(fname)[5:-4].title().replace("_", "")
|
||||
if icon_name.endswith("MediumThumb"): # dont know a better way to handle this
|
||||
thumb_medium_indices.append(str(index))
|
||||
if icon_name.endswith("BigThumb"): # dont know a better way to handle this
|
||||
thumb_big_indices.append(str(index))
|
||||
|
||||
s.write('\t"%s"' % icon_name)
|
||||
|
||||
if fname != svg_icons[-1]:
|
||||
s.write(",")
|
||||
s.write('\n')
|
||||
|
||||
index += 1
|
||||
|
||||
s.write('};\n')
|
||||
|
||||
if thumb_medium_indices:
|
||||
s.write("\n\n")
|
||||
s.write("static const int editor_md_thumbs_count = %s;\n" % len(thumb_medium_indices))
|
||||
s.write("static const int editor_md_thumbs_indices[] = {")
|
||||
s.write(", ".join(thumb_medium_indices))
|
||||
s.write("};\n")
|
||||
if thumb_big_indices:
|
||||
s.write("\n\n")
|
||||
s.write("static const int editor_bg_thumbs_count = %s;\n" % len(thumb_big_indices))
|
||||
s.write("static const int editor_bg_thumbs_indices[] = {")
|
||||
s.write(", ".join(thumb_big_indices))
|
||||
s.write("};\n")
|
||||
|
||||
s.write("#endif\n")
|
||||
|
||||
|
||||
|
7
editor/icons/icon_file.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(0 -1036.4)">
|
||||
<g transform="translate(0 -1.6949e-5)">
|
||||
<path transform="translate(0 1036.4)" d="m2 1v14h12v-9h-5v-5zm8 0v4h4z" fill="#e0e0e0"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 281 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
7
editor/icons/icon_file_dead_medium_thumb.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<svg width="32" height="32" version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(0 -1020.4)">
|
||||
<g transform="translate(0 -1.6949e-5)">
|
||||
<path transform="translate(0 1020.4)" d="m5 1c-1.6447 0-3 1.3553-3 3v24c0 1.6447 1.3553 3 3 3h22c1.6447 0 3-1.3553 3-3v-16.809c-5.1e-5 -0.2652-0.10543-0.51952-0.29297-0.70703l-9.1816-9.1895c-0.18719-0.18825-0.44155-0.29435-0.70703-0.29492h-14.818zm0 2h14v6c0 1.6447 1.3553 3 3 3h6v16c0 0.5713-0.42868 1-1 1h-22c-0.57133 0-1-0.4287-1-1v-24c0-0.5713 0.42867-1 1-1zm1.9863 11.002a1 1 0 0 0 -0.69336 0.29102 1 1 0 0 0 0 1.4141l1.293 1.293-1.293 1.293a1 1 0 0 0 0 1.4141 1 1 0 0 0 1.4141 0l1.293-1.293 1.293 1.293a1 1 0 0 0 1.4141 0 1 1 0 0 0 0 -1.4141l-1.293-1.293 1.293-1.293a1 1 0 0 0 0 -1.4141 1 1 0 0 0 -0.7207 -0.29102 1 1 0 0 0 -0.69336 0.29102l-1.293 1.293-1.293-1.293a1 1 0 0 0 -0.7207 -0.29102zm14 0a1 1 0 0 0 -0.69336 0.29102 1 1 0 0 0 0 1.4141l1.293 1.293-1.293 1.293a1 1 0 0 0 0 1.4141 1 1 0 0 0 1.4141 0l1.293-1.293 1.293 1.293a1 1 0 0 0 1.4141 0 1 1 0 0 0 0 -1.4141l-1.293-1.293 1.293-1.293a1 1 0 0 0 0 -1.4141 1 1 0 0 0 -0.7207 -0.29102 1 1 0 0 0 -0.69336 0.29102l-1.293 1.293-1.293-1.293a1 1 0 0 0 -0.7207 -0.29102zm-13.986 7.998a1 1 0 0 0 -1 1 1 1 0 0 0 1 1h1a4 4 0 0 0 2 3.4648 4 4 0 0 0 4 0 4 4 0 0 0 2 -3.4648h9a1 1 0 0 0 1 -1 1 1 0 0 0 -1 -1h-18zm3 2h4a2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#ff8484" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.9 KiB |
7
editor/icons/icon_file_medium_thumb.svg
Normal file
@ -0,0 +1,7 @@
|
||||
<svg width="32" height="32" version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(0 -1020.4)">
|
||||
<g transform="translate(0 -1.6949e-5)">
|
||||
<path transform="translate(0 1020.4)" d="m5 1c-1.6447 0-3 1.3553-3 3v24c0 1.6447 1.3553 3 3 3h22c1.6447 0 3-1.3553 3-3v-16.809c-5.1e-5 -0.2652-0.10543-0.51952-0.29297-0.70703l-9.1816-9.1895c-0.18719-0.18825-0.44155-0.29435-0.70703-0.29492zm0 2h14v6c0 1.6447 1.3553 3 3 3h6v16c0 0.5713-0.42868 1-1 1h-22c-0.57133 0-1-0.4287-1-1v-24c0-0.5713 0.42867-1 1-1z" color="#000000" color-rendering="auto" dominant-baseline="auto" fill="#fff" fill-opacity=".58824" image-rendering="auto" shape-rendering="auto" solid-color="#000000" style="font-feature-settings:normal;font-variant-alternates:normal;font-variant-caps:normal;font-variant-east-asian:normal;font-variant-ligatures:normal;font-variant-numeric:normal;font-variant-position:normal;isolation:auto;mix-blend-mode:normal;shape-padding:0;text-decoration-color:#000000;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-orientation:mixed;text-transform:none;white-space:normal"/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -1,5 +0,0 @@
|
||||
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(0 -988.36)">
|
||||
<path transform="translate(0 988.36)" d="m13 11.996a5.0039 5.0039 0 0 0 -5.0039 5.0039 5.0039 5.0039 0 0 0 0.0039062 0.11719v2.8828 8 22.92a5.0039 5.0039 0 0 0 -0.0039062 0.076172 5.0039 5.0039 0 0 0 5.0039 5.0039h37.996a5.0039 5.0039 0 0 0 5.0039 -5.0039v-25.916a5.0039 5.0039 0 0 0 0.003906 -0.076172 5.0039 5.0039 0 0 0 -5.0039 -5.0039h-11v-0.039062a3.5 3.5 0 0 1 -0.5 0.039062 3.5 3.5 0 0 1 -3.5 -3.5v0.38281a5.0039 5.0039 0 0 0 -5 -4.8867 5.0039 5.0039 0 0 0 -0.11719 0.003906h-17.807a5.0039 5.0039 0 0 0 -0.076172 -0.003906zm23 4.5039a3.5 3.5 0 0 1 0.041016 -0.5h-0.041016v0.5z" fill="#e0e0e0"/>
|
||||
</g>
|
||||
</svg>
|
Before Width: | Height: | Size: 749 B |
5
editor/icons/icon_folder_big_thumb.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="64" height="64" version="1.1" viewBox="0 0 64 64" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(0 -988.36)">
|
||||
<path transform="translate(0 988.36)" d="m12 10c-2.2091 0-4 1.7909-4 4v37h0.13086c0.45564 1.7647 2.0466 2.9982 3.8691 3h40c2.2091 0 4-1.7909 4-4v-28c0-2.2091-1.7909-4-4-4h-16l-2-4c-0.98796-1.9759-1.7909-4-4-4z" fill="#e0e0e0" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 439 B |
5
editor/icons/icon_folder_medium_thumb.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg width="32" height="32" version="1.1" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(0 -1020.4)">
|
||||
<path d="m6 1025.4c-1.1046 0-2 0.8954-2 2v18.5h0.06543c0.22782 0.8823 1.0233 1.4991 1.9346 1.5h20c1.1046 0 2-0.8954 2-2v-14c0-1.1046-0.89543-2-2-2h-8l-1-2c-0.49398-0.988-0.89543-2-2-2z" fill="#e0e0e0" stroke-linecap="round" stroke-linejoin="round"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 397 B |
@ -26,8 +26,5 @@
|
||||
<path d="m0 0c0-7.994 6.477-14.473 14.471-14.473 8.002 0 14.479 6.479 14.479 14.473s-6.477 14.479-14.479 14.479c-7.994 0-14.471-6.485-14.471-14.479" fill="#414042"/>
|
||||
</g>
|
||||
</g>
|
||||
<path d="m4 1041.4a3 3 0 0 0 -3 3 3 3 0 0 0 3 3 3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3zm0 1a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2z"/>
|
||||
<path d="m12 1041.4a3 3 0 0 0 -3 3 3 3 0 0 0 3 3 3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3zm0 1a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2z"/>
|
||||
<rect x="6" y="1043.4" width="4" height="1" ry="0"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 3.7 KiB |
31
editor/icons/icon_godot_docs.svg
Normal file
@ -0,0 +1,31 @@
|
||||
<svg width="16" height="16" version="1.1" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="translate(0 -1036.4)">
|
||||
<g transform="matrix(.017241 0 0 .017241 -.82759 1033.7)" stroke-width=".32031">
|
||||
<g transform="matrix(4.1626 0 0 -4.1626 919.24 771.67)">
|
||||
<path d="m0 0s-0.325 1.994-0.515 1.976l-36.182-3.491c-2.879-0.278-5.115-2.574-5.317-5.459l-0.994-14.247-27.992-1.997-1.904 12.912c-0.424 2.872-2.932 5.037-5.835 5.037h-38.188c-2.902 0-5.41-2.165-5.834-5.037l-1.905-12.912-27.992 1.997-0.994 14.247c-0.202 2.886-2.438 5.182-5.317 5.46l-36.2 3.49c-0.187 0.018-0.324-1.978-0.511-1.978l-0.049-7.83 30.658-4.944 1.004-14.374c0.203-2.91 2.551-5.263 5.463-5.472l38.551-2.75c0.146-0.01 0.29-0.016 0.434-0.016 2.897 0 5.401 2.166 5.825 5.038l1.959 13.286h28.005l1.959-13.286c0.423-2.871 2.93-5.037 5.831-5.037 0.142 0 0.284 5e-3 0.423 0.015l38.556 2.75c2.911 0.209 5.26 2.562 5.463 5.472l1.003 14.374 30.645 4.966z" fill="#fff"/>
|
||||
</g>
|
||||
<g transform="matrix(4.1626 0 0 -4.1626 104.7 525.91)">
|
||||
<path d="m0 0v-59.041c0.108-1e-3 0.216-5e-3 0.323-0.015l36.196-3.49c1.896-0.183 3.382-1.709 3.514-3.609l1.116-15.978 31.574-2.253 2.175 14.747c0.282 1.912 1.922 3.329 3.856 3.329h38.188c1.933 0 3.573-1.417 3.855-3.329l2.175-14.747 31.575 2.253 1.115 15.978c0.133 1.9 1.618 3.425 3.514 3.609l36.182 3.49c0.107 0.01 0.214 0.014 0.322 0.015v4.711l0.015 5e-3v54.325h0.134c4.795 6.12 9.232 12.569 13.487 19.449-5.651 9.62-12.575 18.217-19.976 26.182-6.864-3.455-13.531-7.369-19.828-11.534-3.151 3.132-6.7 5.694-10.186 8.372-3.425 2.751-7.285 4.768-10.946 7.118 1.09 8.117 1.629 16.108 1.846 24.448-9.446 4.754-19.519 7.906-29.708 10.17-4.068-6.837-7.788-14.241-11.028-21.479-3.842 0.642-7.702 0.88-11.567 0.926v6e-3c-0.027 0-0.052-6e-3 -0.075-6e-3 -0.024 0-0.049 6e-3 -0.073 6e-3v-6e-3c-3.872-0.046-7.729-0.284-11.572-0.926-3.238 7.238-6.956 14.642-11.03 21.479-10.184-2.264-20.258-5.416-29.703-10.17 0.216-8.34 0.755-16.331 1.848-24.448-3.668-2.35-7.523-4.367-10.949-7.118-3.481-2.678-7.036-5.24-10.188-8.372-6.297 4.165-12.962 8.079-19.828 11.534-7.401-7.965-14.321-16.562-19.974-26.182 4.253-6.88 8.693-13.329 13.487-19.449z" fill="#478cbf"/>
|
||||
</g>
|
||||
<g transform="matrix(4.1626 0 0 -4.1626 784.07 817.24)">
|
||||
<path d="m0 0-1.121-16.063c-0.135-1.936-1.675-3.477-3.611-3.616l-38.555-2.751c-0.094-7e-3 -0.188-0.01-0.281-0.01-1.916 0-3.569 1.406-3.852 3.33l-2.211 14.994h-31.459l-2.211-14.994c-0.297-2.018-2.101-3.469-4.133-3.32l-38.555 2.751c-1.936 0.139-3.476 1.68-3.611 3.616l-1.121 16.063-32.547 3.138c0.015-3.498 0.06-7.33 0.06-8.093 0-34.374 43.605-50.896 97.781-51.086h0.133c54.176 0.19 97.766 16.712 97.766 51.086 0 0.777 0.047 4.593 0.063 8.093z" fill="#478cbf"/>
|
||||
</g>
|
||||
<g transform="matrix(4.1626 0 0 -4.1626 389.21 625.67)">
|
||||
<path d="m0 0c0-12.052-9.765-21.815-21.813-21.815-12.042 0-21.81 9.763-21.81 21.815 0 12.044 9.768 21.802 21.81 21.802 12.048 0 21.813-9.758 21.813-21.802" fill="#fff"/>
|
||||
</g>
|
||||
<g transform="matrix(4.1626 0 0 -4.1626 367.37 631.06)">
|
||||
<path d="m0 0c0-7.994-6.479-14.473-14.479-14.473-7.996 0-14.479 6.479-14.479 14.473s6.483 14.479 14.479 14.479c8 0 14.479-6.485 14.479-14.479" fill="#414042"/>
|
||||
</g>
|
||||
<g transform="matrix(4.1626 0 0 -4.1626 511.99 724.74)">
|
||||
<path d="m0 0c-3.878 0-7.021 2.858-7.021 6.381v20.081c0 3.52 3.143 6.381 7.021 6.381s7.028-2.861 7.028-6.381v-20.081c0-3.523-3.15-6.381-7.028-6.381" fill="#fff"/>
|
||||
</g>
|
||||
<g transform="matrix(4.1626 0 0 -4.1626 634.79 625.67)">
|
||||
<path d="m0 0c0-12.052 9.765-21.815 21.815-21.815 12.041 0 21.808 9.763 21.808 21.815 0 12.044-9.767 21.802-21.808 21.802-12.05 0-21.815-9.758-21.815-21.802" fill="#fff"/>
|
||||
</g>
|
||||
<g transform="matrix(4.1626 0 0 -4.1626 656.64 631.06)">
|
||||
<path d="m0 0c0-7.994 6.477-14.473 14.471-14.473 8.002 0 14.479 6.479 14.479 14.473s-6.477 14.479-14.479 14.479c-7.994 0-14.471-6.485-14.471-14.479" fill="#414042"/>
|
||||
</g>
|
||||
</g>
|
||||
<path transform="translate(0 1036.4)" d="m4 5a3 3 0 0 0 -3 3 3 3 0 0 0 3 3 3 3 0 0 0 3 -3h2a3 3 0 0 0 3 3 3 3 0 0 0 3 -3 3 3 0 0 0 -3 -3 3 3 0 0 0 -2.8262 2h-2.3496a3 3 0 0 0 -2.8242 -2zm0 1a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2zm8 0a2 2 0 0 1 2 2 2 2 0 0 1 -2 2 2 2 0 0 1 -2 -2 2 2 0 0 1 2 -2z"/>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 4.1 KiB |
7
editor/icons/icon_logo.svg
Normal file
After Width: | Height: | Size: 13 KiB |
@ -48,7 +48,7 @@ void ProjectExportDialog::_notification(int p_what) {
|
||||
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_READY: {
|
||||
delete_preset->set_icon(get_icon("Del", "EditorIcons"));
|
||||
delete_preset->set_icon(get_icon("Remove", "EditorIcons"));
|
||||
connect("confirmed", this, "_export_pck_zip");
|
||||
custom_feature_display->get_parent_control()->add_style_override("panel", get_stylebox("bg", "Tree"));
|
||||
} break;
|
||||
@ -193,7 +193,7 @@ void ProjectExportDialog::_edit_preset(int p_index) {
|
||||
patch->set_checked(0, true);
|
||||
patch->set_tooltip(0, patchlist[i]);
|
||||
patch->set_metadata(0, i);
|
||||
patch->add_button(0, get_icon("Del", "EditorIcons"), 0);
|
||||
patch->add_button(0, get_icon("Remove", "EditorIcons"), 0);
|
||||
patch->add_button(0, get_icon("folder", "FileDialog"), 1);
|
||||
}
|
||||
|
||||
|
@ -491,9 +491,8 @@ void VisualScriptEditor::_update_graph(int p_only_id) {
|
||||
gnode->set_overlay(GraphNode::OVERLAY_BREAKPOINT);
|
||||
}
|
||||
|
||||
if (EditorSettings::get_singleton()->has("editors/visual_script/color_" + node->get_category())) {
|
||||
Color c = EditorSettings::get_singleton()->get("editors/visual_script/color_" + node->get_category());
|
||||
gnode->set_self_modulate(c);
|
||||
if (node_styles.has(node->get_category())) {
|
||||
gnode->add_style_override("frame", node_styles[node->get_category()]);
|
||||
}
|
||||
|
||||
gnode->set_meta("__vnode", node);
|
||||
@ -2743,6 +2742,27 @@ void VisualScriptEditor::_notification(int p_what) {
|
||||
node_filter->add_icon_override("right_icon", Control::get_icon("Search", "EditorIcons"));
|
||||
variable_editor->connect("changed", this, "_update_members");
|
||||
signal_editor->connect("changed", this, "_update_members");
|
||||
|
||||
List<Pair<String, Color> > colors;
|
||||
colors.push_back(Pair<String, Color>("functions", Color(1, 0.9, 0.9)));
|
||||
colors.push_back(Pair<String, Color>("data", Color(0.9, 1.0, 0.9)));
|
||||
colors.push_back(Pair<String, Color>("operators", Color(0.9, 0.9, 1.0)));
|
||||
colors.push_back(Pair<String, Color>("flow_control", Color(1.0, 1.0, 1.0)));
|
||||
colors.push_back(Pair<String, Color>("custom", Color(0.8, 1.0, 1.0)));
|
||||
colors.push_back(Pair<String, Color>("constants", Color(1.0, 0.8, 1.0)));
|
||||
|
||||
for (List<Pair<String, Color> >::Element *E = colors.front(); E; E = E->next()) {
|
||||
print_line(E->get().first);
|
||||
Ref<StyleBoxFlat> sb = EditorNode::get_singleton()->get_theme_base()->get_theme()->get_stylebox("frame", "GraphNode");
|
||||
if (sb != NULL) {
|
||||
Ref<StyleBoxFlat> frame_style = sb->duplicate();
|
||||
Color c = sb->get_border_color(MARGIN_TOP);
|
||||
Color cn = E->get().second;
|
||||
cn.a = c.a;
|
||||
frame_style->set_border_color_all(cn);
|
||||
node_styles[E->get().first] = frame_style;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
left_vsplit->set_visible(is_visible_in_tree());
|
||||
@ -2974,7 +2994,7 @@ void VisualScriptEditor::_member_rmb_selected(const Vector2 &p_pos) {
|
||||
|
||||
TreeItem *root = members->get_root();
|
||||
|
||||
Ref<Texture> del_icon = Control::get_icon("Del", "EditorIcons");
|
||||
Ref<Texture> del_icon = Control::get_icon("Remove", "EditorIcons");
|
||||
|
||||
Ref<Texture> edit_icon = Control::get_icon("Edit", "EditorIcons");
|
||||
|
||||
@ -3366,12 +3386,6 @@ void VisualScriptEditor::free_clipboard() {
|
||||
static void register_editor_callback() {
|
||||
|
||||
ScriptEditor::register_create_script_editor_function(create_editor);
|
||||
EditorSettings::get_singleton()->set("editors/visual_script/color_functions", Color(1, 0.9, 0.9));
|
||||
EditorSettings::get_singleton()->set("editors/visual_script/color_data", Color(0.9, 1.0, 0.9));
|
||||
EditorSettings::get_singleton()->set("editors/visual_script/color_operators", Color(0.9, 0.9, 1.0));
|
||||
EditorSettings::get_singleton()->set("editors/visual_script/color_flow_control", Color(1.0, 1.0, 1.0));
|
||||
EditorSettings::get_singleton()->set("editors/visual_script/color_custom", Color(0.8, 1.0, 1.0));
|
||||
EditorSettings::get_singleton()->set("editors/visual_script/color_constants", Color(1.0, 0.8, 1.0));
|
||||
|
||||
ED_SHORTCUT("visual_script_editor/delete_selected", TTR("Delete Selected"));
|
||||
ED_SHORTCUT("visual_script_editor/toggle_breakpoint", TTR("Toggle Breakpoint"), KEY_F9);
|
||||
|
@ -136,6 +136,7 @@ class VisualScriptEditor : public ScriptEditorBase {
|
||||
Vector<Pair<Variant::Type, String> > args;
|
||||
};
|
||||
|
||||
HashMap<StringName, Ref<StyleBox>, StringNameHasher> node_styles;
|
||||
StringName edited_func;
|
||||
|
||||
void _update_graph_connections();
|
||||
|
@ -195,7 +195,7 @@ void WindowDialog::_notification(int p_what) {
|
||||
RID canvas = get_canvas_item();
|
||||
|
||||
// Draw the background.
|
||||
Ref<StyleBox> panel = get_stylebox("panel", "WindowDialog");
|
||||
Ref<StyleBox> panel = get_stylebox("panel");
|
||||
Size2 size = get_size();
|
||||
panel->draw(canvas, Rect2(0, 0, size.x, size.y));
|
||||
|
||||
|