UI: Aesthetic tweaks to Select All by Type operator

* Match menu items with Add Menu (order and naming e.g. Font -> Text)
* Use Icons
* Remove ellipsis from the name (policy is to use `...` only when triggering a window/popup)

No functional changes.

Thanks @HooglyBoogly for the help!
master
Pablo Vazquez 4 years ago
parent 9421d66a1b
commit 8f4f9275ce

@ -1369,7 +1369,7 @@ class VIEW3D_MT_select_object(Menu):
layout.separator()
layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type...")
layout.operator_menu_enum("object.select_by_type", "type", text="Select All by Type")
layout.operator("object.select_camera", text="Select Active Camera")
layout.operator("object.select_mirror", text="Mirror Selection")
layout.operator("object.select_random", text="Select Random")

@ -18,7 +18,7 @@ class CustomMenu(bpy.types.Menu):
# use an operator enum property to populate a sub-menu
layout.operator_menu_enum("object.select_by_type",
property="type",
text="Select All by Type...",
text="Select All by Type",
)
# call another menu

@ -440,7 +440,7 @@ static int object_select_by_type_exec(bContext *C, wmOperator *op)
void OBJECT_OT_select_by_type(wmOperatorType *ot)
{
/* identifiers */
ot->name = "Select By Type";
ot->name = "Select by Type";
ot->description = "Select all visible objects that are of a type";
ot->idname = "OBJECT_OT_select_by_type";

@ -223,36 +223,39 @@ const EnumPropertyItem rna_enum_lightprobes_type_items[] = {
/* used for 2 enums */
#define OBTYPE_CU_CURVE \
{ \
OB_CURVE, "CURVE", 0, "Curve", "" \
OB_CURVE, "CURVE", ICON_OUTLINER_OB_CURVE, "Curve", "" \
}
#define OBTYPE_CU_SURF \
{ \
OB_SURF, "SURFACE", 0, "Surface", "" \
OB_SURF, "SURFACE", ICON_OUTLINER_OB_SURFACE, "Surface", "" \
}
#define OBTYPE_CU_FONT \
{ \
OB_FONT, "FONT", 0, "Font", "" \
OB_FONT, "FONT", ICON_OUTLINER_OB_FONT, "Text", "" \
}
const EnumPropertyItem rna_enum_object_type_items[] = {
{OB_MESH, "MESH", 0, "Mesh", ""},
{OB_MESH, "MESH", ICON_OUTLINER_OB_MESH, "Mesh", ""},
OBTYPE_CU_CURVE,
OBTYPE_CU_SURF,
{OB_MBALL, "META", 0, "Meta", ""},
{OB_MBALL, "META", ICON_OUTLINER_OB_META, "Metaball", ""},
OBTYPE_CU_FONT,
{OB_HAIR, "HAIR", 0, "Hair", ""},
{OB_POINTCLOUD, "POINTCLOUD", 0, "PointCloud", ""},
{OB_VOLUME, "VOLUME", 0, "Volume", ""},
{OB_HAIR, "HAIR", ICON_OUTLINER_OB_HAIR, "Hair", ""},
{OB_POINTCLOUD, "POINTCLOUD", ICON_OUTLINER_OB_POINTCLOUD, "Point Cloud", ""},
{OB_VOLUME, "VOLUME", ICON_OUTLINER_OB_VOLUME, "Volume", ""},
{OB_GPENCIL, "GPENCIL", ICON_OUTLINER_OB_GREASEPENCIL, "Grease Pencil", ""},
{0, "", 0, NULL, NULL},
{OB_ARMATURE, "ARMATURE", 0, "Armature", ""},
{OB_LATTICE, "LATTICE", 0, "Lattice", ""},
{OB_EMPTY, "EMPTY", 0, "Empty", ""},
{OB_GPENCIL, "GPENCIL", 0, "GPencil", ""},
{OB_ARMATURE, "ARMATURE", ICON_OUTLINER_OB_ARMATURE, "Armature", ""},
{OB_LATTICE, "LATTICE", ICON_OUTLINER_OB_LATTICE, "Lattice", ""},
{0, "", 0, NULL, NULL},
{OB_CAMERA, "CAMERA", 0, "Camera", ""},
{OB_LAMP, "LIGHT", 0, "Light", ""},
{OB_SPEAKER, "SPEAKER", 0, "Speaker", ""},
{OB_LIGHTPROBE, "LIGHT_PROBE", 0, "Probe", ""},
{OB_EMPTY, "EMPTY", ICON_OUTLINER_OB_EMPTY, "Empty", ""},
{0, "", 0, NULL, NULL},
{OB_LAMP, "LIGHT", ICON_OUTLINER_OB_LIGHT, "Light", ""},
{OB_LIGHTPROBE, "LIGHT_PROBE", ICON_OUTLINER_OB_LIGHTPROBE, "Light Probe", ""},
{0, "", 0, NULL, NULL},
{OB_CAMERA, "CAMERA", ICON_OUTLINER_OB_CAMERA, "Camera", ""},
{0, "", 0, NULL, NULL},
{OB_SPEAKER, "SPEAKER", ICON_OUTLINER_OB_SPEAKER, "Speaker", ""},
{0, NULL, 0, NULL, NULL},
};

Loading…
Cancel
Save