69#ifdef USE_UI_POPOVER_ONCE
90#ifdef USE_UI_POPOVER_ONCE
144 const int block_margin =
U.widget_unit / 2;
201 const int bounds_offset[2] = {
209 int bounds_offset[2] = {0, 0};
216 uiBut *but =
nullptr;
217 uiBut *but_first =
nullptr;
218 for (
const std::unique_ptr<uiBut> &but_iter : block->
buttons) {
220 but_first = but_iter.get();
223 but = but_iter.get();
233 bounds_offset[0] = -(pup->
ui_size_x / 2);
251 if (pup->
keymap !=
nullptr) {
268 uiPopover *pup = MEM_new<uiPopover>(__func__);
282#ifdef USE_UI_POPOVER_ONCE
299 handle->
popup =
true;
323 if (pt->
poll && (pt->
poll(
C, pt) ==
false)) {
358 uiPopover *pup = MEM_new<uiPopover>(__func__);
359 if (ui_menu_width == 0) {
365 uiBut *but =
nullptr;
367 if (from_active_button) {
370 if (but ==
nullptr) {
383 pup->
block->
handle = MEM_new<uiPopupBlockHandle>(__func__);
420 handle->
popup =
true;
441#ifdef USE_UI_POPOVER_ONCE
444 pup->is_once =
false;
wmWindow * CTX_wm_window(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
MINLINE void copy_v2_v2_int(int r[2], const int a[2])
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
#define RGN_ALIGN_ENUM_FROM_MASK(align)
#define RGN_TYPE_IS_HEADER_ANY(regiontype)
Read Guarded memory(de)allocation.
@ UI_BLOCK_SHOW_SHORTCUT_ALWAYS
void UI_block_theme_style_set(uiBlock *block, char theme_style)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, blender::ui::EmbossType emboss)
void UI_block_bounds_set_popup(uiBlock *block, int addval, const int bounds_offset[2])
uiBut * UI_region_active_but_get(const ARegion *region)
void UI_block_bounds_set_normal(uiBlock *block, int addval)
const uiStyle * UI_style_get_dpi()
void UI_block_flag_disable(uiBlock *block, int flag)
void UI_popover_once_clear(uiPopover *pup)
bool UI_block_active_only_flagged_buttons(const bContext *C, ARegion *region, uiBlock *block)
void UI_popup_handlers_add(bContext *C, ListBase *handlers, uiPopupBlockHandle *popup, char flag)
void UI_block_region_set(uiBlock *block, ARegion *region)
void UI_block_direction_set(uiBlock *block, char direction)
@ UI_BLOCK_THEME_STYLE_POPUP
#define UI_DEFAULT_TEXT_POINTS
void UI_block_flag_enable(uiBlock *block, int flag)
void UI_paneltype_draw(bContext *C, PanelType *pt, uiLayout *layout)
void ui_block_to_window_fl(const ARegion *region, const uiBlock *block, float *x, float *y)
uiPopupBlockHandle * ui_popup_block_create(bContext *C, ARegion *butregion, uiBut *but, uiBlockCreateFunc create_func, uiBlockHandleCreateFunc handle_create_func, void *arg, uiFreeArgFunc arg_free, bool can_refresh)
void ui_item_paneltype_func(bContext *C, uiLayout *layout, void *arg_pt)
#define UI_POPOVER_WIDTH_UNITS
bool ui_block_is_menu(const uiBlock *block) ATTR_WARN_UNUSED_RESULT
bool ui_but_is_editable(const uiBut *but) ATTR_WARN_UNUSED_RESULT
std::function< void(bContext *, uiLayout *, PanelType *)> uiPopoverCreateFunc
#define UI_MENU_WIDTH_MIN
void UI_popover_end(bContext *C, uiPopover *pup, wmKeyMap *keymap)
static void ui_popover_create_block(bContext *C, ARegion *region, uiPopover *pup, blender::wm::OpCallContext opcontext)
static void ui_block_free_func_POPOVER(void *arg_pup)
static uiBlock * ui_block_func_POPOVER(bContext *C, uiPopupBlockHandle *handle, void *arg_pup)
wmOperatorStatus UI_popover_panel_invoke(bContext *C, const char *idname, bool keep_open, ReportList *reports)
uiLayout * UI_popover_layout(uiPopover *pup)
uiPopover * UI_popover_begin(bContext *C, int ui_menu_width, bool from_active_button)
uiPopupBlockHandle * ui_popover_panel_create(bContext *C, ARegion *butregion, uiBut *but, uiPopoverCreateFunc popover_func, const PanelType *panel_type)
static void popover_keymap_fn(wmKeyMap *, wmKeyMapItem *, void *user_data)
int2 block_layout_resolve(uiBlock *block)
uiLayout & block_layout(uiBlock *block, LayoutDirection direction, LayoutType type, int x, int y, int size, int em, int padding, const uiStyle *style)
ARegionRuntimeHandle * runtime
bool(* poll)(const bContext *C, PanelType *pt)
blender::float2 offset_units_xy
blender::Vector< std::unique_ptr< uiBut > > buttons
uiPopupBlockHandle * handle
const bContextStore * context
void operator_context_set(blender::wm::OpCallContext opcontext)
void context_copy(const bContextStore *context)
uiPopoverCreateFunc popover_func
const PanelType * panel_type
wmEventHandler_Keymap * keymap_handler
uiPopupBlockCreate popup_create_vars
int prev_bounds_offset[2]
struct wmEvent * eventstate
void WM_event_remove_keymap_handler(ListBase *handlers, wmKeyMap *keymap)
wmEventHandler_Keymap * WM_event_add_keymap_handler_priority(ListBase *handlers, wmKeyMap *keymap, int)
void WM_event_set_keymap_handler_post_callback(wmEventHandler_Keymap *handler, void(keymap_tag)(wmKeyMap *keymap, wmKeyMapItem *kmi, void *user_data), void *user_data)
void WM_event_add_mousemove(wmWindow *win)
PanelType * WM_paneltype_find(const StringRef idname, bool quiet)