[Bf-blender-cvs] [0fd06b535c1] master: UI: Use property split in various pop-up dialogs

Yevgeny Makarov noreply at git.blender.org
Wed Oct 7 14:49:35 CEST 2020


Commit: 0fd06b535c166c4cb1997e8eed0c9aaccc684063
Author: Yevgeny Makarov
Date:   Wed Oct 7 07:49:12 2020 -0500
Branches: master
https://developer.blender.org/rB0fd06b535c166c4cb1997e8eed0c9aaccc684063

UI: Use property split in various pop-up dialogs

The settings in these popups are not animateable, so also turn off
property decorate. And also use better widths in order to fit the
full text.

Differential Revision: https://developer.blender.org/D9060

===================================================================

M	release/scripts/startup/bl_operators/uvcalc_lightmap.py
M	source/blender/editors/screen/screendump.c
M	source/blender/editors/space_image/image_ops.c
M	source/blender/windowmanager/intern/wm_operators.c
M	source/blender/windowmanager/intern/wm_stereo.c

===================================================================

diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
index e4edcbb62b3..6ebf39af22e 100644
--- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py
+++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
@@ -656,6 +656,7 @@ class LightMapPack(Operator):
     def draw(self, context):
         layout = self.layout
         layout.use_property_split = True
+        layout.use_property_decorate = False
 
         is_editmode = context.active_object.mode == 'EDIT'
         if is_editmode:
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index f80c13a7fb7..9fb11899d78 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -206,6 +206,7 @@ static void screenshot_draw(bContext *UNUSED(C), wmOperator *op)
   PointerRNA ptr;
 
   uiLayoutSetPropSep(layout, true);
+  uiLayoutSetPropDecorate(layout, false);
 
   /* image template */
   RNA_pointer_create(NULL, &RNA_ImageFormatSettings, &scd->im_format, &ptr);
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 0a8bcd91f34..6f36d3606bc 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -3689,29 +3689,16 @@ static bool do_fill_tile(PointerRNA *ptr, Image *ima, ImageTile *tile)
 
 static void draw_fill_tile(PointerRNA *ptr, uiLayout *layout)
 {
-  uiLayout *split, *col[2];
-
-  split = uiLayoutSplit(layout, 0.5f, false);
-  col[0] = uiLayoutColumn(split, false);
-  col[1] = uiLayoutColumn(split, false);
-
-  uiItemL(col[0], IFACE_("Color"), ICON_NONE);
-  uiItemR(col[1], ptr, "color", 0, "", ICON_NONE);
-
-  uiItemL(col[0], IFACE_("Width"), ICON_NONE);
-  uiItemR(col[1], ptr, "width", 0, "", ICON_NONE);
-
-  uiItemL(col[0], IFACE_("Height"), ICON_NONE);
-  uiItemR(col[1], ptr, "height", 0, "", ICON_NONE);
-
-  uiItemL(col[0], "", ICON_NONE);
-  uiItemR(col[1], ptr, "alpha", 0, NULL, ICON_NONE);
-
-  uiItemL(col[0], IFACE_("Generated Type"), ICON_NONE);
-  uiItemR(col[1], ptr, "generated_type", 0, "", ICON_NONE);
+  uiLayoutSetPropSep(layout, true);
+  uiLayoutSetPropDecorate(layout, false);
 
-  uiItemL(col[0], "", ICON_NONE);
-  uiItemR(col[1], ptr, "float", 0, NULL, ICON_NONE);
+  uiLayout *col = uiLayoutColumn(layout, false);
+  uiItemR(col, ptr, "color", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "width", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "height", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "alpha", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "generated_type", 0, NULL, ICON_NONE);
+  uiItemR(col, ptr, "float", 0, NULL, ICON_NONE);
 }
 
 static void tile_fill_init(PointerRNA *ptr, Image *ima, ImageTile *tile)
