diff options
author | Pablo Vazquez <pablo@blender.org> | 2020-06-18 18:00:05 +0300 |
---|---|---|
committer | Pablo Vazquez <pablo@blender.org> | 2020-06-18 18:54:49 +0300 |
commit | 667ef9917fa69cb45325badac357c98b505c8af2 (patch) | |
tree | 0c62ff476ce36bb0f44cc4c028f87b0bbe7b3fa3 | |
parent | 6899cb3c073e8dbd896fdd183a9f405b579634e6 (diff) |
UI: Place "New Collection" item above list in Move/Link to Collection menu
This way "New Collection" is always assigned the same shortcut (N).
Whereas previously it would be automatically assigned the leftover key
from the list of available collections.
Nice side effect is that since N is next to M in most keyboard layouts,
moving to a new collection is super fast by hitting M then N.
{F8630575, size=full}
Paper-cut pointed out by DerekWatts on [devtalk](https://devtalk.blender.org/t/blender-ui-paper-cuts/2596/4211) (thanks!):
{F8630492, size=full}
Reviewed By: HooglyBoogly
Differential Revision: https://developer.blender.org/D8067
-rw-r--r-- | source/blender/editors/object/object_edit.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index d522dcabae3..90dd16ea393 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1771,15 +1771,8 @@ static void move_to_collection_menu_create(bContext *UNUSED(C), uiLayout *layout const char *name = BKE_collection_ui_name_get(menu->collection); UI_block_flag_enable(uiLayoutGetBlock(layout), UI_BLOCK_IS_FLIP); - uiItemIntO(layout, name, ICON_NONE, menu->ot->idname, "collection_index", menu->index); - uiItemS(layout); - - for (MoveToCollectionData *submenu = menu->submenus.first; submenu != NULL; - submenu = submenu->next) { - move_to_collection_menus_items(layout, submenu); - } - uiItemS(layout); + // uiItemS(layout); WM_operator_properties_create_ptr(&menu->ptr, menu->ot); RNA_int_set(&menu->ptr, "collection_index", menu->index); @@ -1787,6 +1780,15 @@ static void move_to_collection_menu_create(bContext *UNUSED(C), uiLayout *layout uiItemFullO_ptr( layout, menu->ot, "New Collection", ICON_ADD, menu->ptr.data, WM_OP_INVOKE_DEFAULT, 0, NULL); + + uiItemS(layout); + + uiItemIntO(layout, name, ICON_SCENE_DATA, menu->ot->idname, "collection_index", menu->index); + + for (MoveToCollectionData *submenu = menu->submenus.first; submenu != NULL; + submenu = submenu->next) { + move_to_collection_menus_items(layout, submenu); + } } static void move_to_collection_menus_items(uiLayout *layout, MoveToCollectionData *menu) |