diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-06-14 19:40:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-14 19:42:31 +0400 |
commit | ea2043eb3a31468d9afeb1d6cc140567e219565f (patch) | |
tree | 7509c73176efae489bb4aab3a8daadb755007015 /source/blender/windowmanager/intern | |
parent | 5713d80804de8795a59fc04e95af3f50617adcfa (diff) |
UI: Add support for popups to refresh their layput (D578)
This is needed for popups to chance state once activated,
currently it makes use of operators `check` callback, after values are modified,
as the file selector does already.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index a405e6d5d63..419e7f6ad83 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1086,7 +1086,6 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op) uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxHeight(), uiSearchBoxWidth(), uiSearchBoxHeight(), NULL, 0, 0, 0, 0, NULL); uiPopupBoundsBlock(block, 6, 0, -UI_UNIT_Y); /* move it downwards, mouse over button */ - uiEndBlock(C, block); wm_event_init_from_window(win, &event); event.type = EVT_BUT_OPEN; @@ -1427,7 +1426,6 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) } uiPopupBoundsBlock(block, 4, 0, 0); - uiEndBlock(C, block); return block; } @@ -1462,7 +1460,11 @@ static void dialog_check_cb(bContext *C, void *op_ptr, void *UNUSED(arg)) wmOperator *op = op_ptr; if (op->type->check) { if (op->type->check(C, op)) { - /* refresh */ + /* check for popup and re-layout buttons */ + ARegion *ar_menu = CTX_wm_menu(C); + if (ar_menu) { + ED_region_tag_refresh_ui(ar_menu); + } } } } @@ -1507,7 +1509,6 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData) /* center around the mouse */ uiPopupBoundsBlock(block, 4, data->width / -2, data->height / 2); - uiEndBlock(C, block); return block; } @@ -1530,7 +1531,6 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData) uiLayoutOperatorButs(C, layout, op, NULL, 'V', 0); uiPopupBoundsBlock(block, 4, 0, 0); - uiEndBlock(C, block); return block; } @@ -1929,7 +1929,6 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *ar, void *UNUSED(ar uiItemL(col, "", ICON_NONE); uiCenteredBoundsBlock(block, 0); - uiEndBlock(C, block); return block; } @@ -1971,7 +1970,6 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_ uiDefBut(block, LABEL, 0, "", 10, 10 - uiSearchBoxHeight(), uiSearchBoxWidth(), uiSearchBoxHeight(), NULL, 0, 0, 0, 0, NULL); uiPopupBoundsBlock(block, 6, 0, -UI_UNIT_Y); /* move it downwards, mouse over button */ - uiEndBlock(C, block); wm_event_init_from_window(win, &event); event.type = EVT_BUT_OPEN; |