diff options
Diffstat (limited to 'release')
-rw-r--r-- | release/ui/space_filebrowser.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/release/ui/space_filebrowser.py b/release/ui/space_filebrowser.py index f81f45ff530..d23cc0f276c 100644 --- a/release/ui/space_filebrowser.py +++ b/release/ui/space_filebrowser.py @@ -13,6 +13,11 @@ class FILEBROWSER_HT_header(bpy.types.Header): params = st.params layout.template_header(context) + if context.area.show_menus: + row = layout.row() + row.itemM("FILEBROWSER_MT_directory") + row.itemM("FILEBROWSER_MT_bookmarks") + row = layout.row(align=True) row.itemO("FILE_OT_parent", text="", icon='ICON_FILE_PARENT') row.itemO("FILE_OT_refresh", text="", icon='ICON_FILE_REFRESH') @@ -38,6 +43,26 @@ class FILEBROWSER_HT_header(bpy.types.Header): else: row.active = False -bpy.types.register(FILEBROWSER_HT_header) +class FILEBROWSER_MT_directory(bpy.types.Menu): + __space_type__ = "FILE_BROWSER" + __label__ = "Directory" + + def draw(self, context): + layout = self.layout + + layout.itemO("FILE_OT_refresh", text="Refresh", icon='ICON_FILE_REFRESH') + layout.itemO("FILE_OT_parent", text="Parent", icon='ICON_FILE_PARENT') + +class FILEBROWSER_MT_bookmarks(bpy.types.Menu): + __space_type__ = "FILE_BROWSER" + __label__ = "Bookmarks" + def draw(self, context): + layout = self.layout + layout.itemO("FILE_OT_add_bookmark", text="Add current directory", icon='ICON_BOOKMARKS') + + +bpy.types.register(FILEBROWSER_HT_header) +bpy.types.register(FILEBROWSER_MT_directory) +bpy.types.register(FILEBROWSER_MT_bookmarks) |