diff --git a/source/blender/windowmanager/WM_api.hh b/source/blender/windowmanager/WM_api.hh index 72a1c24e6fb..7ab5be3b4c2 100644 --- a/source/blender/windowmanager/WM_api.hh +++ b/source/blender/windowmanager/WM_api.hh @@ -918,7 +918,8 @@ wmOperatorStatus WM_operator_props_popup_confirm_ex( const wmEvent *event, std::optional title = std::nullopt, std::optional confirm_text = std::nullopt, - bool cancel_default = false); + bool cancel_default = false, + std::optional message = std::nullopt); /** * Same as #WM_operator_props_popup but call the operator first, @@ -934,7 +935,8 @@ wmOperatorStatus WM_operator_props_dialog_popup( int width, std::optional title = std::nullopt, std::optional confirm_text = std::nullopt, - bool cancel_default = false); + bool cancel_default = false, + std::optional message = std::nullopt); wmOperatorStatus WM_operator_redo_popup(bContext *C, wmOperator *op); wmOperatorStatus WM_operator_ui_popup(bContext *C, wmOperator *op, int width); diff --git a/source/blender/windowmanager/intern/wm_operators.cc b/source/blender/windowmanager/intern/wm_operators.cc index 89d9b6cbb68..1046a74b24f 100644 --- a/source/blender/windowmanager/intern/wm_operators.cc +++ b/source/blender/windowmanager/intern/wm_operators.cc @@ -1803,7 +1803,8 @@ static wmOperatorStatus wm_operator_props_popup_ex( const bool do_redo, std::optional title = std::nullopt, std::optional confirm_text = std::nullopt, - const bool cancel_default = false) + const bool cancel_default = false, + std::optional message = std::nullopt) { if ((op->type->flag & OPTYPE_REGISTER) == 0) { BKE_reportf(op->reports, @@ -1826,7 +1827,8 @@ static wmOperatorStatus wm_operator_props_popup_ex( /* 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 (!do_redo || !(U.uiflag & USER_GLOBALUNDO)) { - return WM_operator_props_dialog_popup(C, op, 300, title, confirm_text, cancel_default); + return WM_operator_props_dialog_popup( + C, op, 300, title, confirm_text, cancel_default, message); } UI_popup_block_ex(C, wm_block_create_redo, nullptr, wm_block_redo_cancel_cb, op, op); @@ -1843,9 +1845,11 @@ wmOperatorStatus WM_operator_props_popup_confirm_ex(bContext *C, const wmEvent * /*event*/, std::optional title, std::optional confirm_text, - const bool cancel_default) + const bool cancel_default, + std::optional message) { - return wm_operator_props_popup_ex(C, op, false, false, title, confirm_text, cancel_default); + return wm_operator_props_popup_ex( + C, op, false, false, title, confirm_text, cancel_default, message); } wmOperatorStatus WM_operator_props_popup_confirm(bContext *C, @@ -1872,7 +1876,8 @@ wmOperatorStatus WM_operator_props_dialog_popup(bContext *C, int width, std::optional title, std::optional confirm_text, - const bool cancel_default) + const bool cancel_default, + std::optional message) { wmOpPopUp *data = MEM_new(__func__); data->op = op; @@ -1881,9 +1886,10 @@ wmOperatorStatus WM_operator_props_dialog_popup(bContext *C, data->free_op = true; /* If this runs and gets registered we may want not to free it. */ data->title = title ? std::move(*title) : WM_operatortype_name(op->type, op->ptr); data->confirm_text = confirm_text ? std::move(*confirm_text) : IFACE_("OK"); + data->message = message ? std::move(*message) : std::string(); data->icon = ALERT_ICON_NONE; data->size = WM_POPUP_SIZE_SMALL; - data->position = WM_POPUP_POSITION_MOUSE; + data->position = (message) ? WM_POPUP_POSITION_CENTER : WM_POPUP_POSITION_MOUSE; data->cancel_default = cancel_default; data->mouse_move_quit = false; data->include_properties = true; @@ -4236,6 +4242,7 @@ void wm_operatortypes_register() WM_operatortype_append(WM_OT_previews_ensure); WM_operatortype_append(WM_OT_previews_clear); WM_operatortype_append(WM_OT_doc_view_manual_ui_context); + WM_operatortype_append(WM_OT_set_working_color_space); #ifdef WITH_XR_OPENXR wm_xr_operatortypes_register();