Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
godotengine
GitHub Repository: godotengine/godot
Path: blob/master/editor/inspector/property_selector.cpp
20829 views
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
31
#include "property_selector.h"
32
33
#include "editor/doc/editor_help.h"
34
#include "editor/editor_node.h"
35
#include "editor/gui/filter_line_edit.h"
36
#include "editor/themes/editor_scale.h"
37
#include "scene/gui/margin_container.h"
38
#include "scene/gui/tree.h"
39
40
void PropertySelector::_text_changed(const String &p_newtext) {
41
_update_search();
42
}
43
44
void PropertySelector::_update_search() {
45
if (properties) {
46
set_title(TTRC("Select Property"));
47
} else if (virtuals_only) {
48
set_title(TTRC("Select Virtual Method"));
49
} else {
50
set_title(TTRC("Select Method"));
51
}
52
53
search_options->clear();
54
help_bit->set_custom_text(String(), String(), String());
55
56
TreeItem *root = search_options->create_item();
57
58
// Allow using spaces in place of underscores in the search string (makes the search more fault-tolerant).
59
const String search_text = search_box->get_text().replace_char(' ', '_');
60
61
if (properties) {
62
List<PropertyInfo> props;
63
64
if (instance) {
65
instance->get_property_list(&props, true);
66
} else if (type != Variant::NIL) {
67
Variant v;
68
Callable::CallError ce;
69
Variant::construct(type, v, nullptr, 0, ce);
70
71
v.get_property_list(&props);
72
} else {
73
Object *obj = ObjectDB::get_instance(script);
74
if (Object::cast_to<Script>(obj)) {
75
props.push_back(PropertyInfo(Variant::NIL, "Script Variables", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_CATEGORY));
76
Object::cast_to<Script>(obj)->get_script_property_list(&props);
77
}
78
79
StringName base = base_type;
80
while (base) {
81
props.push_back(PropertyInfo(Variant::NIL, base, PROPERTY_HINT_NONE, "", PROPERTY_USAGE_CATEGORY));
82
ClassDB::get_property_list(base, &props, true);
83
base = ClassDB::get_parent_class(base);
84
}
85
}
86
87
TreeItem *category = nullptr;
88
89
bool found = false;
90
for (const PropertyInfo &E : props) {
91
if (E.usage == PROPERTY_USAGE_CATEGORY) {
92
if (category && category->get_first_child() == nullptr) {
93
memdelete(category); //old category was unused
94
}
95
category = search_options->create_item(root);
96
category->set_text(0, E.name);
97
category->set_selectable(0, false);
98
99
Ref<Texture2D> icon;
100
if (E.name == "Script Variables") {
101
icon = search_options->get_editor_theme_icon(SNAME("Script"));
102
} else {
103
icon = EditorNode::get_singleton()->get_class_icon(E.name);
104
}
105
category->set_icon(0, icon);
106
continue;
107
}
108
109
if (!(E.usage & PROPERTY_USAGE_EDITOR) && !(E.usage & PROPERTY_USAGE_SCRIPT_VARIABLE)) {
110
continue;
111
}
112
113
if (!search_box->get_text().is_empty() && !E.name.containsn(search_text)) {
114
continue;
115
}
116
117
if (!type_filter.is_empty() && !type_filter.has(E.type)) {
118
continue;
119
}
120
121
TreeItem *item = search_options->create_item(category ? category : root);
122
item->set_text(0, E.name);
123
item->set_metadata(0, E.name);
124
item->set_icon(0, search_options->get_editor_theme_icon(Variant::get_type_name(E.type)));
125
126
if (!found && !search_box->get_text().is_empty() && E.name.containsn(search_text)) {
127
item->select(0);
128
found = true;
129
} else if (!found && search_box->get_text().is_empty() && E.name == selected) {
130
item->select(0);
131
found = true;
132
}
133
134
item->set_selectable(0, true);
135
136
_create_subproperties(item, E.type);
137
item->set_collapsed(true);
138
}
139
140
if (category && category->get_first_child() == nullptr) {
141
memdelete(category); //old category was unused
142
}
143
144
if (found) {
145
// As we call this while adding items, defer until list is completely populated.
146
callable_mp(search_options, &Tree::scroll_to_item).call_deferred(search_options->get_selected(), true);
147
}
148
149
} else {
150
List<MethodInfo> methods;
151
152
if (type != Variant::NIL) {
153
Variant v;
154
Callable::CallError ce;
155
Variant::construct(type, v, nullptr, 0, ce);
156
v.get_method_list(&methods);
157
} else {
158
Ref<Script> script_ref = ObjectDB::get_ref<Script>(script);
159
if (script_ref.is_valid()) {
160
if (script_ref->is_built_in()) {
161
script_ref->reload(true);
162
}
163
164
List<MethodInfo> script_methods;
165
script_ref->get_script_method_list(&script_methods);
166
167
methods.push_back(MethodInfo("*Script Methods")); // TODO: Split by inheritance.
168
169
for (const MethodInfo &mi : script_methods) {
170
if (mi.name.begins_with("@")) {
171
// GH-92782. GDScript inline setters/getters are historically present in `get_method_list()`
172
// and can be called using `Object.call()`. However, these functions are meant to be internal
173
// and their names are not valid identifiers, so let's hide them from the user.
174
continue;
175
}
176
methods.push_back(mi);
177
}
178
}
179
180
StringName base = base_type;
181
while (base) {
182
methods.push_back(MethodInfo("*" + String(base)));
183
ClassDB::get_method_list(base, &methods, true, true);
184
base = ClassDB::get_parent_class(base);
185
}
186
}
187
188
TreeItem *category = nullptr;
189
190
bool found = false;
191
bool script_methods = false;
192
193
for (MethodInfo &mi : methods) {
194
if (mi.name.begins_with("*")) {
195
if (category && category->get_first_child() == nullptr) {
196
memdelete(category); //old category was unused
197
}
198
category = search_options->create_item(root);
199
category->set_text(0, mi.name.replace_first("*", ""));
200
category->set_selectable(0, false);
201
202
Ref<Texture2D> icon;
203
script_methods = false;
204
String rep = mi.name.remove_char('*');
205
if (mi.name == "*Script Methods") {
206
icon = search_options->get_editor_theme_icon(SNAME("Script"));
207
script_methods = true;
208
} else {
209
icon = EditorNode::get_singleton()->get_class_icon(rep);
210
}
211
category->set_icon(0, icon);
212
213
continue;
214
}
215
216
String name = mi.name.get_slicec(':', 0);
217
if (!script_methods && name.begins_with("_") && !(mi.flags & METHOD_FLAG_VIRTUAL)) {
218
continue;
219
}
220
221
if (virtuals_only && !(mi.flags & METHOD_FLAG_VIRTUAL)) {
222
continue;
223
}
224
225
if (!virtuals_only && (mi.flags & METHOD_FLAG_VIRTUAL)) {
226
continue;
227
}
228
229
if (!search_box->get_text().is_empty() && !name.containsn(search_text)) {
230
continue;
231
}
232
233
TreeItem *item = search_options->create_item(category ? category : root);
234
235
String desc;
236
if (mi.name.contains_char(':')) {
237
desc = mi.name.get_slicec(':', 1) + " ";
238
mi.name = mi.name.get_slicec(':', 0);
239
} else if (mi.return_val.type != Variant::NIL) {
240
desc = Variant::get_type_name(mi.return_val.type);
241
} else {
242
desc = "void";
243
}
244
245
desc += vformat(" %s(", mi.name);
246
247
for (int64_t i = 0; i < mi.arguments.size(); ++i) {
248
PropertyInfo &arg = mi.arguments.write[i];
249
if (i > 0) {
250
desc += ", ";
251
}
252
253
desc += arg.name;
254
255
if (arg.type == Variant::NIL) {
256
desc += ": Variant";
257
} else if (arg.name.contains_char(':')) {
258
desc += vformat(": %s", arg.name.get_slicec(':', 1));
259
arg.name = arg.name.get_slicec(':', 0);
260
} else {
261
desc += vformat(": %s", Variant::get_type_name(arg.type));
262
}
263
}
264
265
if (mi.flags & METHOD_FLAG_VARARG) {
266
desc += mi.arguments.is_empty() ? "..." : ", ...";
267
}
268
269
desc += ")";
270
271
if (mi.flags & METHOD_FLAG_VARARG) {
272
desc += " vararg";
273
}
274
275
if (mi.flags & METHOD_FLAG_CONST) {
276
desc += " const";
277
}
278
279
if (mi.flags & METHOD_FLAG_VIRTUAL) {
280
desc += " virtual";
281
}
282
283
item->set_text(0, desc);
284
item->set_metadata(0, name);
285
item->set_selectable(0, true);
286
287
if (!found && !search_box->get_text().is_empty() && name.containsn(search_text)) {
288
item->select(0);
289
found = true;
290
} else if (!found && search_box->get_text().is_empty() && name == selected) {
291
item->select(0);
292
found = true;
293
}
294
}
295
296
if (category && category->get_first_child() == nullptr) {
297
memdelete(category); //old category was unused
298
}
299
300
if (found) {
301
// As we call this while adding items, defer until list is completely populated.
302
callable_mp(search_options, &Tree::scroll_to_item).call_deferred(search_options->get_selected(), true);
303
}
304
}
305
306
get_ok_button()->set_disabled(search_options->get_selected() == nullptr);
307
}
308
309
void PropertySelector::_confirmed() {
310
TreeItem *ti = search_options->get_selected();
311
if (!ti) {
312
return;
313
}
314
emit_signal(SNAME("selected"), ti->get_metadata(0));
315
hide();
316
}
317
318
void PropertySelector::_item_selected() {
319
help_bit->set_custom_text(String(), String(), String());
320
321
TreeItem *item = search_options->get_selected();
322
get_ok_button()->set_disabled(item == nullptr);
323
324
if (!item) {
325
return;
326
}
327
String name = item->get_metadata(0);
328
329
String class_type;
330
if (type != Variant::NIL) {
331
class_type = Variant::get_type_name(type);
332
} else if (!base_type.is_empty()) {
333
class_type = base_type;
334
} else if (instance) {
335
class_type = instance->get_class();
336
}
337
338
String text;
339
while (!class_type.is_empty()) {
340
if (properties) {
341
if (ClassDB::has_property(class_type, name, true)) {
342
help_bit->parse_symbol("property|" + class_type + "|" + name);
343
break;
344
}
345
} else {
346
if (ClassDB::has_method(class_type, name, true)) {
347
help_bit->parse_symbol("method|" + class_type + "|" + name);
348
break;
349
}
350
}
351
352
// It may be from a parent class, keep looking.
353
class_type = ClassDB::get_parent_class(class_type);
354
}
355
}
356
357
void PropertySelector::_hide_requested() {
358
_cancel_pressed(); // From AcceptDialog.
359
}
360
361
void PropertySelector::_create_subproperties(TreeItem *p_parent_item, Variant::Type p_type) {
362
switch (p_type) {
363
case Variant::VECTOR2: {
364
_create_subproperty(p_parent_item, "x", Variant::FLOAT);
365
_create_subproperty(p_parent_item, "y", Variant::FLOAT);
366
} break;
367
368
case Variant::VECTOR2I: {
369
_create_subproperty(p_parent_item, "x", Variant::INT);
370
_create_subproperty(p_parent_item, "y", Variant::INT);
371
} break;
372
373
case Variant::RECT2: {
374
_create_subproperty(p_parent_item, "position", Variant::VECTOR2);
375
_create_subproperty(p_parent_item, "size", Variant::VECTOR2);
376
_create_subproperty(p_parent_item, "end", Variant::VECTOR2);
377
} break;
378
379
case Variant::RECT2I: {
380
_create_subproperty(p_parent_item, "position", Variant::VECTOR2I);
381
_create_subproperty(p_parent_item, "size", Variant::VECTOR2I);
382
_create_subproperty(p_parent_item, "end", Variant::VECTOR2I);
383
} break;
384
385
case Variant::VECTOR3: {
386
_create_subproperty(p_parent_item, "x", Variant::FLOAT);
387
_create_subproperty(p_parent_item, "y", Variant::FLOAT);
388
_create_subproperty(p_parent_item, "z", Variant::FLOAT);
389
} break;
390
391
case Variant::VECTOR3I: {
392
_create_subproperty(p_parent_item, "x", Variant::INT);
393
_create_subproperty(p_parent_item, "y", Variant::INT);
394
_create_subproperty(p_parent_item, "z", Variant::INT);
395
} break;
396
397
case Variant::TRANSFORM2D: {
398
_create_subproperty(p_parent_item, "origin", Variant::VECTOR2);
399
_create_subproperty(p_parent_item, "x", Variant::VECTOR2);
400
_create_subproperty(p_parent_item, "y", Variant::VECTOR2);
401
} break;
402
403
case Variant::VECTOR4: {
404
_create_subproperty(p_parent_item, "x", Variant::FLOAT);
405
_create_subproperty(p_parent_item, "y", Variant::FLOAT);
406
_create_subproperty(p_parent_item, "z", Variant::FLOAT);
407
_create_subproperty(p_parent_item, "w", Variant::FLOAT);
408
} break;
409
410
case Variant::VECTOR4I: {
411
_create_subproperty(p_parent_item, "x", Variant::INT);
412
_create_subproperty(p_parent_item, "y", Variant::INT);
413
_create_subproperty(p_parent_item, "z", Variant::INT);
414
_create_subproperty(p_parent_item, "w", Variant::INT);
415
} break;
416
417
case Variant::PLANE: {
418
_create_subproperty(p_parent_item, "x", Variant::FLOAT);
419
_create_subproperty(p_parent_item, "y", Variant::FLOAT);
420
_create_subproperty(p_parent_item, "z", Variant::FLOAT);
421
_create_subproperty(p_parent_item, "normal", Variant::VECTOR3);
422
_create_subproperty(p_parent_item, "d", Variant::FLOAT);
423
} break;
424
425
case Variant::QUATERNION: {
426
_create_subproperty(p_parent_item, "x", Variant::FLOAT);
427
_create_subproperty(p_parent_item, "y", Variant::FLOAT);
428
_create_subproperty(p_parent_item, "z", Variant::FLOAT);
429
_create_subproperty(p_parent_item, "w", Variant::FLOAT);
430
} break;
431
432
case Variant::AABB: {
433
_create_subproperty(p_parent_item, "position", Variant::VECTOR3);
434
_create_subproperty(p_parent_item, "size", Variant::VECTOR3);
435
_create_subproperty(p_parent_item, "end", Variant::VECTOR3);
436
} break;
437
438
case Variant::BASIS: {
439
_create_subproperty(p_parent_item, "x", Variant::VECTOR3);
440
_create_subproperty(p_parent_item, "y", Variant::VECTOR3);
441
_create_subproperty(p_parent_item, "z", Variant::VECTOR3);
442
} break;
443
444
case Variant::TRANSFORM3D: {
445
_create_subproperty(p_parent_item, "basis", Variant::BASIS);
446
_create_subproperty(p_parent_item, "origin", Variant::VECTOR3);
447
} break;
448
449
case Variant::PROJECTION: {
450
_create_subproperty(p_parent_item, "x", Variant::VECTOR4);
451
_create_subproperty(p_parent_item, "y", Variant::VECTOR4);
452
_create_subproperty(p_parent_item, "z", Variant::VECTOR4);
453
_create_subproperty(p_parent_item, "w", Variant::VECTOR4);
454
} break;
455
456
case Variant::COLOR: {
457
_create_subproperty(p_parent_item, "r", Variant::FLOAT);
458
_create_subproperty(p_parent_item, "g", Variant::FLOAT);
459
_create_subproperty(p_parent_item, "b", Variant::FLOAT);
460
_create_subproperty(p_parent_item, "a", Variant::FLOAT);
461
_create_subproperty(p_parent_item, "r8", Variant::INT);
462
_create_subproperty(p_parent_item, "g8", Variant::INT);
463
_create_subproperty(p_parent_item, "b8", Variant::INT);
464
_create_subproperty(p_parent_item, "a8", Variant::INT);
465
_create_subproperty(p_parent_item, "h", Variant::FLOAT);
466
_create_subproperty(p_parent_item, "s", Variant::FLOAT);
467
_create_subproperty(p_parent_item, "v", Variant::FLOAT);
468
} break;
469
470
default: {
471
}
472
}
473
}
474
475
void PropertySelector::_create_subproperty(TreeItem *p_parent_item, const String &p_name, Variant::Type p_type) {
476
if (!type_filter.is_empty() && !type_filter.has(p_type)) {
477
return;
478
}
479
480
TreeItem *item = search_options->create_item(p_parent_item);
481
item->set_text(0, p_name);
482
item->set_metadata(0, String(p_parent_item->get_metadata(0)) + ":" + p_name);
483
item->set_icon(0, search_options->get_editor_theme_icon(Variant::get_type_name(p_type)));
484
485
_create_subproperties(item, p_type);
486
}
487
488
void PropertySelector::_notification(int p_what) {
489
switch (p_what) {
490
case NOTIFICATION_ENTER_TREE: {
491
connect(SceneStringName(confirmed), callable_mp(this, &PropertySelector::_confirmed));
492
} break;
493
494
case NOTIFICATION_EXIT_TREE: {
495
disconnect(SceneStringName(confirmed), callable_mp(this, &PropertySelector::_confirmed));
496
} break;
497
498
case NOTIFICATION_THEME_CHANGED: {
499
search_box->set_right_icon(get_editor_theme_icon(SNAME("Search")));
500
} break;
501
}
502
}
503
504
void PropertySelector::select_method_from_base_type(const String &p_base, const String &p_current, bool p_virtuals_only) {
505
base_type = p_base;
506
selected = p_current;
507
type = Variant::NIL;
508
script = ObjectID();
509
properties = false;
510
instance = nullptr;
511
virtuals_only = p_virtuals_only;
512
513
popup_centered_ratio(0.6);
514
search_box->set_text("");
515
search_box->grab_focus();
516
_update_search();
517
}
518
519
void PropertySelector::select_method_from_script(const Ref<Script> &p_script, const String &p_current) {
520
ERR_FAIL_COND(p_script.is_null());
521
base_type = p_script->get_instance_base_type();
522
selected = p_current;
523
type = Variant::NIL;
524
script = p_script->get_instance_id();
525
properties = false;
526
instance = nullptr;
527
virtuals_only = false;
528
529
popup_centered_ratio(0.6);
530
search_box->set_text("");
531
search_box->grab_focus();
532
_update_search();
533
}
534
535
void PropertySelector::select_method_from_basic_type(Variant::Type p_type, const String &p_current) {
536
ERR_FAIL_COND(p_type == Variant::NIL);
537
base_type = "";
538
selected = p_current;
539
type = p_type;
540
script = ObjectID();
541
properties = false;
542
instance = nullptr;
543
virtuals_only = false;
544
545
popup_centered_ratio(0.6);
546
search_box->set_text("");
547
search_box->grab_focus();
548
_update_search();
549
}
550
551
void PropertySelector::select_method_from_instance(Object *p_instance, const String &p_current) {
552
base_type = p_instance->get_class();
553
selected = p_current;
554
type = Variant::NIL;
555
script = ObjectID();
556
{
557
Ref<Script> scr = p_instance->get_script();
558
if (scr.is_valid()) {
559
script = scr->get_instance_id();
560
}
561
}
562
properties = false;
563
instance = nullptr;
564
virtuals_only = false;
565
566
popup_centered_ratio(0.6);
567
search_box->set_text("");
568
search_box->grab_focus();
569
_update_search();
570
}
571
572
void PropertySelector::select_property_from_base_type(const String &p_base, const String &p_current) {
573
base_type = p_base;
574
selected = p_current;
575
type = Variant::NIL;
576
script = ObjectID();
577
properties = true;
578
instance = nullptr;
579
virtuals_only = false;
580
581
popup_centered_ratio(0.6);
582
search_box->set_text("");
583
search_box->grab_focus();
584
_update_search();
585
}
586
587
void PropertySelector::select_property_from_script(const Ref<Script> &p_script, const String &p_current) {
588
ERR_FAIL_COND(p_script.is_null());
589
590
base_type = p_script->get_instance_base_type();
591
selected = p_current;
592
type = Variant::NIL;
593
script = p_script->get_instance_id();
594
properties = true;
595
instance = nullptr;
596
virtuals_only = false;
597
598
popup_centered_ratio(0.6);
599
search_box->set_text("");
600
search_box->grab_focus();
601
_update_search();
602
}
603
604
void PropertySelector::select_property_from_basic_type(Variant::Type p_type, const String &p_current) {
605
ERR_FAIL_COND(p_type == Variant::NIL);
606
base_type = "";
607
selected = p_current;
608
type = p_type;
609
script = ObjectID();
610
properties = true;
611
instance = nullptr;
612
virtuals_only = false;
613
614
popup_centered_ratio(0.6);
615
search_box->set_text("");
616
search_box->grab_focus();
617
_update_search();
618
}
619
620
void PropertySelector::select_property_from_instance(Object *p_instance, const String &p_current) {
621
base_type = "";
622
selected = p_current;
623
type = Variant::NIL;
624
script = ObjectID();
625
properties = true;
626
instance = p_instance;
627
virtuals_only = false;
628
629
popup_centered_ratio(0.6);
630
search_box->set_text("");
631
search_box->grab_focus();
632
_update_search();
633
}
634
635
void PropertySelector::set_type_filter(const Vector<Variant::Type> &p_type_filter) {
636
type_filter = p_type_filter;
637
}
638
639
void PropertySelector::_bind_methods() {
640
ADD_SIGNAL(MethodInfo("selected", PropertyInfo(Variant::STRING, "name")));
641
}
642
643
PropertySelector::PropertySelector() {
644
VBoxContainer *vbc = memnew(VBoxContainer);
645
add_child(vbc);
646
647
search_box = memnew(FilterLineEdit);
648
search_box->set_accessibility_name(TTRC("Search:"));
649
vbc->add_margin_child(TTRC("Search:"), search_box);
650
search_box->connect(SceneStringName(text_changed), callable_mp(this, &PropertySelector::_text_changed));
651
652
search_options = memnew(Tree);
653
search_box->set_forward_control(search_options);
654
search_options->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
655
search_options->set_scroll_hint_mode(Tree::SCROLL_HINT_MODE_BOTH);
656
MarginContainer *mc = vbc->add_margin_child(TTRC("Matches:"), search_options, true);
657
mc->set_theme_type_variation("NoBorderHorizontalWindow");
658
659
search_options->connect("item_activated", callable_mp(this, &PropertySelector::_confirmed));
660
search_options->connect("cell_selected", callable_mp(this, &PropertySelector::_item_selected));
661
search_options->set_hide_root(true);
662
663
help_bit = memnew(EditorHelpBit);
664
help_bit->set_content_height_limits(80 * EDSCALE, 80 * EDSCALE);
665
help_bit->connect("request_hide", callable_mp(this, &PropertySelector::_hide_requested));
666
vbc->add_margin_child(TTRC("Description:"), help_bit);
667
668
set_ok_button_text(TTRC("Open"));
669
get_ok_button()->set_disabled(true);
670
register_text_enter(search_box);
671
set_hide_on_ok(false);
672
}
673
674