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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-11-01 14:23:33 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-11-01 14:33:27 +0300
commit77c126dd4c819a4ad92bb7895af4593831cb2daf (patch)
treead84fc4cca8fce19c48aea1e3880820a89cf04c3 /source/blender
parent8f1b1b5abb63e52827d5d0dcee0c2930be2087d7 (diff)
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.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/armature/pose_edit.c2
-rw-r--r--source/blender/editors/object/object_edit.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c2
-rw-r--r--source/blender/editors/space_image/image_ops.c2
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c2
-rw-r--r--source/blender/editors/space_text/text_ops.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c8
7 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c
index e60fb37b8b0..b10afa3a6de 100644
--- a/source/blender/editors/armature/pose_edit.c
+++ b/source/blender/editors/armature/pose_edit.c
@@ -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
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 89eea4c1b64..a934f298583 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -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);
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index fea0819fb27..5f1fb8c5146 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -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")
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index ba984c33e47..b161de9f472 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -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)
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 38abfe909a6..a1819e9ac3a 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -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)
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index 28eb4572a1a..8d8d98135e5 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -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);
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 3be213796d8..6c9cbbcee57 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -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)