From 8f4f9275cea6602e74eecf7e9a88c101f9cc5245 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Tue, 8 Sep 2020 16:30:09 +0200 Subject: 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! --- release/scripts/startup/bl_ui/space_view3d.py | 2 +- release/scripts/templates_py/ui_menu.py | 2 +- source/blender/editors/object/object_select.c | 2 +- source/blender/makesrna/intern/rna_object.c | 35 +++++++++++++++------------ 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 35b27940687..528eba06db1 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -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") diff --git a/release/scripts/templates_py/ui_menu.py b/release/scripts/templates_py/ui_menu.py index 36391a54f4e..7c19693485e 100644 --- a/release/scripts/templates_py/ui_menu.py +++ b/release/scripts/templates_py/ui_menu.py @@ -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 diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index e20de5a92ff..5dfbaf583f6 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -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"; diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index e98fff13068..c7f625e2fa5 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -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}, }; -- cgit v1.2.3