@@ -3833,30 +3820,24 @@ static int tile_add_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(ev
   RNA_int_set(op->ptr, "count", 1);
   RNA_string_set(op->ptr, "label", "");
 
-  return WM_operator_props_dialog_popup(C, op, 10 * UI_UNIT_X);
+  return WM_operator_props_dialog_popup(C, op, 300);
 }
 
 static void tile_add_draw(bContext *UNUSED(C), wmOperator *op)
 {
-  uiLayout *split, *col[2];
+  uiLayout *col;
   uiLayout *layout = op->layout;
   PointerRNA ptr;
 
   RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
 
-  split = uiLayoutSplit(layout, 0.5f, false);
-  col[0] = uiLayoutColumn(split, false);
-  col[1] = uiLayoutColumn(split, false);
-
-  uiItemL(col[0], IFACE_("Number"), ICON_NONE);
-  uiItemR(col[1], &ptr, "number", 0, "", ICON_NONE);
-
-  uiItemL(col[0], IFACE_("Count"), ICON_NONE);
-  uiItemR(col[1], &ptr, "count", 0, "", ICON_NONE);
-
-  uiItemL(col[0], IFACE_("Label"), ICON_NONE);
-  uiItemR(col[1], &ptr, "label", 0, "", ICON_NONE);
+  uiLayoutSetPropSep(layout, true);
+  uiLayoutSetPropDecorate(layout, false);
 
+  col = uiLayoutColumn(layout, false);
+  uiItemR(col, &ptr, "number", 0, NULL, ICON_NONE);
+  uiItemR(col, &ptr, "count", 0, NULL, ICON_NONE);
+  uiItemR(col, &ptr, "label", 0, NULL, ICON_NONE);
   uiItemR(layout, &ptr, "fill", 0, NULL, ICON_NONE);
 
   if (RNA_boolean_get(&ptr, "fill")) {
@@ -3867,7 +3848,7 @@ static void tile_add_draw(bContext *UNUSED(C), wmOperator *op)
 void IMAGE_OT_tile_add(wmOperatorType *ot)
 {
   /* identifiers */
-  ot->name = "Add tile";
+  ot->name = "Add Tile";
   ot->description = "Adds a tile to the image";
   ot->idname = "IMAGE_OT_tile_add";
 
@@ -3928,7 +3909,7 @@ static int tile_remove_exec(bContext *C, wmOperator *UNUSED(op))
 void IMAGE_OT_tile_remove(wmOperatorType *ot)
 {
   /* identifiers */
-  ot->name = "Remove tile";
+  ot->name = "Remove Tile";
   ot->description = "Removes a tile from the image";
   ot->idname = "IMAGE_OT_tile_remove";
 
@@ -3975,7 +3956,7 @@ static int tile_fill_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(e
 {
   tile_fill_init(op->ptr, CTX_data_edit_image(C), NULL);
 
-  return WM_operator_props_dialog_popup(C, op, 15 * UI_UNIT_X);
+  return WM_operator_props_dialog_popup(C, op, 300);
 }
 
 static void tile_fill_draw(bContext *UNUSED(C), wmOperator *op)
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index fda3cc49234..9d99e671369 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1623,7 +1623,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);
+  return WM_operator_props_dialog_popup(C, op, 250);
 }
 
 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 ab6da2cc947..948b6854b02 100644
--- a/source/blender/windowmanager/intern/wm_stereo.c
+++ b/source/blender/windowmanager/intern/wm_stereo.c
@@ -367,7 +367,7 @@ int wm_stereo3d_set_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(ev
   if (wm_stereo3d_set_properties(C, op)) {
     return wm_stereo3d_set_exec(C, op);
   }
-  return WM_operator_props_dialog_popup(C, op, 250);
+  return WM_operator_props_dialog_popup(C, op, 300);
 }
 
 void wm_stereo3d_set_draw(bContext *UNUSED(C), wmOperator *op)
@@ -379,6 +379,9 @@ void wm_stereo3d_set_draw(bContext *UNUSED(C), wmOperator *op)
 
   RNA_pointer_create(NULL, &RNA_Stereo3dDisplay, &s3dd->stereo3d_format, &stereo3d_format_ptr);
 
+  uiLayoutSetPropSep(layout, true);
+  uiLayoutSetPropDecorate(layout, false);
+
   col = uiLayoutColumn(layout, false);
   uiItemR(col, &stereo3d_format_ptr, "display_mode", 0, NULL, ICON_NONE);



More information about the Bf-blender-cvs mailing list