From b4d9037dfbd85bd26e0bd0ab82798956ca1d9a3f Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 24 Oct 2012 21:57:07 +0000 Subject: Fix #30940: layout.prop_search() item not drawing correct inside menus. --- source/blender/editors/include/UI_interface.h | 2 +- source/blender/editors/interface/interface_handlers.c | 1 - source/blender/editors/interface/interface_regions.c | 6 +++--- source/blender/editors/interface/interface_templates.c | 2 +- source/blender/editors/space_outliner/outliner_draw.c | 2 +- source/blender/editors/space_view3d/view3d_toolbar.c | 2 +- source/blender/windowmanager/intern/wm_operators.c | 10 +++++----- 7 files changed, 12 insertions(+), 13 deletions(-) (limited to 'source/blender') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 5d2709f0488..d162b493803 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -106,7 +106,7 @@ typedef struct uiLayout uiLayout; /* uiBlock->flag (controls) */ #define UI_BLOCK_LOOP 1 #define UI_BLOCK_REDRAW 2 -#define UI_BLOCK_RET_1 4 /* XXX 2.5 not implemented */ +#define UI_BLOCK_SEARCH_MENU 4 #define UI_BLOCK_NUMSELECT 8 /*#define UI_BLOCK_ENTER_OK 16*/ /*UNUSED*/ #define UI_BLOCK_CLIPBOTTOM 32 diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index dc7ea930e45..b3d6eac9142 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -4527,7 +4527,6 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg) block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS); uiBlockSetHandleFunc(block, but_shortcut_name_func, but); - uiBlockSetFlag(block, UI_BLOCK_RET_1); uiBlockSetDirection(block, UI_CENTER); layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style); diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index afa8c9051b2..df680f4f875 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1159,7 +1159,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) /* special case, hardcoded feature, not draw backdrop when called from menus, * assume for design that popup already added it */ - if (but->block->flag & UI_BLOCK_LOOP) + if (but->block->flag & UI_BLOCK_SEARCH_MENU) data->noback = 1; if (but->a1 > 0 && but->a2 > 0) { @@ -1169,7 +1169,7 @@ ARegion *ui_searchbox_create(bContext *C, ARegion *butregion, uiBut *but) } /* compute position */ - if (but->block->flag & UI_BLOCK_LOOP) { + if (but->block->flag & UI_BLOCK_SEARCH_MENU) { /* this case is search menu inside other menu */ /* we copy region size */ @@ -2377,7 +2377,7 @@ static uiBlock *ui_block_func_POPUP(bContext *C, uiPopupBlockHandle *handle, voi uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT); if (pup->popup) { - uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_NUMSELECT | UI_BLOCK_RET_1); + uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_NUMSELECT); uiBlockSetDirection(block, direction); /* offset the mouse position, possibly based on earlier selection */ diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index d342aa4a21f..6afb5232b3a 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -175,7 +175,7 @@ static uiBlock *id_search_menu(bContext *C, ARegion *ar, void *arg_litem) idptr = RNA_property_pointer_get(&template.ptr, template.prop); block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS); - uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_RET_1); + uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_SEARCH_MENU); /* preview thumbnails */ if (template.prv_rows > 0 && template.prv_cols > 0) { diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index f6a167aefe6..a14dae70e42 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -627,7 +627,7 @@ static uiBlock *operator_search_menu(bContext *C, ARegion *ar, void *arg_kmi) search[0] = 0; block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS); - uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_RET_1); + uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_SEARCH_MENU); /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index e3ce163dbc1..d36b0085acb 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -173,7 +173,7 @@ static uiBlock *tool_search_menu(bContext *C, ARegion *ar, void *arg_listbase) search[0] = 0; block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS); - uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_RET_1); + uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_REDRAW | UI_BLOCK_SEARCH_MENU); /* fake button, it holds space for search items */ uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index b2e9af2f143..b041a790581 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -745,7 +745,7 @@ static uiBlock *wm_enum_search_menu(bContext *C, ARegion *ar, void *arg_op) wmOperator *op = (wmOperator *)arg_op; block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS); - uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT); + uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU); #if 0 /* ok, this isn't so easy... */ uiDefBut(block, LABEL, 0, RNA_struct_ui_name(op->type->srna), 10, 10, 180, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, ""); @@ -993,7 +993,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); - uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT); + uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_MOVEMOUSE_QUIT); /* if register is not enabled, the operator gets freed on OPERATOR_FINISHED * ui_apply_but_funcs_after calls ED_undo_operator_repeate_cb and crashes */ @@ -1071,7 +1071,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData) /* intentionally don't use 'UI_BLOCK_MOVEMOUSE_QUIT', some dialogs have many items * where quitting by accident is very annoying */ - uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_RET_1); + uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN); layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style); @@ -1112,7 +1112,7 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData) block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); - uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT); + uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_MOVEMOUSE_QUIT); layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, data->width, data->height, style); @@ -1459,7 +1459,7 @@ static uiBlock *wm_block_search_menu(bContext *C, ARegion *ar, void *UNUSED(arg_ uiBut *but; block = uiBeginBlock(C, ar, "_popup", UI_EMBOSS); - uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_RET_1 | UI_BLOCK_MOVEMOUSE_QUIT); + uiBlockSetFlag(block, UI_BLOCK_LOOP | UI_BLOCK_MOVEMOUSE_QUIT | UI_BLOCK_SEARCH_MENU); but = uiDefSearchBut(block, search, 0, ICON_VIEWZOOM, sizeof(search), 10, 10, 9 * UI_UNIT_X, UI_UNIT_Y, 0, 0, ""); uiButSetSearchFunc(but, operator_search_cb, NULL, operator_call_cb, NULL); -- cgit v1.2.3