Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_utils.c
| Show First 20 Lines • Show All 399 Lines • ▼ Show 20 Lines | return UI_search_item_add(items, | ||||
| cis->iconid, | cis->iconid, | ||||
| cis->has_sep_char ? UI_BUT_HAS_SEP_CHAR : 0, | cis->has_sep_char ? UI_BUT_HAS_SEP_CHAR : 0, | ||||
| name_prefix_offset); | name_prefix_offset); | ||||
| } | } | ||||
| void ui_rna_collection_search_update_fn(const struct bContext *C, | void ui_rna_collection_search_update_fn(const struct bContext *C, | ||||
| void *arg, | void *arg, | ||||
| const char *str, | const char *str, | ||||
| uiSearchItems *items) | uiSearchItems *items, | ||||
| const bool is_first) | |||||
| { | { | ||||
| uiRNACollectionSearch *data = arg; | uiRNACollectionSearch *data = arg; | ||||
| const int flag = RNA_property_flag(data->target_prop); | const int flag = RNA_property_flag(data->target_prop); | ||||
| ListBase *items_list = MEM_callocN(sizeof(ListBase), "items_list"); | ListBase *items_list = MEM_callocN(sizeof(ListBase), "items_list"); | ||||
| const bool is_ptr_target = (RNA_property_type(data->target_prop) == PROP_POINTER); | const bool is_ptr_target = (RNA_property_type(data->target_prop) == PROP_POINTER); | ||||
| /* For non-pointer properties, UI code acts entirely based on the item's name. So the name has to | /* For non-pointer properties, UI code acts entirely based on the item's name. So the name has to | ||||
| * match the RNA name exactly. So only for pointer properties, the name can be modified to add | * match the RNA name exactly. So only for pointer properties, the name can be modified to add | ||||
| * further UI hints. */ | * further UI hints. */ | ||||
| const bool requires_exact_data_name = !is_ptr_target; | const bool requires_exact_data_name = !is_ptr_target; | ||||
| const bool skip_filter = data->search_but && !data->search_but->changed; | const bool skip_filter = is_first; | ||||
| char name_buf[UI_MAX_DRAW_STR]; | char name_buf[UI_MAX_DRAW_STR]; | ||||
| char *name; | char *name; | ||||
| bool has_id_icon = false; | bool has_id_icon = false; | ||||
| StringSearch *search = skip_filter ? NULL : BLI_string_search_new(); | StringSearch *search = skip_filter ? NULL : BLI_string_search_new(); | ||||
| /* build a temporary list of relevant items first */ | /* build a temporary list of relevant items first */ | ||||
| int item_index = 0; | int item_index = 0; | ||||
| ▲ Show 20 Lines • Show All 447 Lines • Show Last 20 Lines | |||||