diff options
Diffstat (limited to 'source')
7 files changed, 18 insertions, 11 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 5080645ecd5..20ffbd8eac0 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -3445,7 +3445,7 @@ void ANIM_channel_draw_widgets(bContext *C, bAnimContext *ac, bAnimListElem *ale but = uiDefButR(block, TEX, 1, "", offset + 3, yminc, RENAME_TEXT_WIDTH, channel_height, &ptr, RNA_property_identifier(prop), -1, 0, 0, -1, -1, NULL); uiButSetFunc(but, achannel_setting_rename_done_cb, ac->ads, NULL); - uiButActiveOnly(C, block, but); + uiButActiveOnly(C, ac->ar, block, but); uiBlockSetEmboss(block, UI_EMBOSSN); } diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 54f10d2ff30..2572d4b4d99 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -448,7 +448,7 @@ void uiButSetDrawFlag(uiBut *but, int flag); void uiButClearDrawFlag(uiBut *but, int flag); /* special button case, only draw it when used actively, for outliner etc */ -int uiButActiveOnly(const struct bContext *C, uiBlock *block, uiBut *but); +int uiButActiveOnly(const struct bContext *C, struct ARegion *ar, uiBlock *block, uiBut *but); void uiButExecute(const struct bContext *C, uiBut *but); @@ -643,7 +643,7 @@ void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), void *arg1, void *arg2); -void UI_textbutton_activate_event(const struct bContext *C, struct ARegion *ar, +bool UI_textbutton_activate_event(const struct bContext *C, struct ARegion *ar, const void *rna_poin_data, const char *rna_prop_id); void uiButSetFocusOnEnter(struct wmWindow *win, uiBut *but); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 16598511921..be51651dee7 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -682,7 +682,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut /* needed for temporarily rename buttons, such as in outliner or file-select, * they should keep calling uiDefButs to keep them alive */ /* returns 0 when button removed */ -int uiButActiveOnly(const bContext *C, uiBlock *block, uiBut *but) +int uiButActiveOnly(const bContext *C, ARegion *ar, uiBlock *block, uiBut *but) { uiBlock *oldblock; uiBut *oldbut; @@ -704,7 +704,7 @@ int uiButActiveOnly(const bContext *C, uiBlock *block, uiBut *but) } } if ((activate == TRUE) || (found == FALSE)) { - ui_button_activate_do((bContext *)C, CTX_wm_region(C), but); + ui_button_activate_do((bContext *)C, ar, but); } else if ((found == TRUE) && (isactive == FALSE)) { BLI_remlink(&block->buttons, but); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 8b8e8ceaa9c..6d30db9c4d6 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7456,7 +7456,7 @@ void UI_remove_popup_handlers(ListBase *handlers, uiPopupBlockHandle *popup) WM_event_remove_ui_handler(handlers, ui_handler_popup, ui_handler_remove_popup, popup, FALSE); } -void UI_textbutton_activate_event(const bContext *C, ARegion *ar, +bool UI_textbutton_activate_event(const bContext *C, ARegion *ar, const void *rna_poin_data, const char *rna_prop_id) { uiBlock *block; @@ -7477,7 +7477,11 @@ void UI_textbutton_activate_event(const bContext *C, ARegion *ar, } if (but) { - uiButActiveOnly(C, block, but); + uiButActiveOnly(C, ar, block, but); + return true; + } + else { + return false; } } diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 5b6b8656072..1c677d7c006 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -538,7 +538,7 @@ void file_draw_list(const bContext *C, ARegion *ar) uiButSetRenameFunc(but, renamebutton_cb, file); uiButSetFlag(but, UI_BUT_NO_UTF8); /* allow non utf8 names */ uiButClearFlag(but, UI_BUT_UNDO); - if (0 == uiButActiveOnly(C, block, but)) { + if (0 == uiButActiveOnly(C, ar, block, but)) { file->selflag &= ~EDITING_FILE; } } diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index c8bed8ebf11..418d4ff04a4 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1043,7 +1043,7 @@ static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, Spa uiButSetRenameFunc(bt, namebutton_cb, tselem); /* returns false if button got removed */ - if (0 == uiButActiveOnly(C, block, bt) ) + if (0 == uiButActiveOnly(C, ar, block, bt) ) tselem->flag &= ~TSE_TEXTBUT; } } diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 600cbdb326b..61cdddfc740 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -523,8 +523,11 @@ static void text_properties_area_draw(const bContext *C, ARegion *ar) /* this flag trick is make sure buttons have been added already */ if (st->flags & ST_FIND_ACTIVATE) { - - UI_textbutton_activate_event(C, ar, st, "find_text"); + if (UI_textbutton_activate_event(C, ar, st, "find_text")) { + /* if the panel was already open we need to do another redraw */ + ScrArea *sa = CTX_wm_area(C); + WM_event_add_notifier(C, NC_SPACE | ND_SPACE_TEXT, sa); + } st->flags &= ~ST_FIND_ACTIVATE; } } |