diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-04-22 18:16:39 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-04-22 18:45:14 +0300 |
commit | e6d1fb87c6b0184416ce202ccba6a96a3ee04552 (patch) | |
tree | 39e1e321364129dfae355ecff938f0bafb5eae33 /release/scripts/modules | |
parent | b8e7991811dcf6fa698077f850fef17be83d2abb (diff) |
UI: Initial popover support for panels
- UILayout.popover(.. panel_type ..)
A single panel
- UILayout.popover_group(.. panel categories ..)
Expands all panels matching args.
Currently used in the topbar for redo and paint options.
Diffstat (limited to 'release/scripts/modules')
-rw-r--r-- | release/scripts/modules/bpy_types.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py index 1124070fea2..324bb43d890 100644 --- a/release/scripts/modules/bpy_types.py +++ b/release/scripts/modules/bpy_types.py @@ -144,6 +144,15 @@ class WindowManager(bpy_types.ID): finally: self.popmenu_end__internal(popup) + def popover(self, draw_func, title="", icon='NONE'): + import bpy + popup = self.popover_begin__internal(title, icon) + + try: + draw_func(popup, bpy.context) + finally: + self.popover_end__internal(popup) + def popup_menu_pie(self, event, draw_func, title="", icon='NONE'): import bpy pie = self.piemenu_begin__internal(title, icon, event) |