diff options
author | Yevgeny Makarov <jenkm> | 2020-10-07 15:49:12 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-10-07 15:49:12 +0300 |
commit | 0fd06b535c166c4cb1997e8eed0c9aaccc684063 (patch) | |
tree | 5165532ccce8aadc3c40d44a8f0694b270524951 /source/blender/editors/space_image | |
parent | f948459f12a3831c5a64c214ed8d7b5b3e773137 (diff) |
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
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 59 |
1 files changed, 20 insertions, 39 deletions
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) |