Fix #30940: layout.prop_search() item not drawing correct inside menus.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user