property_selector.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. /**************************************************************************/
  2. /* property_selector.cpp */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #include "property_selector.h"
  31. #include "core/os/keyboard.h"
  32. #include "editor/doc_tools.h"
  33. #include "editor/editor_help.h"
  34. #include "editor/editor_node.h"
  35. #include "editor/editor_scale.h"
  36. #include "scene/gui/line_edit.h"
  37. #include "scene/gui/rich_text_label.h"
  38. #include "scene/gui/tree.h"
  39. void PropertySelector::_text_changed(const String &p_newtext) {
  40. _update_search();
  41. }
  42. void PropertySelector::_sbox_input(const Ref<InputEvent> &p_ie) {
  43. Ref<InputEventKey> k = p_ie;
  44. if (k.is_valid()) {
  45. switch (k->get_keycode()) {
  46. case Key::UP:
  47. case Key::DOWN:
  48. case Key::PAGEUP:
  49. case Key::PAGEDOWN: {
  50. search_options->gui_input(k);
  51. search_box->accept_event();
  52. TreeItem *root = search_options->get_root();
  53. if (!root->get_first_child()) {
  54. break;
  55. }
  56. TreeItem *current = search_options->get_selected();
  57. TreeItem *item = search_options->get_next_selected(root);
  58. while (item) {
  59. item->deselect(0);
  60. item = search_options->get_next_selected(item);
  61. }
  62. current->select(0);
  63. } break;
  64. default:
  65. break;
  66. }
  67. }
  68. }
  69. void PropertySelector::_update_search() {
  70. if (properties) {
  71. set_title(TTR("Select Property"));
  72. } else if (virtuals_only) {
  73. set_title(TTR("Select Virtual Method"));
  74. } else {
  75. set_title(TTR("Select Method"));
  76. }
  77. search_options->clear();
  78. help_bit->set_text("");
  79. TreeItem *root = search_options->create_item();
  80. // Allow using spaces in place of underscores in the search string (makes the search more fault-tolerant).
  81. const String search_text = search_box->get_text().replace(" ", "_");
  82. if (properties) {
  83. List<PropertyInfo> props;
  84. if (instance) {
  85. instance->get_property_list(&props, true);
  86. } else if (type != Variant::NIL) {
  87. Variant v;
  88. Callable::CallError ce;
  89. Variant::construct(type, v, nullptr, 0, ce);
  90. v.get_property_list(&props);
  91. } else {
  92. Object *obj = ObjectDB::get_instance(script);
  93. if (Object::cast_to<Script>(obj)) {
  94. props.push_back(PropertyInfo(Variant::NIL, "Script Variables", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_CATEGORY));
  95. Object::cast_to<Script>(obj)->get_script_property_list(&props);
  96. }
  97. StringName base = base_type;
  98. while (base) {
  99. props.push_back(PropertyInfo(Variant::NIL, base, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_CATEGORY));
  100. ClassDB::get_property_list(base, &props, true);
  101. base = ClassDB::get_parent_class(base);
  102. }
  103. }
  104. TreeItem *category = nullptr;
  105. bool found = false;
  106. Ref<Texture2D> type_icons[] = {
  107. search_options->get_theme_icon(SNAME("Variant"), SNAME("EditorIcons")),
  108. search_options->get_theme_icon(SNAME("bool"), SNAME("EditorIcons")),
  109. search_options->get_theme_icon(SNAME("int"), SNAME("EditorIcons")),
  110. search_options->get_theme_icon(SNAME("float"), SNAME("EditorIcons")),
  111. search_options->get_theme_icon(SNAME("String"), SNAME("EditorIcons")),
  112. search_options->get_theme_icon(SNAME("Vector2"), SNAME("EditorIcons")),
  113. search_options->get_theme_icon(SNAME("Vector2i"), SNAME("EditorIcons")),
  114. search_options->get_theme_icon(SNAME("Rect2"), SNAME("EditorIcons")),
  115. search_options->get_theme_icon(SNAME("Rect2i"), SNAME("EditorIcons")),
  116. search_options->get_theme_icon(SNAME("Vector3"), SNAME("EditorIcons")),
  117. search_options->get_theme_icon(SNAME("Vector3i"), SNAME("EditorIcons")),
  118. search_options->get_theme_icon(SNAME("Transform2D"), SNAME("EditorIcons")),
  119. search_options->get_theme_icon(SNAME("Vector4"), SNAME("EditorIcons")),
  120. search_options->get_theme_icon(SNAME("Vector4i"), SNAME("EditorIcons")),
  121. search_options->get_theme_icon(SNAME("Plane"), SNAME("EditorIcons")),
  122. search_options->get_theme_icon(SNAME("Quaternion"), SNAME("EditorIcons")),
  123. search_options->get_theme_icon(SNAME("AABB"), SNAME("EditorIcons")),
  124. search_options->get_theme_icon(SNAME("Basis"), SNAME("EditorIcons")),
  125. search_options->get_theme_icon(SNAME("Transform3D"), SNAME("EditorIcons")),
  126. search_options->get_theme_icon(SNAME("Projection"), SNAME("EditorIcons")),
  127. search_options->get_theme_icon(SNAME("Color"), SNAME("EditorIcons")),
  128. search_options->get_theme_icon(SNAME("StringName"), SNAME("EditorIcons")),
  129. search_options->get_theme_icon(SNAME("NodePath"), SNAME("EditorIcons")),
  130. search_options->get_theme_icon(SNAME("RID"), SNAME("EditorIcons")),
  131. search_options->get_theme_icon(SNAME("MiniObject"), SNAME("EditorIcons")),
  132. search_options->get_theme_icon(SNAME("Callable"), SNAME("EditorIcons")),
  133. search_options->get_theme_icon(SNAME("Signal"), SNAME("EditorIcons")),
  134. search_options->get_theme_icon(SNAME("Dictionary"), SNAME("EditorIcons")),
  135. search_options->get_theme_icon(SNAME("Array"), SNAME("EditorIcons")),
  136. search_options->get_theme_icon(SNAME("PackedByteArray"), SNAME("EditorIcons")),
  137. search_options->get_theme_icon(SNAME("PackedInt32Array"), SNAME("EditorIcons")),
  138. search_options->get_theme_icon(SNAME("PackedInt64Array"), SNAME("EditorIcons")),
  139. search_options->get_theme_icon(SNAME("PackedFloat32Array"), SNAME("EditorIcons")),
  140. search_options->get_theme_icon(SNAME("PackedFloat64Array"), SNAME("EditorIcons")),
  141. search_options->get_theme_icon(SNAME("PackedStringArray"), SNAME("EditorIcons")),
  142. search_options->get_theme_icon(SNAME("PackedVector2Array"), SNAME("EditorIcons")),
  143. search_options->get_theme_icon(SNAME("PackedVector3Array"), SNAME("EditorIcons")),
  144. search_options->get_theme_icon(SNAME("PackedColorArray"), SNAME("EditorIcons"))
  145. };
  146. static_assert((sizeof(type_icons) / sizeof(type_icons[0])) == Variant::VARIANT_MAX, "Number of type icons doesn't match the number of Variant types.");
  147. for (const PropertyInfo &E : props) {
  148. if (E.usage == PROPERTY_USAGE_CATEGORY) {
  149. if (category && category->get_first_child() == nullptr) {
  150. memdelete(category); //old category was unused
  151. }
  152. category = search_options->create_item(root);
  153. category->set_text(0, E.name);
  154. category->set_selectable(0, false);
  155. Ref<Texture2D> icon;
  156. if (E.name == "Script Variables") {
  157. icon = search_options->get_theme_icon(SNAME("Script"), SNAME("EditorIcons"));
  158. } else {
  159. icon = EditorNode::get_singleton()->get_class_icon(E.name);
  160. }
  161. category->set_icon(0, icon);
  162. continue;
  163. }
  164. if (!(E.usage & PROPERTY_USAGE_EDITOR) && !(E.usage & PROPERTY_USAGE_SCRIPT_VARIABLE)) {
  165. continue;
  166. }
  167. if (!search_box->get_text().is_empty() && E.name.findn(search_text) == -1) {
  168. continue;
  169. }
  170. if (type_filter.size() && !type_filter.has(E.type)) {
  171. continue;
  172. }
  173. TreeItem *item = search_options->create_item(category ? category : root);
  174. item->set_text(0, E.name);
  175. item->set_metadata(0, E.name);
  176. item->set_icon(0, type_icons[E.type]);
  177. if (!found && !search_box->get_text().is_empty() && E.name.findn(search_text) != -1) {
  178. item->select(0);
  179. found = true;
  180. }
  181. item->set_selectable(0, true);
  182. }
  183. if (category && category->get_first_child() == nullptr) {
  184. memdelete(category); //old category was unused
  185. }
  186. } else {
  187. List<MethodInfo> methods;
  188. if (type != Variant::NIL) {
  189. Variant v;
  190. Callable::CallError ce;
  191. Variant::construct(type, v, nullptr, 0, ce);
  192. v.get_method_list(&methods);
  193. } else {
  194. Ref<Script> script_ref = Object::cast_to<Script>(ObjectDB::get_instance(script));
  195. if (script_ref.is_valid()) {
  196. methods.push_back(MethodInfo("*Script Methods"));
  197. if (script_ref->is_built_in()) {
  198. script_ref->reload(true);
  199. }
  200. script_ref->get_script_method_list(&methods);
  201. }
  202. StringName base = base_type;
  203. while (base) {
  204. methods.push_back(MethodInfo("*" + String(base)));
  205. ClassDB::get_method_list(base, &methods, true, true);
  206. base = ClassDB::get_parent_class(base);
  207. }
  208. }
  209. TreeItem *category = nullptr;
  210. bool found = false;
  211. bool script_methods = false;
  212. for (MethodInfo &mi : methods) {
  213. if (mi.name.begins_with("*")) {
  214. if (category && category->get_first_child() == nullptr) {
  215. memdelete(category); //old category was unused
  216. }
  217. category = search_options->create_item(root);
  218. category->set_text(0, mi.name.replace_first("*", ""));
  219. category->set_selectable(0, false);
  220. Ref<Texture2D> icon;
  221. script_methods = false;
  222. String rep = mi.name.replace("*", "");
  223. if (mi.name == "*Script Methods") {
  224. icon = search_options->get_theme_icon(SNAME("Script"), SNAME("EditorIcons"));
  225. script_methods = true;
  226. } else {
  227. icon = EditorNode::get_singleton()->get_class_icon(rep);
  228. }
  229. category->set_icon(0, icon);
  230. continue;
  231. }
  232. String name = mi.name.get_slice(":", 0);
  233. if (!script_methods && name.begins_with("_") && !(mi.flags & METHOD_FLAG_VIRTUAL)) {
  234. continue;
  235. }
  236. if (virtuals_only && !(mi.flags & METHOD_FLAG_VIRTUAL)) {
  237. continue;
  238. }
  239. if (!virtuals_only && (mi.flags & METHOD_FLAG_VIRTUAL)) {
  240. continue;
  241. }
  242. if (!search_box->get_text().is_empty() && name.findn(search_text) == -1) {
  243. continue;
  244. }
  245. TreeItem *item = search_options->create_item(category ? category : root);
  246. String desc;
  247. if (mi.name.contains(":")) {
  248. desc = mi.name.get_slice(":", 1) + " ";
  249. mi.name = mi.name.get_slice(":", 0);
  250. } else if (mi.return_val.type != Variant::NIL) {
  251. desc = Variant::get_type_name(mi.return_val.type);
  252. } else {
  253. desc = "void";
  254. }
  255. desc += vformat(" %s(", mi.name);
  256. for (int i = 0; i < mi.arguments.size(); i++) {
  257. if (i > 0) {
  258. desc += ", ";
  259. }
  260. desc += mi.arguments[i].name;
  261. if (mi.arguments[i].type == Variant::NIL) {
  262. desc += ": Variant";
  263. } else if (mi.arguments[i].name.contains(":")) {
  264. desc += vformat(": %s", mi.arguments[i].name.get_slice(":", 1));
  265. mi.arguments[i].name = mi.arguments[i].name.get_slice(":", 0);
  266. } else {
  267. desc += vformat(": %s", Variant::get_type_name(mi.arguments[i].type));
  268. }
  269. }
  270. desc += ")";
  271. if (mi.flags & METHOD_FLAG_CONST) {
  272. desc += " const";
  273. }
  274. if (mi.flags & METHOD_FLAG_VIRTUAL) {
  275. desc += " virtual";
  276. }
  277. item->set_text(0, desc);
  278. item->set_metadata(0, name);
  279. item->set_selectable(0, true);
  280. if (!found && !search_box->get_text().is_empty() && name.findn(search_text) != -1) {
  281. item->select(0);
  282. found = true;
  283. }
  284. }
  285. if (category && category->get_first_child() == nullptr) {
  286. memdelete(category); //old category was unused
  287. }
  288. }
  289. get_ok_button()->set_disabled(root->get_first_child() == nullptr);
  290. }
  291. void PropertySelector::_confirmed() {
  292. TreeItem *ti = search_options->get_selected();
  293. if (!ti) {
  294. return;
  295. }
  296. emit_signal(SNAME("selected"), ti->get_metadata(0));
  297. hide();
  298. }
  299. void PropertySelector::_item_selected() {
  300. help_bit->set_text("");
  301. TreeItem *item = search_options->get_selected();
  302. if (!item) {
  303. return;
  304. }
  305. String name = item->get_metadata(0);
  306. String class_type;
  307. if (type != Variant::NIL) {
  308. class_type = Variant::get_type_name(type);
  309. } else if (!base_type.is_empty()) {
  310. class_type = base_type;
  311. } else if (instance) {
  312. class_type = instance->get_class();
  313. }
  314. DocTools *dd = EditorHelp::get_doc_data();
  315. String text;
  316. if (properties) {
  317. while (!class_type.is_empty()) {
  318. HashMap<String, DocData::ClassDoc>::Iterator E = dd->class_list.find(class_type);
  319. if (E) {
  320. for (int i = 0; i < E->value.properties.size(); i++) {
  321. if (E->value.properties[i].name == name) {
  322. text = DTR(E->value.properties[i].description);
  323. break;
  324. }
  325. }
  326. }
  327. if (!text.is_empty()) {
  328. break;
  329. }
  330. // The property may be from a parent class, keep looking.
  331. class_type = ClassDB::get_parent_class(class_type);
  332. }
  333. } else {
  334. while (!class_type.is_empty()) {
  335. HashMap<String, DocData::ClassDoc>::Iterator E = dd->class_list.find(class_type);
  336. if (E) {
  337. for (int i = 0; i < E->value.methods.size(); i++) {
  338. if (E->value.methods[i].name == name) {
  339. text = DTR(E->value.methods[i].description);
  340. break;
  341. }
  342. }
  343. }
  344. if (!text.is_empty()) {
  345. break;
  346. }
  347. // The method may be from a parent class, keep looking.
  348. class_type = ClassDB::get_parent_class(class_type);
  349. }
  350. }
  351. if (!text.is_empty()) {
  352. // Display both property name and description, since the help bit may be displayed
  353. // far away from the location (especially if the dialog was resized to be taller).
  354. help_bit->set_text(vformat("[b]%s[/b]: %s", name, text));
  355. help_bit->get_rich_text()->set_self_modulate(Color(1, 1, 1, 1));
  356. } else {
  357. // Use nested `vformat()` as translators shouldn't interfere with BBCode tags.
  358. help_bit->set_text(vformat(TTR("No description available for %s."), vformat("[b]%s[/b]", name)));
  359. help_bit->get_rich_text()->set_self_modulate(Color(1, 1, 1, 0.5));
  360. }
  361. }
  362. void PropertySelector::_hide_requested() {
  363. _cancel_pressed(); // From AcceptDialog.
  364. }
  365. void PropertySelector::_notification(int p_what) {
  366. switch (p_what) {
  367. case NOTIFICATION_ENTER_TREE: {
  368. connect("confirmed", callable_mp(this, &PropertySelector::_confirmed));
  369. } break;
  370. case NOTIFICATION_EXIT_TREE: {
  371. disconnect("confirmed", callable_mp(this, &PropertySelector::_confirmed));
  372. } break;
  373. }
  374. }
  375. void PropertySelector::select_method_from_base_type(const String &p_base, const String &p_current, bool p_virtuals_only) {
  376. base_type = p_base;
  377. selected = p_current;
  378. type = Variant::NIL;
  379. script = ObjectID();
  380. properties = false;
  381. instance = nullptr;
  382. virtuals_only = p_virtuals_only;
  383. popup_centered_ratio(0.6);
  384. search_box->set_text("");
  385. search_box->grab_focus();
  386. _update_search();
  387. }
  388. void PropertySelector::select_method_from_script(const Ref<Script> &p_script, const String &p_current) {
  389. ERR_FAIL_COND(p_script.is_null());
  390. base_type = p_script->get_instance_base_type();
  391. selected = p_current;
  392. type = Variant::NIL;
  393. script = p_script->get_instance_id();
  394. properties = false;
  395. instance = nullptr;
  396. virtuals_only = false;
  397. popup_centered_ratio(0.6);
  398. search_box->set_text("");
  399. search_box->grab_focus();
  400. _update_search();
  401. }
  402. void PropertySelector::select_method_from_basic_type(Variant::Type p_type, const String &p_current) {
  403. ERR_FAIL_COND(p_type == Variant::NIL);
  404. base_type = "";
  405. selected = p_current;
  406. type = p_type;
  407. script = ObjectID();
  408. properties = false;
  409. instance = nullptr;
  410. virtuals_only = false;
  411. popup_centered_ratio(0.6);
  412. search_box->set_text("");
  413. search_box->grab_focus();
  414. _update_search();
  415. }
  416. void PropertySelector::select_method_from_instance(Object *p_instance, const String &p_current) {
  417. base_type = p_instance->get_class();
  418. selected = p_current;
  419. type = Variant::NIL;
  420. script = ObjectID();
  421. {
  422. Ref<Script> scr = p_instance->get_script();
  423. if (scr.is_valid()) {
  424. script = scr->get_instance_id();
  425. }
  426. }
  427. properties = false;
  428. instance = nullptr;
  429. virtuals_only = false;
  430. popup_centered_ratio(0.6);
  431. search_box->set_text("");
  432. search_box->grab_focus();
  433. _update_search();
  434. }
  435. void PropertySelector::select_property_from_base_type(const String &p_base, const String &p_current) {
  436. base_type = p_base;
  437. selected = p_current;
  438. type = Variant::NIL;
  439. script = ObjectID();
  440. properties = true;
  441. instance = nullptr;
  442. virtuals_only = false;
  443. popup_centered_ratio(0.6);
  444. search_box->set_text("");
  445. search_box->grab_focus();
  446. _update_search();
  447. }
  448. void PropertySelector::select_property_from_script(const Ref<Script> &p_script, const String &p_current) {
  449. ERR_FAIL_COND(p_script.is_null());
  450. base_type = p_script->get_instance_base_type();
  451. selected = p_current;
  452. type = Variant::NIL;
  453. script = p_script->get_instance_id();
  454. properties = true;
  455. instance = nullptr;
  456. virtuals_only = false;
  457. popup_centered_ratio(0.6);
  458. search_box->set_text("");
  459. search_box->grab_focus();
  460. _update_search();
  461. }
  462. void PropertySelector::select_property_from_basic_type(Variant::Type p_type, const String &p_current) {
  463. ERR_FAIL_COND(p_type == Variant::NIL);
  464. base_type = "";
  465. selected = p_current;
  466. type = p_type;
  467. script = ObjectID();
  468. properties = true;
  469. instance = nullptr;
  470. virtuals_only = false;
  471. popup_centered_ratio(0.6);
  472. search_box->set_text("");
  473. search_box->grab_focus();
  474. _update_search();
  475. }
  476. void PropertySelector::select_property_from_instance(Object *p_instance, const String &p_current) {
  477. base_type = "";
  478. selected = p_current;
  479. type = Variant::NIL;
  480. script = ObjectID();
  481. properties = true;
  482. instance = p_instance;
  483. virtuals_only = false;
  484. popup_centered_ratio(0.6);
  485. search_box->set_text("");
  486. search_box->grab_focus();
  487. _update_search();
  488. }
  489. void PropertySelector::set_type_filter(const Vector<Variant::Type> &p_type_filter) {
  490. type_filter = p_type_filter;
  491. }
  492. void PropertySelector::_bind_methods() {
  493. ADD_SIGNAL(MethodInfo("selected", PropertyInfo(Variant::STRING, "name")));
  494. }
  495. PropertySelector::PropertySelector() {
  496. VBoxContainer *vbc = memnew(VBoxContainer);
  497. add_child(vbc);
  498. //set_child_rect(vbc);
  499. search_box = memnew(LineEdit);
  500. vbc->add_margin_child(TTR("Search:"), search_box);
  501. search_box->connect("text_changed", callable_mp(this, &PropertySelector::_text_changed));
  502. search_box->connect("gui_input", callable_mp(this, &PropertySelector::_sbox_input));
  503. search_options = memnew(Tree);
  504. vbc->add_margin_child(TTR("Matches:"), search_options, true);
  505. set_ok_button_text(TTR("Open"));
  506. get_ok_button()->set_disabled(true);
  507. register_text_enter(search_box);
  508. set_hide_on_ok(false);
  509. search_options->connect("item_activated", callable_mp(this, &PropertySelector::_confirmed));
  510. search_options->connect("cell_selected", callable_mp(this, &PropertySelector::_item_selected));
  511. search_options->set_hide_root(true);
  512. search_options->set_hide_folding(true);
  513. help_bit = memnew(EditorHelpBit);
  514. vbc->add_margin_child(TTR("Description:"), help_bit);
  515. help_bit->connect("request_hide", callable_mp(this, &PropertySelector::_hide_requested));
  516. }