UI: Improved Placeholder Defaults #113688

Merged
Harley Acheson merged 2 commits from Harley/blender:PlaceHolderDefaults into main 2023-10-13 18:53:42 +02:00
1 changed files with 5 additions and 5 deletions

View File

@ -5929,13 +5929,13 @@ const char *ui_but_placeholder_get(uiBut *but)
RNA_enum_name(rna_enum_id_type_items, idcode, &placeholder);
placeholder = CTX_IFACE_(BLT_I18NCONTEXT_ID_ID, placeholder);
}
}
else if (but->type == UI_BTYPE_TEXT) {
const char *identifier = RNA_property_identifier(but->rnaprop);
if (STR_ELEM(identifier, "search_filter", "filter_text", "filter_search")) {
placeholder = CTX_IFACE_(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "Search");
else if (type) {
placeholder = RNA_struct_ui_name(type);
}
}
else if (but->type == UI_BTYPE_TEXT && but->icon == ICON_VIEWZOOM) {
placeholder = CTX_IFACE_(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "Search");
}
Harley marked this conversation as resolved Outdated

Hrm, hardcoding the property names is, meeeh. I think better to check if the icon is the search icon. Unlikely, but in case this backfires too much, we can have a flag for search properties.

Hrm, hardcoding the property names is, meeeh. I think better to check if the icon is the search icon. Unlikely, but in case this backfires too much, we can have a flag for search properties.
}
return placeholder;