Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_region_popup.c
| Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
| #include "interface_intern.h" | #include "interface_intern.h" | ||||
| #include "interface_regions_intern.h" | #include "interface_regions_intern.h" | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Utility Functions | /** \name Utility Functions | ||||
| * \{ */ | * \{ */ | ||||
| /** | |||||
| * Translate any popup regions (so we can drag them). | |||||
| */ | |||||
| void ui_popup_translate(ARegion *region, const int mdiff[2]) | void ui_popup_translate(ARegion *region, const int mdiff[2]) | ||||
| { | { | ||||
| BLI_rcti_translate(®ion->winrct, UNPACK2(mdiff)); | BLI_rcti_translate(®ion->winrct, UNPACK2(mdiff)); | ||||
| ED_region_update_rect(region); | ED_region_update_rect(region); | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| ▲ Show 20 Lines • Show All 482 Lines • ▼ Show 20 Lines | if (BLI_listbase_is_empty(&screen->regionbase)) { | ||||
| win->tag_cursor_refresh = true; | win->tag_cursor_refresh = true; | ||||
| } | } | ||||
| if (handle->scrolltimer) { | if (handle->scrolltimer) { | ||||
| WM_event_remove_timer(wm, win, handle->scrolltimer); | WM_event_remove_timer(wm, win, handle->scrolltimer); | ||||
| } | } | ||||
| } | } | ||||
| /** | |||||
| * Called for creating new popups and refreshing existing ones. | |||||
| */ | |||||
| uiBlock *ui_popup_block_refresh(bContext *C, | uiBlock *ui_popup_block_refresh(bContext *C, | ||||
| uiPopupBlockHandle *handle, | uiPopupBlockHandle *handle, | ||||
| ARegion *butregion, | ARegion *butregion, | ||||
| uiBut *but) | uiBut *but) | ||||
| { | { | ||||
| const int margin = UI_POPUP_MARGIN; | const int margin = UI_POPUP_MARGIN; | ||||
| wmWindow *window = CTX_wm_window(C); | wmWindow *window = CTX_wm_window(C); | ||||
| ARegion *region = handle->region; | ARegion *region = handle->region; | ||||
| ▲ Show 20 Lines • Show All 291 Lines • Show Last 20 Lines | |||||