Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/space_filebrowser.py
| Show First 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | def draw(self, _context): | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("file.bookmark_move", icon='TRIA_UP_BAR', | layout.operator("file.bookmark_move", icon='TRIA_UP_BAR', | ||||
| text="Move to Top").direction = 'TOP' | text="Move to Top").direction = 'TOP' | ||||
| layout.operator("file.bookmark_move", icon='TRIA_DOWN_BAR', | layout.operator("file.bookmark_move", icon='TRIA_DOWN_BAR', | ||||
| text="Move to Bottom").direction = 'BOTTOM' | text="Move to Bottom").direction = 'BOTTOM' | ||||
| class FILEBROWSER_PT_bookmarks_favorites(Panel): | class FILEBROWSER_PT_bookmarks_favorites(FileBrowserPanel, Panel): | ||||
| bl_space_type = 'FILE_BROWSER' | bl_space_type = 'FILE_BROWSER' | ||||
| bl_region_type = 'TOOLS' | bl_region_type = 'TOOLS' | ||||
| bl_category = "Bookmarks" | bl_category = "Bookmarks" | ||||
| bl_label = "Favorites" | bl_label = "Favorites" | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| return ( | return ( | ||||
| ▲ Show 20 Lines • Show All 213 Lines • ▼ Show 20 Lines | def draw(self, _context): | ||||
| layout.operator("file.select_all", text="None").action = 'DESELECT' | layout.operator("file.select_all", text="None").action = 'DESELECT' | ||||
| layout.operator("file.select_all", text="Inverse").action = 'INVERT' | layout.operator("file.select_all", text="Inverse").action = 'INVERT' | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("file.select_box") | layout.operator("file.select_box") | ||||
| class FILEBROWSER_MT_context_menu(Menu): | class FILEBROWSER_MT_context_menu(FileBrowserMenu, Menu): | ||||
| bl_label = "Files Context Menu" | bl_label = "Files Context Menu" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| st = context.space_data | st = context.space_data | ||||
| params = st.params | params = st.params | ||||
| layout.operator("file.previous", text="Back") | layout.operator("file.previous", text="Back") | ||||
| Show All 10 Lines | def draw(self, context): | ||||
| layout.separator() | layout.separator() | ||||
| layout.operator("file.rename", text="Rename") | layout.operator("file.rename", text="Rename") | ||||
| sub = layout.row() | sub = layout.row() | ||||
| sub.operator_context = 'EXEC_DEFAULT' | sub.operator_context = 'EXEC_DEFAULT' | ||||
| sub.operator("file.delete", text="Delete") | sub.operator("file.delete", text="Delete") | ||||
| active_asset = asset_utils.SpaceAssetInfo.get_active_asset(context) | |||||
| if active_asset: | |||||
| layout.operator("asset.open_containing_blend_file") | |||||
| layout.separator() | layout.separator() | ||||
| sub = layout.row() | sub = layout.row() | ||||
| sub.operator_context = 'EXEC_DEFAULT' | sub.operator_context = 'EXEC_DEFAULT' | ||||
| sub.operator("file.directory_new", text="New Folder") | sub.operator("file.directory_new", text="New Folder") | ||||
| layout.operator("file.bookmark_add", text="Add Bookmark") | layout.operator("file.bookmark_add", text="Add Bookmark") | ||||
| layout.separator() | layout.separator() | ||||
| ▲ Show 20 Lines • Show All 182 Lines • ▼ Show 20 Lines | def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index): | ||||
| row = layout.row(align=True) | row = layout.row(align=True) | ||||
| # Non-editable entries would show grayed-out, which is bad in this specific case, so switch to mere label. | # Non-editable entries would show grayed-out, which is bad in this specific case, so switch to mere label. | ||||
| if tag.is_property_readonly("name"): | if tag.is_property_readonly("name"): | ||||
| row.label(text=tag.name, icon_value=icon) | row.label(text=tag.name, icon_value=icon) | ||||
| else: | else: | ||||
| row.prop(tag, "name", text="", emboss=False, icon_value=icon) | row.prop(tag, "name", text="", emboss=False, icon_value=icon) | ||||
| class ASSETBROWSER_MT_context_menu(AssetBrowserMenu, Menu): | |||||
| bl_label = "Assets Context Menu" | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| st = context.space_data | |||||
| params = st.params | |||||
| layout.operator("file.refresh", text="Refresh") | |||||
| layout.separator() | |||||
| sub = layout.row() | |||||
| sub.operator_context = 'EXEC_DEFAULT' | |||||
| sub.operator("asset.clear", text="Clear Asset") | |||||
| layout.separator() | |||||
| layout.operator("asset.open_containing_blend_file") | |||||
| layout.separator() | |||||
| if params.display_type == 'THUMBNAIL': | |||||
| layout.prop_menu_enum(params, "display_size") | |||||
| classes = ( | classes = ( | ||||
| FILEBROWSER_HT_header, | FILEBROWSER_HT_header, | ||||
| FILEBROWSER_PT_display, | FILEBROWSER_PT_display, | ||||
| FILEBROWSER_PT_filter, | FILEBROWSER_PT_filter, | ||||
| FILEBROWSER_UL_dir, | FILEBROWSER_UL_dir, | ||||
| FILEBROWSER_PT_bookmarks_volumes, | FILEBROWSER_PT_bookmarks_volumes, | ||||
| FILEBROWSER_PT_bookmarks_system, | FILEBROWSER_PT_bookmarks_system, | ||||
| FILEBROWSER_MT_bookmarks_context_menu, | FILEBROWSER_MT_bookmarks_context_menu, | ||||
| Show All 10 Lines | classes = ( | ||||
| ASSETBROWSER_MT_view, | ASSETBROWSER_MT_view, | ||||
| ASSETBROWSER_MT_select, | ASSETBROWSER_MT_select, | ||||
| ASSETBROWSER_PT_navigation_bar, | ASSETBROWSER_PT_navigation_bar, | ||||
| ASSETBROWSER_PT_metadata, | ASSETBROWSER_PT_metadata, | ||||
| ASSETBROWSER_PT_metadata_preview, | ASSETBROWSER_PT_metadata_preview, | ||||
| ASSETBROWSER_PT_metadata_details, | ASSETBROWSER_PT_metadata_details, | ||||
| ASSETBROWSER_PT_metadata_tags, | ASSETBROWSER_PT_metadata_tags, | ||||
| ASSETBROWSER_UL_metadata_tags, | ASSETBROWSER_UL_metadata_tags, | ||||
| ASSETBROWSER_MT_context_menu, | |||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||