diff options
author | Poommetee Ketson <poommetee@protonmail.com> | 2018-09-18 21:10:36 +0700 |
---|---|---|
committer | Poommetee Ketson <poommetee@protonmail.com> | 2018-09-18 22:07:13 +0700 |
commit | e74876028e09cb08d5359ed6de9237027d351a79 (patch) | |
tree | 4dfae4bff48ef45cd7b907fc4eb3b0c9002fe18e /editor/code_editor.cpp | |
parent | f148e8eedeb1ff2dcf74d6843d1314d7c6db12a7 (diff) | |
download | redot-engine-e74876028e09cb08d5359ed6de9237027d351a79.tar.gz |
Fix find-in-files and go-to-line dialog (partially)
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r-- | editor/code_editor.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 33d36e5e9c..79c22f667a 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -44,7 +44,7 @@ void GotoLineDialog::popup_find_line(TextEdit *p_edit) { line->set_text(itos(text_editor->cursor_get_line())); line->select_all(); - popup_centered(Size2(180, 80)); + popup_centered(Size2(180, 80) * EDSCALE); line->grab_focus(); } @@ -65,16 +65,20 @@ void GotoLineDialog::ok_pressed() { GotoLineDialog::GotoLineDialog() { set_title(TTR("Go to Line")); + + VBoxContainer *vbc = memnew(VBoxContainer); + vbc->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_BEGIN, 8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_TOP, ANCHOR_BEGIN, 8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -8 * EDSCALE); + vbc->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_END, -8 * EDSCALE); + add_child(vbc); + Label *l = memnew(Label); l->set_text(TTR("Line Number:")); - l->set_position(Point2(5, 5)); - add_child(l); + vbc->add_child(l); line = memnew(LineEdit); - line->set_anchor(MARGIN_RIGHT, ANCHOR_END); - line->set_begin(Point2(15, 22)); - line->set_end(Point2(-15, 35)); - add_child(line); + vbc->add_child(line); register_text_enter(line); text_editor = NULL; |