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
This commit is contained in:
Yevgeny Makarov 2020-10-07 07:49:12 -05:00 committed by Hans Goudey
parent f948459f12
commit 0fd06b535c
5 changed files with 27 additions and 41 deletions

View File

@ -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:

View File

@ -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);

View File

@ -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];
uiLayoutSetPropSep(layout, true);
uiLayoutSetPropDecorate(layout, false);
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);
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)

View File

@ -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)

View File

@ -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);