Fix T39060: "Choose by numbers" do not work with Enum-menus, but work with operators-menus

The "layer" exception in handling numbers for menus was a bit too much greedy, eating numbers for all RNA props instead of just for layers ones...
This commit is contained in:
Bastien Montagne 2014-03-11 21:06:03 +01:00
parent c2045ef794
commit 330272be9a
Notes: blender-bot 2023-02-14 11:02:40 +01:00
Referenced by issue #39060, "Choose by numbers" do not work with Enum-menus, but work with operators-menus
1 changed files with 6 additions and 5 deletions

View File

@ -7984,16 +7984,17 @@ static int ui_handle_menu_event(bContext *C, const wmEvent *event, uiPopupBlockH
count++;
/* exception for rna layer buts */
if (but->rnapoin.data && but->rnaprop) {
if (ELEM(RNA_property_subtype(but->rnaprop), PROP_LAYER, PROP_LAYER_MEMBER)) {
if (but->rnaindex == act - 1)
doit = true;
if (but->rnapoin.data && but->rnaprop &&
ELEM(RNA_property_subtype(but->rnaprop), PROP_LAYER, PROP_LAYER_MEMBER))
{
if (but->rnaindex == act - 1) {
doit = true;
}
}
else if (count == act) {
doit = true;
}
if (doit) {
/* activate buttons but open menu's */
uiButtonActivateType activate;