UI: Improved Enum Title Determination #111818

Merged
Harley Acheson merged 1 commits from Harley/blender:EnumTitles into main 2023-09-02 05:04:02 +02:00
1 changed files with 6 additions and 2 deletions

View File

@ -4343,8 +4343,12 @@ static void ui_def_but_rna__menu(bContext * /*C*/, uiLayout *layout, void *but_p
const char *title = RNA_property_ui_name(but->rnaprop);
if (title[0] && !but->str[0] && (categories == 0)) {
/* Show title when no categories and calling button has no text. */
/* Is there a non-blank label before this button on the same row? */
const bool prior_label = but->prev && but->prev->type == UI_BTYPE_LABEL && but->prev->str[0] &&
but->prev->alignnr == but->alignnr;
if (title[0] && (categories == 0) && (!but->str[0] || !prior_label)) {
/* Show title when no categories and calling button has no text or prior label. */
uiDefBut(block,
UI_BTYPE_LABEL,
0,