Fix T57553: Python operator popup size does not follow UI scale and DPI.
Make it the convention to multiply by scaling factor inside the function, so Python scripts that didn't add DPI scale start working correctly.
This commit is contained in:
@@ -289,7 +289,7 @@ static int pose_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEven
|
||||
|
||||
/* show popup dialog to allow editing of range... */
|
||||
// FIXME: hardcoded dimensions here are just arbitrary
|
||||
return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 10 * UI_UNIT_Y);
|
||||
return WM_operator_props_dialog_popup(C, op, 200, 200);
|
||||
}
|
||||
|
||||
/* For the object with pose/action: create path curves for selected bones
|
||||
|
||||
@@ -1279,7 +1279,7 @@ static int object_calculate_paths_invoke(bContext *C, wmOperator *op, const wmEv
|
||||
|
||||
/* show popup dialog to allow editing of range... */
|
||||
/* FIXME: hardcoded dimensions here are just arbitrary */
|
||||
return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 10 * UI_UNIT_Y);
|
||||
return WM_operator_props_dialog_popup(C, op, 200, 200);
|
||||
}
|
||||
|
||||
/* Calculate/recalculate whole paths (avs.path_sf to avs.path_ef) */
|
||||
@@ -2044,7 +2044,7 @@ static int move_to_collection_invoke(bContext *C, wmOperator *op, const wmEvent
|
||||
BKE_collection_new_name_get(collection, name);
|
||||
|
||||
RNA_property_string_set(op->ptr, prop, name);
|
||||
return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 5 * UI_UNIT_Y);
|
||||
return WM_operator_props_dialog_popup(C, op, 200, 100);
|
||||
}
|
||||
}
|
||||
return move_to_collection_exec(C, op);
|
||||
|
||||
@@ -5881,7 +5881,7 @@ static int texture_paint_add_texture_paint_slot_invoke(bContext *C, wmOperator *
|
||||
get_default_texture_layer_name_for_object(ob, type, (char *)&imagename, sizeof(imagename));
|
||||
RNA_string_set(op->ptr, "name", imagename);
|
||||
|
||||
return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, 5 * UI_UNIT_Y);
|
||||
return WM_operator_props_dialog_popup(C, op, 300, 100);
|
||||
}
|
||||
|
||||
#define IMA_DEF_NAME N_("Untitled")
|
||||
|
||||
@@ -2488,7 +2488,7 @@ static int image_new_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e
|
||||
|
||||
/* Better for user feedback. */
|
||||
RNA_string_set(op->ptr, "name", DATA_(IMA_DEF_NAME));
|
||||
return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X, 5 * UI_UNIT_Y);
|
||||
return WM_operator_props_dialog_popup(C, op, 300, 100);
|
||||
}
|
||||
|
||||
static void image_new_draw(bContext *UNUSED(C), wmOperator *op)
|
||||
|
||||
@@ -3525,7 +3525,7 @@ void SEQUENCER_OT_rebuild_proxy(wmOperatorType *ot)
|
||||
|
||||
static int sequencer_enable_proxies_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
|
||||
{
|
||||
return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 5 * UI_UNIT_Y);
|
||||
return WM_operator_props_dialog_popup(C, op, 200, 100);
|
||||
}
|
||||
|
||||
static int sequencer_enable_proxies_exec(bContext *C, wmOperator *op)
|
||||
|
||||
@@ -1949,7 +1949,7 @@ static int text_jump_exec(bContext *C, wmOperator *op)
|
||||
|
||||
static int text_jump_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
|
||||
{
|
||||
return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X, 5 * UI_UNIT_Y);
|
||||
return WM_operator_props_dialog_popup(C, op, 200, 100);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1241,7 +1241,7 @@ static int wm_operator_props_popup_ex(bContext *C, wmOperator *op,
|
||||
/* 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, 15 * UI_UNIT_X, UI_UNIT_Y);
|
||||
return WM_operator_props_dialog_popup(C, op, 300, 20);
|
||||
|
||||
UI_popup_block_ex(C, wm_block_create_redo, NULL, wm_block_redo_cancel_cb, op, op);
|
||||
|
||||
@@ -1280,8 +1280,8 @@ int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width, int h
|
||||
wmOpPopUp *data = MEM_callocN(sizeof(wmOpPopUp), "WM_operator_props_dialog_popup");
|
||||
|
||||
data->op = op;
|
||||
data->width = width;
|
||||
data->height = height;
|
||||
data->width = width * U.dpi_fac;
|
||||
data->height = height * U.dpi_fac;
|
||||
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 */
|
||||
@@ -1322,7 +1322,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, 9 * UI_UNIT_X, UI_UNIT_Y);
|
||||
return WM_operator_props_dialog_popup(C, op, 180, 20);
|
||||
}
|
||||
|
||||
static void WM_OT_debug_menu(wmOperatorType *ot)
|
||||
|
||||
Reference in New Issue
Block a user