AnimEditors UI: Move less frequently used filtering options to a "Filters" popovers

This commit is an experiment in using popovers as a place to house some
of the filtering options for animation editors, in line with what's taking
place in the Outliner with the filtering popover there too.

Right now, the most frequently used/changed options are still available
on the headers (i.e. the "Only Selected"/"Hidden"/search fields), while
everything else (i.e. the per-datablock filters, which were already hidden
behind a collapsed-toggle button before) now live in the popover.
This commit is contained in:
Joshua Leung
2018-06-26 21:12:25 +12:00
parent c795505a2c
commit 5f545dbde8
3 changed files with 201 additions and 49 deletions

View File

@@ -19,15 +19,17 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu
from bpy.types import Header, Menu, Panel
from .space_dopesheet import (
DopesheetFilterPopoverBase,
dopesheet_filter,
)
class GRAPH_HT_header(Header):
bl_space_type = 'GRAPH_EDITOR'
def draw(self, context):
from .space_dopesheet import dopesheet_filter
layout = self.layout
toolsettings = context.tool_settings
@@ -39,6 +41,12 @@ class GRAPH_HT_header(Header):
# Now a exposed as a sub-space type
# layout.prop(st, "mode", text="")
layout.popover(space_type='GRAPH_EDITOR',
region_type='HEADER',
panel_type="GRAPH_PT_filters",
text="",
icon='FILTER')
GRAPH_MT_editor_menus.draw_collapsible(context, layout)
dopesheet_filter(layout, context)
@@ -72,6 +80,21 @@ class GRAPH_HT_header(Header):
row.operator("graph.ghost_curves_create", text="", icon='GHOST_ENABLED')
class GRAPH_PT_filters(DopesheetFilterPopoverBase, Panel):
bl_space_type = 'GRAPH_EDITOR'
bl_region_type = 'HEADER'
bl_label = "Filters"
def draw(self, context):
layout = self.layout
DopesheetFilterPopoverBase.draw_generic_filters(context, layout)
layout.separator()
DopesheetFilterPopoverBase.draw_search_filters(context, layout)
layout.separator()
DopesheetFilterPopoverBase.draw_standard_filters(context, layout)
class GRAPH_MT_editor_menus(Menu):
bl_idname = "GRAPH_MT_editor_menus"
bl_label = ""
@@ -382,6 +405,7 @@ classes = (
GRAPH_MT_delete,
GRAPH_MT_specials,
GRAPH_MT_channel_specials,
GRAPH_PT_filters,
)
if __name__ == "__main__": # only for live edit.