UI: don't show property shortcuts in menus

Operator shortcuts aren't shown in this case,
use the same logic for properties.
This commit is contained in:
Campbell Barton
2024-01-16 14:09:37 +11:00
parent 17040a0b24
commit a294a9083e
2 changed files with 7 additions and 4 deletions

View File

@@ -1426,7 +1426,9 @@ enum uiStringInfoType {
BUT_GET_TIP,
BUT_GET_RNA_TIP,
BUT_GET_RNAENUM_TIP,
/** Buttons assigned to an operator (common case). */
BUT_GET_OP_KEYMAP,
/** Use for properties that are bound to one of the context cycle, etc. keys. */
BUT_GET_PROP_KEYMAP,
};

View File

@@ -6851,10 +6851,11 @@ void UI_but_string_info_get(bContext *C, uiBut *but, ...)
}
}
else if (type == BUT_GET_PROP_KEYMAP) {
/* for properties that are bound to one of the context cycle, etc. keys... */
char buf[128];
if (ui_but_event_property_operator_string(C, but, buf, sizeof(buf))) {
tmp = BLI_strdup(buf);
if (!(ui_block_is_menu(but->block) && !ui_block_is_pie_menu(but->block))) {
char buf[128];
if (ui_but_event_property_operator_string(C, but, buf, sizeof(buf))) {
tmp = BLI_strdup(buf);
}
}
}