Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <jeroen@blender.org>2020-01-28 12:49:05 +0300
committerJeroen Bakker <jeroen@blender.org>2020-02-17 17:03:11 +0300
commite64166652b17631e9c2a5b64bd54e7cf38af8ebb (patch)
tree01c21f1afff2dc811cc8868205684f334c1f994b /source/blender/windowmanager
parente2e2a98573e060cf26ab5141550dcd64838afc40 (diff)
Fix T68749: BPY: Deprecate height of popup
`invoke_props_dialog` and `invoke_popup` had a width and a height field. The height field was ignored as the height is determined based on the content. This change removes the field from the BPY + WM_api Reviewed By: Campbell Barton, Jacques Lucke Differential Revision: https://developer.blender.org/D6694
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h7
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c14
-rw-r--r--source/blender/windowmanager/intern/wm_stereo.c2
3 files changed, 11 insertions, 12 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index f5cf0b7d0c2..58e312c67c9 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -378,12 +378,9 @@ int WM_operator_props_popup_call(struct bContext *C,
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);
+int WM_operator_props_dialog_popup(struct bContext *C, struct wmOperator *op, int width);
int WM_operator_redo_popup(struct bContext *C, struct wmOperator *op);
-int WM_operator_ui_popup(struct bContext *C, struct wmOperator *op, int width, int height);
+int WM_operator_ui_popup(struct bContext *C, struct wmOperator *op, int width);
int WM_operator_confirm_message_ex(struct bContext *C,
struct wmOperator *op,
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 06bdba45ace..6e5068aa6b4 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1500,12 +1500,13 @@ static void wm_operator_ui_popup_ok(struct bContext *C, void *arg, int retval)
MEM_freeN(data);
}
-int WM_operator_ui_popup(bContext *C, wmOperator *op, int width, int height)
+int WM_operator_ui_popup(bContext *C, wmOperator *op, int width)
{
wmOpPopUp *data = MEM_callocN(sizeof(wmOpPopUp), "WM_operator_ui_popup");
data->op = op;
data->width = width * U.dpi_fac;
- data->height = height * U.dpi_fac;
+ /* Actual used height depends on the content. */
+ data->height = 0;
data->free_op = true; /* if this runs and gets registered we may want not to free it */
UI_popup_block_ex(C, wm_operator_ui_create, NULL, wm_operator_ui_popup_cancel, data, op);
return OPERATOR_RUNNING_MODAL;
@@ -1541,7 +1542,7 @@ static int wm_operator_props_popup_ex(bContext *C,
/* 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, 20);
+ return WM_operator_props_dialog_popup(C, op, 300);
}
UI_popup_block_ex(C, wm_block_create_redo, NULL, wm_block_redo_cancel_cb, op, op);
@@ -1577,13 +1578,14 @@ int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *UNUSED(e
return wm_operator_props_popup_ex(C, op, false, true);
}
-int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int height)
+int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width)
{
wmOpPopUp *data = MEM_callocN(sizeof(wmOpPopUp), "WM_operator_props_dialog_popup");
data->op = op;
data->width = width * U.dpi_fac;
- data->height = height * U.dpi_fac;
+ /* Actual height depends on the content. */
+ data->height = 0;
data->free_op = true; /* if this runs and gets registered we may want not to free it */
/* op is not executed until popup OK but is clicked */
@@ -1634,7 +1636,7 @@ static int wm_debug_menu_exec(bContext *C, wmOperator *op)
static int wm_debug_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
{
RNA_int_set(op->ptr, "debug_value", G.debug_value);
- return WM_operator_props_dialog_popup(C, op, 180, 20);
+ return WM_operator_props_dialog_popup(C, op, 180);
}
static void WM_OT_debug_menu(wmOperatorType *ot)
diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c
index 54953c097eb..735d44a00b5 100644
--- a/source/blender/windowmanager/intern/wm_stereo.c
+++ b/source/blender/windowmanager/intern/wm_stereo.c
@@ -469,7 +469,7 @@ int wm_stereo3d_set_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(ev
return wm_stereo3d_set_exec(C, op);
}
else {
- return WM_operator_props_dialog_popup(C, op, 250, 100);
+ return WM_operator_props_dialog_popup(C, op, 250);
}
}