You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Fixed some inconsistent styles, plus some cleanup
This commit is contained in:
@@ -1709,6 +1709,10 @@ void EditorHelp::_notification(int p_what) {
|
|||||||
//forward->set_icon(get_icon("Forward","EditorIcons"));
|
//forward->set_icon(get_icon("Forward","EditorIcons"));
|
||||||
//back->set_icon(get_icon("Back","EditorIcons"));
|
//back->set_icon(get_icon("Back","EditorIcons"));
|
||||||
_update_doc();
|
_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;
|
} break;
|
||||||
|
|
||||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||||
@@ -1784,12 +1788,10 @@ EditorHelp::EditorHelp() {
|
|||||||
//class_list->set_selection_enabled(true);
|
//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);
|
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_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->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("meta_clicked", this, "_class_desc_select");
|
||||||
class_desc->connect("gui_input", this, "_class_desc_input");
|
class_desc->connect("gui_input", this, "_class_desc_input");
|
||||||
|
|||||||
@@ -130,7 +130,6 @@ class EditorHelp : public VBoxContainer {
|
|||||||
HSplitContainer *h_split;
|
HSplitContainer *h_split;
|
||||||
static DocData *doc;
|
static DocData *doc;
|
||||||
|
|
||||||
Panel *background_panel;
|
|
||||||
ConfirmationDialog *search_dialog;
|
ConfirmationDialog *search_dialog;
|
||||||
LineEdit *search;
|
LineEdit *search;
|
||||||
|
|
||||||
|
|||||||
@@ -61,9 +61,6 @@ void EditorLog::_notification(int p_what) {
|
|||||||
|
|
||||||
//button->set_icon(get_icon("Console","EditorIcons"));
|
//button->set_icon(get_icon("Console","EditorIcons"));
|
||||||
}
|
}
|
||||||
if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {
|
|
||||||
_override_logger_styles();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*if (p_what==NOTIFICATION_DRAW) {
|
/*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() {
|
void EditorLog::_bind_methods() {
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("_clear_request"), &EditorLog::_clear_request);
|
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 );
|
//ClassDB::bind_method(D_METHOD("_dragged"),&EditorLog::_dragged );
|
||||||
ADD_SIGNAL(MethodInfo("clear_request"));
|
ADD_SIGNAL(MethodInfo("clear_request"));
|
||||||
}
|
}
|
||||||
@@ -151,21 +147,15 @@ EditorLog::EditorLog() {
|
|||||||
clearbutton->set_text(TTR("Clear"));
|
clearbutton->set_text(TTR("Clear"));
|
||||||
clearbutton->connect("pressed", this, "_clear_request");
|
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 = memnew(RichTextLabel);
|
||||||
log->set_scroll_follow(true);
|
log->set_scroll_follow(true);
|
||||||
log->set_selection_enabled(true);
|
log->set_selection_enabled(true);
|
||||||
log->set_focus_mode(FOCUS_CLICK);
|
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.");
|
add_message(VERSION_FULL_NAME " (c) 2008-2017 Juan Linietsky, Ariel Manzur.");
|
||||||
//log->add_text("Initialization Complete.\n"); //because it looks cool.
|
//log->add_text("Initialization Complete.\n"); //because it looks cool.
|
||||||
|
|
||||||
@@ -183,10 +173,5 @@ void EditorLog::deinit() {
|
|||||||
remove_error_handler(&eh);
|
remove_error_handler(&eh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void EditorLog::_override_logger_styles() {
|
|
||||||
|
|
||||||
pc->add_style_override("panel", get_stylebox("normal", "TextEdit"));
|
|
||||||
}
|
|
||||||
|
|
||||||
EditorLog::~EditorLog() {
|
EditorLog::~EditorLog() {
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ class EditorLog : public VBoxContainer {
|
|||||||
RichTextLabel *log;
|
RichTextLabel *log;
|
||||||
HBoxContainer *title_hb;
|
HBoxContainer *title_hb;
|
||||||
//PaneDrag *pd;
|
//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);
|
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:
|
protected:
|
||||||
static void _bind_methods();
|
static void _bind_methods();
|
||||||
void _notification(int p_what);
|
void _notification(int p_what);
|
||||||
void _override_logger_styles();
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void add_message(const String &p_msg, bool p_error = false);
|
void add_message(const String &p_msg, bool p_error = false);
|
||||||
|
|||||||
@@ -698,6 +698,12 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
|||||||
theme->set_color("default_color", "RichTextLabel", rtl_font_color);
|
theme->set_color("default_color", "RichTextLabel", rtl_font_color);
|
||||||
theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox());
|
theme->set_stylebox("focus", "RichTextLabel", make_empty_stylebox());
|
||||||
theme->set_stylebox("normal", "RichTextLabel", style_tree_bg);
|
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
|
// Panel
|
||||||
theme->set_stylebox("panel", "Panel", make_flat_stylebox(dark_color_1, 6, 4, 6, 4));
|
theme->set_stylebox("panel", "Panel", make_flat_stylebox(dark_color_1, 6, 4, 6, 4));
|
||||||
@@ -725,9 +731,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
|
|||||||
theme->set_color("font_color", "ProgressBar", font_color);
|
theme->set_color("font_color", "ProgressBar", font_color);
|
||||||
|
|
||||||
// GraphEdit
|
// GraphEdit
|
||||||
theme->set_stylebox("bg", "GraphEdit", make_flat_stylebox(dark_color_2, 4, 4, 4, 4));
|
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.2));
|
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.2));
|
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("minus", "GraphEdit", theme->get_icon("ZoomLess", "EditorIcons"));
|
||||||
theme->set_icon("more", "GraphEdit", theme->get_icon("ZoomMore", "EditorIcons"));
|
theme->set_icon("more", "GraphEdit", theme->get_icon("ZoomMore", "EditorIcons"));
|
||||||
theme->set_icon("reset", "GraphEdit", theme->get_icon("ZoomReset", "EditorIcons"));
|
theme->set_icon("reset", "GraphEdit", theme->get_icon("ZoomReset", "EditorIcons"));
|
||||||
|
|||||||
Reference in New Issue
Block a user