Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_region_popover.c
| Show First 20 Lines • Show All 197 Lines • ▼ Show 20 Lines | else { | ||||
| UI_block_flag_enable(block, UI_BLOCK_LOOP); | UI_block_flag_enable(block, UI_BLOCK_LOOP); | ||||
| UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP); | UI_block_theme_style_set(block, UI_BLOCK_THEME_STYLE_POPUP); | ||||
| UI_block_direction_set(block, block->direction); | UI_block_direction_set(block, block->direction); | ||||
| block->minbounds = UI_MENU_WIDTH_MIN; | block->minbounds = UI_MENU_WIDTH_MIN; | ||||
| if (!handle->refresh) { | if (!handle->refresh) { | ||||
| uiBut *but = NULL; | uiBut *but = NULL; | ||||
| uiBut *but_first = NULL; | uiBut *but_first = NULL; | ||||
| for (but = block->buttons.first; but; but = but->next) { | LISTBASE_FOREACH (uiBut *, but_iter, &block->buttons) { | ||||
| if ((but_first == NULL) && ui_but_is_editable(but)) { | if ((but_first == NULL) && ui_but_is_editable(but_iter)) { | ||||
| but_first = but; | but_first = but_iter; | ||||
| } | } | ||||
| if (but->flag & (UI_SELECT | UI_SELECT_DRAW)) { | if (but_iter->flag & (UI_SELECT | UI_SELECT_DRAW)) { | ||||
| but = but_iter; | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| if (but) { | if (but) { | ||||
| bounds_offset[0] = -(but->rect.xmin + 0.8f * BLI_rctf_size_x(&but->rect)); | bounds_offset[0] = -(but->rect.xmin + 0.8f * BLI_rctf_size_x(&but->rect)); | ||||
| bounds_offset[1] = -BLI_rctf_cent_y(&but->rect); | bounds_offset[1] = -BLI_rctf_cent_y(&but->rect); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 214 Lines • Show Last 20 Lines | |||||