瀏覽代碼

Fixed some inconsistent styles, plus some cleanup

Daniel J. Ramirez 8 年之前
父節點
當前提交
57fff67580
共有 5 個文件被更改,包括 20 次插入31 次删除
  1. 6 4
      editor/editor_help.cpp
  2. 0 1
      editor/editor_help.h
  3. 5 20
      editor/editor_log.cpp
  4. 0 3
      editor/editor_log.h
  5. 9 3
      editor/editor_themes.cpp

+ 6 - 4
editor/editor_help.cpp

@@ -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");

+ 0 - 1
editor/editor_help.h

@@ -130,7 +130,6 @@ class EditorHelp : public VBoxContainer {
 	HSplitContainer *h_split;
 	static DocData *doc;
 
-	Panel *background_panel;
 	ConfirmationDialog *search_dialog;
 	LineEdit *search;
 

+ 5 - 20
editor/editor_log.cpp

@@ -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() {
 }

+ 0 - 3
editor/editor_log.h

@@ -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);

+ 9 - 3
editor/editor_themes.cpp

@@ -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_stylebox("focus", "RichTextLabel", make_empty_stylebox());
 	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));
@@ -725,9 +731,9 @@ 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"));