summaryrefslogtreecommitdiff
path: root/editor/editor_help.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'editor/editor_help.cpp')
-rw-r--r--editor/editor_help.cpp29
1 files changed, 24 insertions, 5 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index f9b104cdae..65e50560bc 100644
--- a/editor/editor_help.cpp
+++ b/editor/editor_help.cpp
@@ -1280,11 +1280,10 @@ Error EditorHelp::_goto_desc(const String &p_class, int p_vscr) {
class_desc->add_newline();
// class_desc->add_newline();
- Vector<String> tutorials = cd.tutorials.split_spaces();
- if (tutorials.size() != 0) {
+ if (cd.tutorials.size() != 0) {
- for (int i = 0; i < tutorials.size(); i++) {
- String link = tutorials[i];
+ for (int i = 0; i < cd.tutorials.size(); i++) {
+ String link = cd.tutorials[i];
String linktxt = link;
int seppos = linktxt.find("//");
if (seppos != -1) {
@@ -1978,8 +1977,27 @@ FindBar::FindBar() {
}
void FindBar::popup_search() {
+
show();
- search_text->grab_focus();
+ bool grabbed_focus = false;
+ if (!search_text->has_focus()) {
+ search_text->grab_focus();
+ grabbed_focus = true;
+ }
+
+ if (!search_text->get_text().empty()) {
+ search_text->select_all();
+ search_text->set_cursor_position(search_text->get_text().length());
+ if (grabbed_focus) {
+ _search();
+ }
+ }
+
+ call_deferred("_update_size");
+}
+
+void FindBar::_update_size() {
+
container->set_custom_minimum_size(Size2(0, hbc->get_size().height));
}
@@ -2016,6 +2034,7 @@ void FindBar::_bind_methods() {
ClassDB::bind_method("_search_next", &FindBar::search_next);
ClassDB::bind_method("_search_prev", &FindBar::search_prev);
ClassDB::bind_method("_hide_pressed", &FindBar::_hide_bar);
+ ClassDB::bind_method("_update_size", &FindBar::_update_size);
ADD_SIGNAL(MethodInfo("search"));
}