UI: Input Placeholders #112104

Merged
Harley Acheson merged 32 commits from Harley/blender:placeholders into blender-v4.0-release 2023-10-11 00:47:20 +02:00
2 changed files with 4 additions and 2 deletions
Showing only changes of commit 6710f073aa - Show all commits

View File

@ -5926,17 +5926,18 @@ const char *UI_but_placeholder_get(uiBut *but)
const short idcode = RNA_type_to_ID_code(type);
if (idcode != 0) {
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 = N_("Search");
placeholder = CTX_IFACE_(BLT_I18NCONTEXT_ID_WINDOWMANAGER, "Search");
}
}
}
return IFACE_(placeholder);
return placeholder;
}
void UI_but_type_set_menu_from_pulldown(uiBut *but)

View File

@ -109,6 +109,7 @@ static void rna_uiItemR(uiLayout *layout,
/* Get translated name (label). */
name = rna_translate_ui_text(name, text_ctxt, nullptr, prop, translate);
placeholder = rna_translate_ui_text(placeholder, text_ctxt, nullptr, prop, translate);
if (slider) {
flag |= UI_ITEM_R_SLIDER;