diff options
| author | Juan Linietsky | 2016-07-09 14:54:44 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2016-07-09 14:56:08 -0300 |
| commit | 864c0e84de9c2a2c5a030ec4ee167f3793e1e962 (patch) | |
| tree | 5a01e430c9727519743bde1f7c8c1ed17874abc5 | |
| parent | d23d40cfbdb1033848f89a2896701b792ef5e5ad (diff) | |
| download | godot-864c0e8.tar.gz godot-864c0e8.tar.zst godot-864c0e8.zip | |
line/col label was changing size with each cursor move, forcing the GUI to resize upwards and costing considerably CPU usage.
It has been changed so it won't resize the UI when modified.
This will make the code editor feel a lot smoother.
Diffstat (limited to '')
| -rw-r--r-- | platform/x11/os_x11.cpp | 1 | ||||
| -rw-r--r-- | scene/gui/label.cpp | 4 | ||||
| -rw-r--r-- | tools/editor/code_editor.cpp | 5 |
3 files changed, 8 insertions, 2 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 846c61fd1..20fae72ab 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -1773,7 +1773,6 @@ static String _get_clipboard(Atom p_source, Window x11_window, ::Display* x11_di if (Sown == x11_window) { - printf("returning internal clipboard\n"); return p_internal_clipboard; }; diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index 778d24cc3..0431d824f 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -535,7 +535,9 @@ void Label::set_text(const String& p_string) { if (percent_visible<1) visible_chars=get_total_character_count()*percent_visible; update(); - minimum_size_changed(); + if (!autowrap) { + minimum_size_changed(); + } } diff --git a/tools/editor/code_editor.cpp b/tools/editor/code_editor.cpp index 644478923..21de122ce 100644 --- a/tools/editor/code_editor.cpp +++ b/tools/editor/code_editor.cpp @@ -32,6 +32,7 @@ #include "scene/gui/separator.h" #include "scene/resources/dynamic_font.h" #include "os/keyboard.h" +#include "tools/editor/editor_scale.h" void GotoLineDialog::popup_find_line(TextEdit *p_edit) { @@ -1198,6 +1199,10 @@ CodeTextEditor::CodeTextEditor() { line_col = memnew( Label ); status_bar->add_child(line_col); line_col->set_valign(Label::VALIGN_CENTER); + line_col->set_autowrap(true); + line_col->set_v_size_flags(SIZE_FILL); + line_col->set_custom_minimum_size(Size2(100,1)*EDSCALE); + status_bar->add_child( memnew( Label ) ); //to keep the height if the other labels are not visible text_editor->connect("input_event", this,"_text_editor_input_event"); |
