diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-10-09 18:35:25 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-10-09 18:35:25 +0400 |
commit | de3f6b3ec19d2402be8003e172c69e87c356f310 (patch) | |
tree | aff68463f10941cd54d531317eaf1b321c7ab72f /source/blender/windowmanager | |
parent | 49bc31067163474729755c8a9dbd543ba3744d3f (diff) |
re-enable activating the text input field for new popup dialog boxes,
I'd disabled this for 2.68 since it caused bug [#36109].
This fix now only enabled text activation for popups. (so the toolbar textboxes are skipped)
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 1 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 17 |
2 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 84b376edcd8..c338d49fe17 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -198,6 +198,7 @@ bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const struct I /* poll callback, context checks */ int WM_operator_winactive (struct bContext *C); /* invoke callback, exec + redo popup */ +int WM_operator_props_popup_confirm(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_operator_props_popup_call(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_operator_props_popup (struct bContext *C, struct wmOperator *op, const struct wmEvent *event); int WM_operator_props_dialog_popup(struct bContext *C, struct wmOperator *op, int width, int height); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 5e1e5890c6b..17c7d915b64 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -1433,7 +1433,8 @@ int WM_operator_ui_popup(bContext *C, wmOperator *op, int width, int height) * For use by #WM_operator_props_popup_call, #WM_operator_props_popup only. * * \note operator menu needs undo flag enabled , for redo callback */ -static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, const int do_call) +static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, + const bool do_call, const bool do_redo) { if ((op->type->flag & OPTYPE_REGISTER) == 0) { BKE_reportf(op->reports, RPT_ERROR, @@ -1443,7 +1444,7 @@ static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, const int do_ /* if we don't have global undo, we can't do undo push for automatic redo, * so we require manual OK clicking in this popup */ - if (!(U.uiflag & USER_GLOBALUNDO)) + if (!do_redo || !(U.uiflag & USER_GLOBALUNDO)) return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, UI_UNIT_Y); uiPupBlockEx(C, wm_block_create_redo, NULL, wm_block_redo_cancel_cb, op); @@ -1454,18 +1455,26 @@ static int wm_operator_props_popup_ex(bContext *C, wmOperator *op, const int do_ return OPERATOR_RUNNING_MODAL; } +/* Same as WM_operator_props_popup but don't use operator redo. + * just wraps WM_operator_props_dialog_popup. + */ +int WM_operator_props_popup_confirm(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) +{ + return wm_operator_props_popup_ex(C, op, false, false); +} + /* Same as WM_operator_props_popup but call the operator first, * This way - the button values correspond to the result of the operator. * Without this, first access to a button will make the result jump, * see [#32452] */ int WM_operator_props_popup_call(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { - return wm_operator_props_popup_ex(C, op, TRUE); + return wm_operator_props_popup_ex(C, op, true, true); } int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *UNUSED(event)) { - return wm_operator_props_popup_ex(C, op, FALSE); + return wm_operator_props_popup_ex(C, op, false, true); } int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int height) |