Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_region_popup.c
| Show First 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Menu Block Creation | /** \name Menu Block Creation | ||||
| * \{ */ | * \{ */ | ||||
| static void ui_block_region_draw(const bContext *C, ARegion *ar) | static void ui_block_region_refresh(const bContext *C, ARegion *ar) | ||||
| { | { | ||||
| ScrArea *ctx_area = CTX_wm_area(C); | ScrArea *ctx_area = CTX_wm_area(C); | ||||
| ARegion *ctx_region = CTX_wm_region(C); | ARegion *ctx_region = CTX_wm_region(C); | ||||
| uiBlock *block; | uiBlock *block; | ||||
| if (ar->do_draw & RGN_DRAW_REFRESH_UI) { | if (ar->do_draw & RGN_DRAW_REFRESH_UI) { | ||||
| ScrArea *handle_ctx_area; | ScrArea *handle_ctx_area; | ||||
| ARegion *handle_ctx_region; | ARegion *handle_ctx_region; | ||||
| Show All 14 Lines | for (block = ar->uiblocks.first; block; block = block_next) { | ||||
| } | } | ||||
| ui_popup_block_refresh((bContext *)C, block->handle, NULL, NULL); | ui_popup_block_refresh((bContext *)C, block->handle, NULL, NULL); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| CTX_wm_area_set((bContext *)C, ctx_area); | CTX_wm_area_set((bContext *)C, ctx_area); | ||||
| CTX_wm_region_set((bContext *)C, ctx_region); | CTX_wm_region_set((bContext *)C, ctx_region); | ||||
| } | |||||
| static void ui_block_region_draw(const bContext *C, ARegion *ar) | |||||
| { | |||||
| uiBlock *block; | |||||
| for (block = ar->uiblocks.first; block; block = block->next) | for (block = ar->uiblocks.first; block; block = block->next) | ||||
| UI_block_draw(C, block); | UI_block_draw(C, block); | ||||
| } | } | ||||
| /** | /** | ||||
| * Use to refresh centered popups on screen resizing (for splash). | * Use to refresh centered popups on screen resizing (for splash). | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 313 Lines • ▼ Show 20 Lines | uiPopupBlockHandle *ui_popup_block_create( | ||||
| handle->can_refresh = true; | handle->can_refresh = true; | ||||
| /* create area region */ | /* create area region */ | ||||
| ar = ui_region_temp_add(CTX_wm_screen(C)); | ar = ui_region_temp_add(CTX_wm_screen(C)); | ||||
| handle->region = ar; | handle->region = ar; | ||||
| memset(&type, 0, sizeof(ARegionType)); | memset(&type, 0, sizeof(ARegionType)); | ||||
| type.draw = ui_block_region_draw; | type.draw = ui_block_region_draw; | ||||
| type.refresh = ui_block_region_refresh; | |||||
| type.regionid = RGN_TYPE_TEMPORARY; | type.regionid = RGN_TYPE_TEMPORARY; | ||||
| ar->type = &type; | ar->type = &type; | ||||
| UI_region_handlers_add(&ar->handlers); | UI_region_handlers_add(&ar->handlers); | ||||
| block = ui_popup_block_refresh(C, handle, butregion, but); | block = ui_popup_block_refresh(C, handle, butregion, but); | ||||
| handle = block->handle; | handle = block->handle; | ||||
| Show All 16 Lines | |||||