소스 검색

Maked status bar label fonts updateable

Chaosus 7 년 전
부모
커밋
42fccfb0a5
2개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 9 1
      editor/code_editor.cpp
  2. 1 0
      editor/code_editor.h

+ 9 - 1
editor/code_editor.cpp

@@ -771,6 +771,14 @@ void CodeTextEditor::set_error(const String &p_error) {
 void CodeTextEditor::_update_font() {
 void CodeTextEditor::_update_font() {
 
 
 	text_editor->add_font_override("font", get_font("source", "EditorFonts"));
 	text_editor->add_font_override("font", get_font("source", "EditorFonts"));
+
+	Ref<Font> status_bar_font = get_font("status_source", "EditorFonts");
+	int count = status_bar->get_child_count();
+	for (int i = 0; i < count; i++) {
+		Control *n = Object::cast_to<Control>(status_bar->get_child(i));
+		if (n)
+			n->add_font_override("font", status_bar_font);
+	}
 }
 }
 
 
 void CodeTextEditor::_on_settings_change() {
 void CodeTextEditor::_on_settings_change() {
@@ -851,7 +859,7 @@ CodeTextEditor::CodeTextEditor() {
 	text_editor->set_brace_matching(true);
 	text_editor->set_brace_matching(true);
 	text_editor->set_auto_indent(true);
 	text_editor->set_auto_indent(true);
 
 
-	HBoxContainer *status_bar = memnew(HBoxContainer);
+	status_bar = memnew(HBoxContainer);
 	add_child(status_bar);
 	add_child(status_bar);
 	status_bar->set_h_size_flags(SIZE_EXPAND_FILL);
 	status_bar->set_h_size_flags(SIZE_EXPAND_FILL);
 
 

+ 1 - 0
editor/code_editor.h

@@ -141,6 +141,7 @@ class CodeTextEditor : public VBoxContainer {
 
 
 	TextEdit *text_editor;
 	TextEdit *text_editor;
 	FindReplaceBar *find_replace_bar;
 	FindReplaceBar *find_replace_bar;
+	HBoxContainer *status_bar;
 
 
 	Label *line_nb;
 	Label *line_nb;
 	Label *col_nb;
 	Label *col_nb;