64 const std::optional<StringRef> tip,
65 const bool use_previews,
84 const bool use_preview_icon = use_big_size || (
id && (
GS(
id->name) !=
ID_SCR));
85 const short width =
UI_UNIT_X * (use_big_size ? 6 : 1.6f);
86 const short height =
UI_UNIT_Y * (use_big_size ? 6 : 1);
92 col = &layout.
column(
true);
106 if (use_preview_icon) {
119 (col ? col : &layout)->row(
true);
161 const int preview_rows,
162 const int preview_cols,
165 static char search[256];
177 if (preview_rows > 0 && preview_cols > 0) {
178 const int w = 4 *
U.widget_unit * preview_cols *
scale;
183 uiDefBut(block,
ButtonType::Label,
"", 0,
UI_UNIT_Y,
w, h,
nullptr, 0, 0, std::nullopt);
259 const std::optional<StringRefNull> text)
294 block,
ButtonType::NodeSocket,
"", 0, 0,
UI_UNIT_X,
UI_UNIT_Y,
nullptr, 0, 0,
"");
#define ID_IS_EDITABLE(_id)
#define RNA_warning(format,...)
#define UI_SEARCHBOX_BOUNDS
#define UI_SEARCHBOX_TRIA_H
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
constexpr const char * c_str() const
float3x3 scale(float3x3 mat, float2 scale)
#define TEMPLATE_SEARCH_TEXTBUT_HEIGHT
#define TEMPLATE_SEARCH_TEXTBUT_MIN_WIDTH
void button_search_preview_grid_size_set(Button *but, int rows, int cols)
void template_file_select_path(Layout *layout, bContext *C, FileSelectParams *params)
void block_direction_set(Block *block, char direction)
int template_search_textbut_width(PointerRNA *ptr, PropertyRNA *name_prop)
@ BLOCK_THEME_STYLE_POPUP
void(*)(bContext *C, void *arg1, void *arg2) ButtonHandleFunc
void block_bounds_set_normal(Block *block, int addval)
int fontstyle_string_width(const uiFontStyle *fs, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void template_add_button_search_menu(const bContext *C, Layout &layout, Block *block, PointerRNA *ptr, PropertyRNA *prop, BlockCreateFunc block_func, void *block_argN, const std::optional< StringRef > tip, const bool use_previews, const bool editable, const bool live_icon, ButtonArgNFree func_argN_free_fn, ButtonArgNCopy func_argN_copy_fn)
void block_align_begin(Block *block)
void template_header(Layout *layout, bContext *C)
Block * template_common_search_menu(const bContext *C, ARegion *region, ButtonSearchUpdateFn search_update_fn, void *search_arg, ButtonHandleFunc search_exec_fn, void *active_item, ButtonSearchTooltipFn item_tooltip_fn, const int preview_rows, const int preview_cols, float scale)
void block_flag_enable(Block *block, int flag)
ARegion *(*)(bContext *C, ARegion *region, const rcti *item_rect, void *arg, void *active) ButtonSearchTooltipFn
int id_icon_get(const bContext *C, ID *id, const bool big)
void button_focus_on_enter_event(wmWindow *win, Button *but)
int searchbox_size_x_guess(const bContext *C, const ButtonSearchUpdateFn update_fn, void *arg)
void button_drawflag_enable(Button *but, int flag)
void template_node_socket(Layout *layout, bContext *C, const float color[4])
void button_flag_enable(Button *but, int64_t flag)
Block * block_begin(const bContext *C, ARegion *region, std::string name, EmbossType emboss)
Button * uiDefBut(Block *block, ButtonTypeWithPointerType but_and_ptr_type, StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< StringRef > tip)
Block *(*)(bContext *C, ARegion *region, void *arg1) BlockCreateFunc
void *(*)(const void *argN) ButtonArgNCopy
Button * uiDefSearchBut(Block *block, void *arg, int icon, int maxncpy, int x, int y, short width, short height, std::optional< StringRef > tip)
void block_theme_style_set(Block *block, char theme_style)
void block_align_end(Block *block)
void def_but_icon(Button *but, const int icon, const int64_t flag)
ARegion * searchbox_create_generic(bContext *C, ARegion *butregion, ButtonSearch *search_but)
void(*)(const bContext *C, void *arg, const char *str, SearchItems *items, bool is_first) ButtonSearchUpdateFn
Button * uiDefBlockButN(Block *block, BlockCreateFunc func, void *argN, StringRef str, int x, int y, short width, short height, std::optional< StringRef > tip, ButtonArgNFree func_argN_free_fn=MEM_delete_void, ButtonArgNCopy func_argN_copy_fn=MEM_dupalloc_void)
void template_path_builder(Layout *layout, PointerRNA *ptr, StringRefNull propname, PointerRNA *root_ptr, std::optional< StringRefNull > text)
void(*)(void *argN) ButtonArgNFree
void button_func_search_set(Button *but, ButtonSearchCreateFn search_create_fn, ButtonSearchUpdateFn search_update_fn, void *arg, bool free_arg, FreeArgFunc search_arg_free_fn, ButtonHandleFunc search_exec_fn, void *active)
void button_func_search_set_tooltip(Button *but, ButtonSearchTooltipFn tooltip_fn)
int template_search_textbut_height()
void button_drag_set_id(Button *but, ID *id)
char * RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fixedbuf, int fixedlen, int *r_len)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
wmWindow * CTX_wm_window(const bContext *C)
PropertyType RNA_property_type(PropertyRNA *prop)
StructRNA * RNA_property_pointer_type(PointerRNA *ptr, PropertyRNA *prop)
void ED_file_path_button(bScreen *screen, SpaceFile *sfile, FileSelectParams *params, ui::Block *block)
int RNA_struct_ui_icon(const StructRNA *type)
bool RNA_struct_is_ID(const StructRNA *type)
const char * RNA_struct_identifier(const StructRNA *type)
ID_Type GS(const char *name)
int ED_area_header_switchbutton(const bContext *C, ui::Block *block, int yco)
SpaceFile * CTX_wm_space_file(const bContext *C)
bScreen * CTX_wm_screen(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])
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< StringRef > name_opt, int icon, std::optional< StringRef > placeholder=std::nullopt)
Layout & column(bool align)
Layout & absolute(bool align=false)