From 8acd7a3c962a9d717e54bdb3f9f256caef9bd454 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Thu, 19 Oct 2023 18:08:23 +0200 Subject: [PATCH] UI: Remove Colons from Property Names Remove any automatic addition of the colon character to property names. Pull Request: https://projects.blender.org/blender/blender/pulls/113797 --- .../editors/interface/interface_layout.cc | 39 +------------------ .../editors/space_view3d/view3d_buttons.cc | 2 +- 2 files changed, 3 insertions(+), 38 deletions(-) diff --git a/source/blender/editors/interface/interface_layout.cc b/source/blender/editors/interface/interface_layout.cc index c7e11106fbb..739240f164a 100644 --- a/source/blender/editors/interface/interface_layout.cc +++ b/source/blender/editors/interface/interface_layout.cc @@ -211,20 +211,6 @@ struct uiLayoutItemRoot { /** \name Item * \{ */ -static const char *ui_item_name_add_colon(const char *name, char namestr[UI_MAX_NAME_STR]) -{ - const int len = strlen(name); - - if (len != 0 && len + 1 < UI_MAX_NAME_STR) { - memcpy(namestr, name, len); - namestr[len] = ':'; - namestr[len + 1] = '\0'; - return namestr; - } - - return name; -} - static int ui_item_fit( int item, int pos, int all, int available, bool is_last, int alignment, float *extra_pixel) { @@ -2068,7 +2054,6 @@ void uiItemFullR(uiLayout *layout, const char *placeholder) { uiBlock *block = layout->root->block; - char namestr[UI_MAX_NAME_STR]; const bool use_prop_sep = ((layout->item.flag & UI_ITEM_PROP_SEP) != 0); const bool inside_prop_sep = ((layout->item.flag & UI_ITEM_INSIDE_PROP_SEP) != 0); /* Columns can define a heading to insert. If the first item added to a split layout doesn't have @@ -2128,24 +2113,15 @@ void uiItemFullR(uiLayout *layout, /* pass */ } else if (ELEM(type, PROP_INT, PROP_FLOAT, PROP_STRING, PROP_POINTER)) { - if (use_prop_sep == false) { - name = ui_item_name_add_colon(name, namestr); - } + /* pass */ } else if (type == PROP_BOOLEAN && is_array && index == RNA_NO_INDEX) { - if (use_prop_sep == false) { - name = ui_item_name_add_colon(name, namestr); - } + /* pass */ } else if (type == PROP_ENUM && index != RNA_ENUM_VALUE) { if (flag & UI_ITEM_R_COMPACT) { name = ""; } - else { - if (use_prop_sep == false) { - name = ui_item_name_add_colon(name, namestr); - } - } } if (no_icon == false) { @@ -2881,8 +2857,6 @@ void uiItemPointerR_prop(uiLayout *layout, int icon, bool results_are_suggestions) { - const bool use_prop_sep = ((layout->item.flag & UI_ITEM_PROP_SEP) != 0); - ui_block_new_button_group(uiLayoutGetBlock(layout), uiButtonGroupFlag(0)); const PropertyType type = RNA_property_type(prop); @@ -2915,11 +2889,6 @@ void uiItemPointerR_prop(uiLayout *layout, name = RNA_property_ui_name(prop); } - char namestr[UI_MAX_NAME_STR]; - if (use_prop_sep == false) { - name = ui_item_name_add_colon(name, namestr); - } - /* create button */ uiBlock *block = uiLayoutGetBlock(layout); @@ -3365,10 +3334,6 @@ uiLayout *uiItemL_respect_property_split(uiLayout *layout, const char *text, int return split_wrapper.decorate_column; } - char namestr[UI_MAX_NAME_STR]; - if (text) { - text = ui_item_name_add_colon(text, namestr); - } uiItemL_(layout, text, icon); return layout; diff --git a/source/blender/editors/space_view3d/view3d_buttons.cc b/source/blender/editors/space_view3d/view3d_buttons.cc index 2065678e16c..b8fdbdd68f3 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.cc +++ b/source/blender/editors/space_view3d/view3d_buttons.cc @@ -1245,7 +1245,7 @@ static void v3d_object_dimension_buts(bContext *C, uiLayout *layout, View3D *v3d uiDefBut(block, UI_BTYPE_LABEL, 0, - IFACE_("Dimensions:"), + IFACE_("Dimensions"), 0, yi -= buth, butw,