Outliner: remove view menu, move more into RMB context menu and filter popover.
authorWilliam Reynish <billreynish>
Mon, 2 Jul 2018 15:36:51 +0000 (17:36 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 2 Jul 2018 15:40:20 +0000 (17:40 +0200)
release/scripts/startup/bl_ui/space_outliner.py
source/blender/editors/space_outliner/outliner_tools.c

index 7bd3d10934ee305f906a3f7b33c10788c0d4fd8c..19f3bcd3b1fbeb857d983935e0a37825d30551bf 100644 (file)
@@ -37,8 +37,8 @@ class OUTLINER_HT_header(Header):
 
         layout.prop(space, "display_mode", icon_only=True)
 
-        if display_mode in {'VIEW_LAYER'}:
-            layout.operator("outliner.collection_new", text="", icon='GROUP').nested = True
+        if display_mode == 'DATA_API':
+            OUTLINER_MT_editor_menus.draw_collapsible(context, layout)
 
         layout.separator_spacer()
 
@@ -60,7 +60,13 @@ class OUTLINER_HT_header(Header):
             sub.active = space.use_filter_id_type
             sub.prop(space, "filter_id_type", text="", icon_only=True)
 
-        if space.display_mode == 'DATA_API':
+        if display_mode == 'VIEW_LAYER':
+            layout.operator("outliner.collection_new", text="", icon='GROUP').nested = True
+
+        elif display_mode == 'ORPHAN_DATA':
+            layout.operator("outliner.orphans_purge", text="Purge")
+
+        elif space.display_mode == 'DATA_API':
             layout.separator()
 
             row = layout.row(align=True)
@@ -78,8 +84,6 @@ class OUTLINER_HT_header(Header):
                 row = layout.row()
                 row.label(text="No Keying Set Active")
 
-        OUTLINER_MT_editor_menus.draw_collapsible(context, layout)
-
 
 class OUTLINER_MT_editor_menus(Menu):
     bl_idname = "OUTLINER_MT_editor_menus"
@@ -92,14 +96,9 @@ class OUTLINER_MT_editor_menus(Menu):
     def draw_menus(layout, context):
         space = context.space_data
 
-        layout.menu("OUTLINER_MT_view")
-
         if space.display_mode == 'DATA_API':
             layout.menu("OUTLINER_MT_edit_datablocks")
 
-        elif space.display_mode == 'ORPHAN_DATA':
-            layout.menu("OUTLINER_MT_edit_orphan_data")
-
 
 class OUTLINER_MT_context(Menu):
     bl_label = "Outliner"
@@ -107,33 +106,17 @@ class OUTLINER_MT_context(Menu):
     def draw(self, context):
         layout = self.layout
 
-        layout.menu("INFO_MT_area")
-
-
-class OUTLINER_MT_view(Menu):
-    bl_label = "View"
-
-    def draw(self, context):
-        layout = self.layout
-
-        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.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")
 
         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.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")
+        layout.menu("INFO_MT_area")
 
 
 class OUTLINER_MT_edit_datablocks(Menu):
@@ -151,13 +134,6 @@ class OUTLINER_MT_edit_datablocks(Menu):
         layout.operator("outliner.drivers_delete_selected")
 
 
-class OUTLINER_MT_edit_orphan_data(Menu):
-    bl_label = "Edit"
-
-    def draw(self, context):
-        layout = self.layout
-        layout.operator("outliner.orphans_purge")
-
 
 class OUTLINER_MT_collection_view_layer(Menu):
     bl_label = "View Layer"
@@ -273,50 +249,52 @@ class OUTLINER_PT_filter(Panel):
         space = context.space_data
         display_mode = space.display_mode
 
-        layout.prop(space, "use_filter_collection", text="Collections")
+        layout.prop(space, "use_filter_complete", text="Exact Match Search")
+        layout.prop(space, "use_filter_case_sensitive", text="Case Sensitive Search")
 
         layout.separator()
 
-        col = layout.column()
-        col.prop(space, "use_filter_object", text="Objects")
-        active = space.use_filter_object
+        if space.display_mode != 'DATA_API':
+            layout.prop(space, "use_sort_alpha")
+            layout.prop(space, "show_restrict_columns")
+            layout.separator()
 
-        sub = col.column(align=True)
-        sub.active = active
-        sub.prop(space, "filter_state", text="")
-        sub.prop(space, "use_filter_object_content", text="Object Contents")
-        sub.prop(space, "use_filter_children", text="Object Children")
+        col = layout.column(align=True)
 
-        layout.separator()
+        col.prop(space, "use_filter_collection", text="Collections", icon="GROUP")
+        col.prop(space, "use_filter_object", text="Objects", icon="OBJECT_DATAMODE")
 
-        col = layout.column_flow(align=True)
-        col.active = active
+        sub = col.column(align=True)
+        sub.active = space.use_filter_object
 
         if bpy.data.meshes:
-            col.prop(space, "use_filter_object_mesh", text="Meshes")
+            sub.prop(space, "use_filter_object_mesh", text="Meshes", icon="MESH_DATA")
         if bpy.data.armatures:
-            col.prop(space, "use_filter_object_armature", text="Armatures")
+            sub.prop(space, "use_filter_object_armature", text="Armatures", icon="ARMATURE_DATA")
         if bpy.data.lamps:
-            col.prop(space, "use_filter_object_lamp", text="Lamps")
+            sub.prop(space, "use_filter_object_lamp", text="Lamps", icon="LAMP_DATA")
         if bpy.data.cameras:
-            col.prop(space, "use_filter_object_camera", text="Cameras")
+            sub.prop(space, "use_filter_object_camera", text="Cameras", icon="CAMERA_DATA")
 
-        col.prop(space, "use_filter_object_empty", text="Empties")
+        sub.prop(space, "use_filter_object_empty", text="Empties", icon="EMPTY_DATA")
 
         if bpy.data.curves or \
            bpy.data.metaballs or \
            bpy.data.lightprobes or \
            bpy.data.lattices or \
            bpy.data.fonts or bpy.data.speakers:
-            col.prop(space, "use_filter_object_others", text="Others")
+            sub.prop(space, "use_filter_object_others", text="Others")
+
+        subsub = sub.column(align=False)
+        subsub.prop(space, "filter_state", text="")
+        subsub.prop(space, "use_filter_object_content", text="Object Contents")
+        subsub.prop(space, "use_filter_children", text="Object Children")
 
 
 classes = (
     OUTLINER_HT_header,
     OUTLINER_MT_editor_menus,
-    OUTLINER_MT_view,
     OUTLINER_MT_edit_datablocks,
-    OUTLINER_MT_edit_orphan_data,
     OUTLINER_MT_collection,
     OUTLINER_MT_collection_new,
     OUTLINER_MT_collection_view_layer,
index 16abed604141344d0126e5f75a1753b73a80775e..9952db5e6524f7c8cdc3b904ae9e04e147e30f28 100644 (file)
@@ -1898,7 +1898,7 @@ static int do_outliner_operation_event(bContext *C, ARegion *ar, SpaceOops *soop
                        }
                }
 
-               return OPERATOR_CANCELLED;
+               return 0;
        }
 
        for (te = te->subtree.first; te; te = te->next) {