UI: Improved Enum Title Determination #111818
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue