summaryrefslogtreecommitdiffstats
path: root/editor/code_editor.cpp
diff options
context:
space:
mode:
authorPoommetee Ketson <poommetee@protonmail.com>2017-10-02 23:49:44 +0700
committerGitHub <noreply@github.com>2017-10-02 23:49:44 +0700
commit34ea27138072446947ee12bfcaba288f9ff825e5 (patch)
tree2ed1cb5352d2b3eb9c21102337a4f8ac8c8734aa /editor/code_editor.cpp
parentc96fc380e5f6bd6a24a3c4a736eada7a0284975a (diff)
parent15986ea34322529637957d35ac66ad47ff936234 (diff)
downloadredot-engine-34ea27138072446947ee12bfcaba288f9ff825e5.tar.gz
Merge pull request #11646 from djrm/pr_visual_improvements
Several visual improvements.
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r--editor/code_editor.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp
index 4421768493..ee1faf5a55 100644
--- a/editor/code_editor.cpp
+++ b/editor/code_editor.cpp
@@ -1198,17 +1198,9 @@ CodeTextEditor::CodeTextEditor() {
text_editor->set_brace_matching(true);
text_editor->set_auto_indent(true);
- MarginContainer *status_mc = memnew(MarginContainer);
- add_child(status_mc);
- status_mc->set("custom_constants/margin_left", 2);
- status_mc->set("custom_constants/margin_top", 5);
- status_mc->set("custom_constants/margin_right", 2);
- status_mc->set("custom_constants/margin_bottom", 1);
-
HBoxContainer *status_bar = memnew(HBoxContainer);
- status_mc->add_child(status_bar);
+ add_child(status_bar);
status_bar->set_h_size_flags(SIZE_EXPAND_FILL);
- status_bar->add_child(memnew(Label)); //to keep the height if the other labels are not visible
idle = memnew(Timer);
add_child(idle);
@@ -1227,14 +1219,18 @@ CodeTextEditor::CodeTextEditor() {
error->set_clip_text(true); //do not change, or else very long errors can push the whole container to the right
error->set_valign(Label::VALIGN_CENTER);
error->add_color_override("font_color", EditorNode::get_singleton()->get_gui_base()->get_color("error_color", "Editor"));
+ error->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts"));
error->set_h_size_flags(SIZE_EXPAND_FILL); //required for it to display, given now it's clipping contents, do not touch
+ status_bar->add_child(memnew(Label)); //to keep the height if the other labels are not visible
+
Label *line_txt = memnew(Label);
status_bar->add_child(line_txt);
line_txt->set_align(Label::ALIGN_RIGHT);
line_txt->set_valign(Label::VALIGN_CENTER);
line_txt->set_v_size_flags(SIZE_FILL);
line_txt->set_text(TTR("Line:"));
+ line_txt->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts"));
line_nb = memnew(Label);
status_bar->add_child(line_nb);
@@ -1243,6 +1239,8 @@ CodeTextEditor::CodeTextEditor() {
line_nb->set_autowrap(true); // workaround to prevent resizing the label on each change, do not touch
line_nb->set_clip_text(true); // workaround to prevent resizing the label on each change, do not touch
line_nb->set_custom_minimum_size(Size2(40, 1) * EDSCALE);
+ line_nb->set_align(Label::ALIGN_RIGHT);
+ line_nb->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts"));
Label *col_txt = memnew(Label);
status_bar->add_child(col_txt);
@@ -1250,6 +1248,7 @@ CodeTextEditor::CodeTextEditor() {
col_txt->set_valign(Label::VALIGN_CENTER);
col_txt->set_v_size_flags(SIZE_FILL);
col_txt->set_text(TTR("Col:"));
+ col_txt->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts"));
col_nb = memnew(Label);
status_bar->add_child(col_nb);
@@ -1258,6 +1257,9 @@ CodeTextEditor::CodeTextEditor() {
col_nb->set_autowrap(true); // workaround to prevent resizing the label on each change, do not touch
col_nb->set_clip_text(true); // workaround to prevent resizing the label on each change, do not touch
col_nb->set_custom_minimum_size(Size2(40, 1) * EDSCALE);
+ col_nb->set_align(Label::ALIGN_RIGHT);
+ col_nb->set("custom_constants/margin_right", 0);
+ col_nb->add_font_override("font", EditorNode::get_singleton()->get_gui_base()->get_font("status_source", "EditorFonts"));
text_editor->connect("gui_input", this, "_text_editor_gui_input");
text_editor->connect("cursor_changed", this, "_line_col_changed");