summaryrefslogtreecommitdiff
path: root/editor/code_editor.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-10-02 09:41:21 +0200
committerGitHub <noreply@github.com>2018-10-02 09:41:21 +0200
commit0349d6db238274f4b9da20ed028316cc93dabfd2 (patch)
tree2d775374ce60fb587cc11cc8c6b02fc1104a3f1b /editor/code_editor.cpp
parentffa8420aec1ca0af8feca0697613efad6d3f0e4e (diff)
parente74876028e09cb08d5359ed6de9237027d351a79 (diff)
Merge pull request #22220 from Naryosha/dialog
Fix find-in-files and go-to-line dialog (partially)
Diffstat (limited to 'editor/code_editor.cpp')
-rw-r--r--editor/code_editor.cpp18
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;