Merge pull request #32528 from hbina/hbina_fix_font_override

Fixed warnings text using custom font and color setting.
This commit is contained in:
Rémi Verschelde 2019-10-04 13:47:04 +02:00 committed by GitHub
commit b177051521
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -232,6 +232,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
// Default font
MAKE_DEFAULT_FONT(df, default_font_size);
p_theme->set_default_theme_font(df);
p_theme->set_font("main", "EditorFonts", df);
// Bold font
MAKE_BOLD_FONT(df_bold, default_font_size);

View file

@ -5135,6 +5135,8 @@ CanvasItemEditor::CanvasItemEditor(EditorNode *p_editor) {
warning_child_of_container = memnew(Label);
warning_child_of_container->hide();
warning_child_of_container->set_text(TTR("Warning: Children of a container get their position and size determined only by their parent."));
warning_child_of_container->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("warning_color", "Editor"));
warning_child_of_container->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("main", "EditorFonts"));
add_control_to_info_overlay(warning_child_of_container);
h_scroll = memnew(HScrollBar);