UI: button to create new collection in the Outliner

Expose search like in 2.7, we could make it pop on Ctrl+F to save space if needed.
Align Filter and the less used View menu to the right.

Based on mockups and feedback session with William
This commit is contained in:
Pablo Vazquez 2018-06-21 00:37:57 +02:00
parent 0b7edf105d
commit f3bd5da7fc
1 changed files with 18 additions and 9 deletions

View File

@ -35,7 +35,16 @@ class OUTLINER_HT_header(Header):
row = layout.row(align=True)
row.template_header()
layout.prop(space, "display_mode", text="")
layout.prop(space, "display_mode", icon_only=True)
if display_mode in {'VIEW_LAYER'}:
layout.operator("outliner.collection_new", text="", icon="ZOOMIN").nested = True
layout.separator_spacer()
layout.prop(space, "filter_text", icon="VIEWZOOM", text="")
layout.separator_spacer()
row = layout.row(align=True)
if display_mode in {'VIEW_LAYER'}:
@ -50,8 +59,6 @@ class OUTLINER_HT_header(Header):
sub.active = space.use_filter_id_type
sub.prop(space, "filter_id_type", text="", icon_only=True)
OUTLINER_MT_editor_menus.draw_collapsible(context, layout)
if space.display_mode == 'DATA_API':
layout.separator()
@ -70,12 +77,7 @@ class OUTLINER_HT_header(Header):
row = layout.row()
row.label(text="No Keying Set Active")
row = layout.row(align=True)
row.prop(space, "use_filter_search", text="")
if space.use_filter_search:
row.prop(space, "filter_text", text="")
row.prop(space, "use_filter_complete", text="")
row.prop(space, "use_filter_case_sensitive", text="")
OUTLINER_MT_editor_menus.draw_collapsible(context, layout)
class OUTLINER_MT_editor_menus(Menu):
@ -106,12 +108,19 @@ class OUTLINER_MT_view(Menu):
space = context.space_data
layout.prop(space, "use_filter_complete", text="Exact Match Search")
layout.prop(space, "use_filter_case_sensitive", text="Case Sensitive Search")
layout.separator()
if space.display_mode != 'DATA_API':
layout.prop(space, "use_sort_alpha")
layout.prop(space, "show_restrict_columns")
layout.separator()
layout.operator("outliner.show_active")
layout.separator()
layout.operator("outliner.show_one_level", text="Show One Level")
layout.operator("outliner.show_one_level", text="Hide One Level").open = False
layout.operator("outliner.show_hierarchy")