diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-29 09:45:57 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-04-29 10:18:54 +0300 |
commit | fc32bd729c5b75088db5c7c6ad288a64e7dcf8a6 (patch) | |
tree | d132949f0a901173242d838ab8070c26bb7617d1 /source/blender/editors/interface/interface_region_popup.c | |
parent | cb53c9bc7b3e8fa5d5e15e18b9286670f3d244ab (diff) |
UI: don't flip contents of popovers, avoid closing when size changes.
Diffstat (limited to 'source/blender/editors/interface/interface_region_popup.c')
-rw-r--r-- | source/blender/editors/interface/interface_region_popup.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c index 94e6aa44811..f397c62920b 100644 --- a/source/blender/editors/interface/interface_region_popup.c +++ b/source/blender/editors/interface/interface_region_popup.c @@ -591,6 +591,17 @@ uiBlock *ui_popup_block_refresh( else { /* clip block with window boundary */ ui_popup_block_clip(window, block); + + /* Avoid menu moving down and losing cursor focus by keeping it at + * the same height. */ + if (block_old && handle->prev_block_rect.ymax > block->rect.ymax) { + float offset = handle->prev_block_rect.ymax - block->rect.ymax; + ui_block_translate(block, 0, offset); + block->rect.ymin = handle->prev_block_rect.ymin; + } + + handle->prev_block_rect = block->rect; + /* the block and buttons were positioned in window space as in 2.4x, now * these menu blocks are regions so we bring it back to region space. * additionally we add some padding for the menu shadow or rounded menus */ |