diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-05-16 10:57:11 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-16 10:57:11 +0200 |
commit | fcc321f75fd29bee8c115b4ea1a0ad13128c2bde (patch) | |
tree | 50d4a71fb0f2040dba9117616a7cb2921310edd1 | |
parent | 98e5a3ea426f12b4ae439f67d29a5c6cfc5f39d4 (diff) | |
parent | 592ff9bb9d1bbfa11a7635b988b331a7bbadc693 (diff) |
Merge pull request #18921 from volzhs/margin-find-replace-bar
Add margin bottom with find/replace bar on script editor
-rw-r--r-- | editor/code_editor.cpp | 9 | ||||
-rw-r--r-- | editor/code_editor.h | 2 |
2 files changed, 5 insertions, 6 deletions
diff --git a/editor/code_editor.cpp b/editor/code_editor.cpp index 93c86d920a..665ce7658f 100644 --- a/editor/code_editor.cpp +++ b/editor/code_editor.cpp @@ -373,7 +373,6 @@ void FindReplaceBar::_hide_bar() { void FindReplaceBar::_show_search() { - hide(); // to update size correctly show(); search_text->grab_focus(); @@ -481,7 +480,7 @@ void FindReplaceBar::set_text_edit(TextEdit *p_text_edit) { void FindReplaceBar::_update_size() { - container->set_custom_minimum_size(Size2(0, hbc->get_size().height)); + container->set_size(Size2(hbc->get_size().width, 1)); } void FindReplaceBar::_bind_methods() { @@ -507,7 +506,8 @@ void FindReplaceBar::_bind_methods() { FindReplaceBar::FindReplaceBar() { - container = memnew(Control); + container = memnew(MarginContainer); + container->add_constant_override("margin_bottom", 5 * EDSCALE); add_child(container); container->set_clip_contents(true); container->set_h_size_flags(SIZE_EXPAND_FILL); @@ -592,8 +592,7 @@ FindReplaceBar::FindReplaceBar() { add_child(hide_button); hide_button->set_focus_mode(FOCUS_NONE); hide_button->connect("pressed", this, "_hide_pressed"); - hide_button->set_expand(true); - hide_button->set_stretch_mode(TextureButton::STRETCH_KEEP_CENTERED); + hide_button->set_v_size_flags(SIZE_SHRINK_CENTER); } /*** CODE EDITOR ****/ diff --git a/editor/code_editor.h b/editor/code_editor.h index a860ad24e2..2a3bb1ba76 100644 --- a/editor/code_editor.h +++ b/editor/code_editor.h @@ -63,7 +63,7 @@ class FindReplaceBar : public HBoxContainer { GDCLASS(FindReplaceBar, HBoxContainer); - Control *container; + MarginContainer *container; LineEdit *search_text; ToolButton *find_prev; ToolButton *find_next; |