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 6 additions and 4 deletions
Showing only changes of commit 68b3b3b6ca - Show all commits

View File

@ -933,10 +933,6 @@ void UI_but_disable(uiBut *but, const char *disabled_hint);
void UI_but_type_set_menu_from_pulldown(uiBut *but);
/* Hint that describes the expected value when empty */
void UI_but_placeholder_set(uiBut *but, const char *placeholder_text);
const char *UI_but_placeholder_get(uiBut *but);
/**
* Special button case, only draw it when used actively, for outliner etc.
*

View File

@ -744,6 +744,12 @@ void ui_but_active_string_clear_and_exit(bContext *C, uiBut *but) ATTR_NONNULL()
void ui_but_set_string_interactive(bContext *C, uiBut *but, const char *value);
uiBut *ui_but_drag_multi_edit_get(uiBut *but);
Harley marked this conversation as resolved Outdated

My earlier comment was only about UI_but_placeholder_get(). The setter makes sense in the public API, it's also part of the public Python API. If that can override the placeholder, other external UI code should be able to as well.

Convention is also to prefix internal functions with ui_, not UI_.

My earlier comment was only about `UI_but_placeholder_get()`. The setter makes sense in the public API, it's also part of the public Python API. If that can override the placeholder, other external UI code should be able to as well. Convention is also to prefix internal functions with `ui_`, not `UI_`.
/**
* Hint that describes the expected value when empty.
*/
void UI_but_placeholder_set(uiBut *but, const char *placeholder_text);
const char *UI_but_placeholder_get(uiBut *but);
void ui_def_but_icon(uiBut *but, int icon, int flag);
/**
* Avoid using this where possible since it's better not to ask for an icon in the first place.