Fix #30940: layout.prop_search() item not drawing correct inside menus.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 24 Oct 2012 21:57:07 +0000 (21:57 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Wed, 24 Oct 2012 21:57:07 +0000 (21:57 +0000)
source/blender/editors/include/UI_interface.h
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/space_outliner/outliner_draw.c
source/blender/editors/space_view3d/view3d_toolbar.c
source/blender/windowmanager/intern/wm_operators.c

index 5d2709f048833b88da12098f288b93305c5d36f9..d162b493803a5e2ef25f5077e061167888eec840 100644 (file)
@@ -106,7 +106,7 @@ typedef struct uiLayout uiLayout;
 /* uiBlock->flag (controls) */
 #define UI_BLOCK_LOOP           1
 #define UI_BLOCK_REDRAW         2
 /* 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
 #define UI_BLOCK_NUMSELECT      8
 /*#define UI_BLOCK_ENTER_OK            16*/ /*UNUSED*/
 #define UI_BLOCK_CLIPBOTTOM     32
index dc7ea930e4505688c41073f8595c0f620d35b8c5..b3d6eac91423e2bc9b5cf35c53ef39719adffa4f 100644 (file)
@@ -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);
 
        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);
        uiBlockSetDirection(block, UI_CENTER);
 
        layout = uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, 0, 0, 200, 20, style);
index afa8c9051b20c6c5b9feb46de677aa5c08400b4d..df680f4f8750f938f9f99edd341daa9cd8d36943 100644 (file)
@@ -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 */
        
        /* 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) {
                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 */
        }
        
        /* 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 */
 
                /* 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_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 */
                uiBlockSetDirection(block, direction);
 
                /* offset the mouse position, possibly based on earlier selection */
index d342aa4a21fb88450995be490f2b73736322da05..6afb5232b3a4196b7ed0deeb7a84d7e642261c1d 100644 (file)
@@ -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);
        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) {
        
        /* preview thumbnails */
        if (template.prv_rows > 0 && template.prv_cols > 0) {
index f6a167aefe6de7ad0b3067d04869157011bd3414..a14dae70e425891219a4ec2845002b0b3371e3b3 100644 (file)
@@ -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);
        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);
        
        /* fake button, it holds space for search items */
        uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
index e3ce163dbc152260f170fc41e30150f98d8cdb64..d36b0085acbaeeab4d22481b6802cdd162ee709e 100644 (file)
@@ -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);
        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);
        
        /* fake button, it holds space for search items */
        uiDefBut(block, LABEL, 0, "", 10, 15, 150, uiSearchBoxhHeight(), NULL, 0, 0, 0, 0, NULL);
index b2e9af2f1434ad4258717c1f73764c8884f05d80..b041a7905818526af2418dc5b2e67e04aaae50e1 100644 (file)
@@ -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);
        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, "");
 
 #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);
 
        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 */
 
        /* 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 */
 
        /* 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);
        
 
        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);
 
        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);
 
 
        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);
        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);
        
        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);