diff options
author | Joshua Leung <aligorith@gmail.com> | 2018-06-26 12:12:25 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2018-06-26 12:44:14 +0300 |
commit | 5f545dbde81352fd2e98fdb77e8a2d15434d2648 (patch) | |
tree | a1dbd9e849d91f27702df850baa33c1e49764b38 /release/scripts/startup/bl_ui/space_graph.py | |
parent | c795505a2c751e1396029c8797af79e1b5b98447 (diff) |
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.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_graph.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_graph.py | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index 6aeef4d7240..9a22e0b4bd7 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -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. |