diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-17 05:03:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-17 05:03:56 +0400 |
commit | 350a776a526531ce1dd9160e343d9a929dfe5288 (patch) | |
tree | 2d0d12e0452f539ac8820cddabc6e719425b6c1d /source/blender/editors/interface | |
parent | 0601d540680d323bbb9fe39c8e8273358298cbdc (diff) |
fix for arrow keys being reversed in the snap menu (Ctrl+Shift+Tab)
also - when expanding rna enums into existing menus - don't nest inside a row/column.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 9 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_layout.c | 9 |
2 files changed, 13 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index c87bb2a97a1..d1f6f1e1063 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -6559,6 +6559,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle ui_pan_to_scroll(event, &type, &val); if (val == KM_PRESS) { + const eButType type_flip = BUT | ROW; PASS_EVENT_TO_PARENT_IF_NONACTIVE; @@ -6571,13 +6572,13 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle { /* the following is just a hack - uiBut->type set to BUT and BUTM have there menus built * opposite ways - this should be changed so that all popup-menus use the same uiBlock->direction */ - if (but->type & BUT) + if (but->type & type_flip) but = ui_but_next(but); else but = ui_but_prev(but); } else { - if (but->type & BUT) + if (but->type & type_flip) but = ui_but_prev(but); else but = ui_but_next(but); @@ -6594,7 +6595,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle ((ELEM(type, UPARROWKEY, WHEELUPMOUSE)) && (block->direction & UI_RIGHT)) || ((ELEM(type, DOWNARROWKEY, WHEELDOWNMOUSE)) && (block->direction & UI_TOP))) { - if ((bt = ui_but_first(block)) && (bt->type & BUT)) { + if ((bt = ui_but_first(block)) && (bt->type & type_flip)) { bt = ui_but_last(block); } else { @@ -6602,7 +6603,7 @@ static int ui_handle_menu_event(bContext *C, wmEvent *event, uiPopupBlockHandle } } else { - if ((bt = ui_but_first(block)) && (bt->type & BUT)) { + if ((bt = ui_but_first(block)) && (bt->type & type_flip)) { /* keep ui_but_first() */ } else { diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 3b0a1cd3eb5..e87c0ee1c9b 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -491,7 +491,14 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt RNA_property_enum_items_gettexted(block->evil_C, ptr, prop, &item, &totitem, &free); - uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1)); + /* we dont want nested rows, cols in menus */ + if (layout->root->type != UI_LAYOUT_MENU) { + uiBlockSetCurLayout(block, ui_item_local_sublayout(layout, layout, 1)); + } + else { + uiBlockSetCurLayout(block, layout); + } + for (a = 0; a < totitem; a++) { if (!item[a].identifier[0]) continue; |