64 const std::optional<blender::StringRef> tip,
65 const bool use_previews,
73 static_cast<ID *
>(active_ptr.
data) :
75 const ID *idfrom =
ptr->owner_id;
85 const bool use_preview_icon = use_big_size || (
id && (
GS(id->
name) !=
ID_SCR));
86 const short width =
UI_UNIT_X * (use_big_size ? 6 : 1.6f);
87 const short height =
UI_UNIT_Y * (use_big_size ? 6 : 1);
107 if (use_preview_icon) {
120 (
col ?
col : layout)->row(
true);
162 const int preview_rows,
163 const int preview_cols,
166 static char search[256];
178 if (preview_rows > 0 && preview_cols > 0) {
179 const int w = 4 *
U.widget_unit * preview_cols * scale;
184 uiDefBut(block,
ButType::Label, 0,
"", 0,
UI_UNIT_Y,
w, h,
nullptr, 0, 0, std::nullopt);
261 const std::optional<StringRefNull> text)
296 block,
ButType::NodeSocket, 0,
"", 0, 0,
UI_UNIT_X,
UI_UNIT_Y,
nullptr, 0, 0,
"");
bScreen * CTX_wm_screen(const bContext *C)
SpaceFile * CTX_wm_space_file(const bContext *C)
wmWindow * CTX_wm_window(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
MINLINE void rgba_float_to_uchar(unsigned char r_col[4], const float col_f[4])
#define ID_IS_EDITABLE(_id)
void ED_file_path_button(bScreen *screen, const SpaceFile *sfile, FileSelectParams *params, uiBlock *block)
int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco)
#define RNA_warning(format,...)
void UI_block_theme_style_set(uiBlock *block, char theme_style)
void UI_but_focus_on_enter_event(wmWindow *win, uiBut *but)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, blender::ui::EmbossType emboss)
void UI_block_bounds_set_normal(uiBlock *block, int addval)
void UI_but_func_search_set(uiBut *but, uiButSearchCreateFn search_create_fn, uiButSearchUpdateFn search_update_fn, void *arg, bool free_arg, uiFreeArgFunc search_arg_free_fn, uiButHandleFunc search_exec_fn, void *active)
void UI_but_drawflag_enable(uiBut *but, int flag)
void UI_but_func_search_set_tooltip(uiBut *but, uiButSearchTooltipFn tooltip_fn)
uiBut * uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxncpy, int x, int y, short width, short height, std::optional< blender::StringRef > tip)
int UI_searchbox_size_x_guess(const bContext *C, const uiButSearchUpdateFn update_fn, void *arg)
void *(*)(const void *argN) uiButArgNCopy
void(*)(void *argN) uiButArgNFree
uiBlock *(*)(bContext *C, ARegion *region, void *arg1) uiBlockCreateFunc
ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active) uiButSearchTooltipFn
#define UI_SEARCHBOX_BOUNDS
void UI_block_align_begin(uiBlock *block)
int UI_searchbox_size_y()
int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void(*)(const bContext *C, void *arg, const char *str, uiSearchItems *items, bool is_first) uiButSearchUpdateFn
void(*)(bContext *C, void *arg1, void *arg2) uiButHandleFunc
void UI_block_direction_set(uiBlock *block, char direction)
@ UI_BLOCK_THEME_STYLE_POPUP
void UI_block_flag_enable(uiBlock *block, int flag)
void UI_but_drag_set_id(uiBut *but, ID *id)
void UI_but_search_preview_grid_size_set(uiBut *but, int rows, int cols)
uiBut * uiDefBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_but_flag_enable(uiBut *but, int flag)
uiBut * uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, blender::StringRef str, int x, int y, short width, short height, std::optional< blender::StringRef > tip, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
#define UI_SEARCHBOX_TRIA_H
void UI_block_align_end(uiBlock *block)
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
constexpr const char * c_str() const
void ui_def_but_icon(uiBut *but, const int icon, const int flag)
int ui_id_icon_get(const bContext *C, ID *id, const bool big)
ARegion * ui_searchbox_create_generic(bContext *C, ARegion *butregion, uiButSearch *search_but)
void template_add_button_search_menu(const bContext *C, uiLayout *layout, uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, uiBlockCreateFunc block_func, void *block_argN, const std::optional< blender::StringRef > tip, const bool use_previews, const bool editable, const bool live_icon, uiButArgNFree func_argN_free_fn, uiButArgNCopy func_argN_copy_fn)
void uiTemplatePathBuilder(uiLayout *layout, PointerRNA *ptr, const StringRefNull propname, PointerRNA *, const std::optional< StringRefNull > text)
void uiTemplateNodeSocket(uiLayout *layout, bContext *, const float color[4])
void uiTemplateFileSelectPath(uiLayout *layout, bContext *C, FileSelectParams *params)
int template_search_textbut_height()
int template_search_textbut_width(PointerRNA *ptr, PropertyRNA *name_prop)
uiBlock * template_common_search_menu(const bContext *C, ARegion *region, uiButSearchUpdateFn search_update_fn, void *search_arg, uiButHandleFunc search_exec_fn, void *active_item, uiButSearchTooltipFn item_tooltip_fn, const int preview_rows, const int preview_cols, float scale)
void uiTemplateHeader(uiLayout *layout, bContext *C)
#define TEMPLATE_SEARCH_TEXTBUT_HEIGHT
#define TEMPLATE_SEARCH_TEXTBUT_MIN_WIDTH
void MEM_freeN(void *vmemh)
bool RNA_struct_is_ID(const StructRNA *type)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
PropertyType RNA_property_type(PropertyRNA *prop)
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_struct_identifier(const StructRNA *type)
int RNA_struct_ui_icon(const StructRNA *type)
uiBlock * absolute_block()
uiLayout & column(bool align)
uiLayout & row(bool align)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)