Asset Browser: New catalog menu

This replaces the old Edit menu, creating a menu only for catalog
operators. The Undo/Redo were already working only for catalogs, so now
this is more clear.

The menu also contains the Save and New catalog operators.

Differential Revision: https://developer.blender.org/D16820
This commit is contained in:
Dalai Felinto 2022-12-20 13:05:40 +01:00
parent 834ca5d682
commit a8aae66f0e
Notes: blender-bot 2023-02-14 04:07:50 +01:00
Referenced by issue #103265, Pose Library: Usability pass/redesign
1 changed files with 8 additions and 4 deletions

View File

@ -644,7 +644,7 @@ class ASSETBROWSER_MT_editor_menus(AssetBrowserMenu, Menu):
layout.menu("ASSETBROWSER_MT_view")
layout.menu("ASSETBROWSER_MT_select")
layout.menu("ASSETBROWSER_MT_edit")
layout.menu("ASSETBROWSER_MT_catalog")
class ASSETBROWSER_MT_view(AssetBrowserMenu, Menu):
@ -683,8 +683,8 @@ class ASSETBROWSER_MT_select(AssetBrowserMenu, Menu):
layout.operator("file.select_box")
class ASSETBROWSER_MT_edit(AssetBrowserMenu, Menu):
bl_label = "Edit"
class ASSETBROWSER_MT_catalog(AssetBrowserMenu, Menu):
bl_label = "Catalog"
def draw(self, _context):
layout = self.layout
@ -692,6 +692,10 @@ class ASSETBROWSER_MT_edit(AssetBrowserMenu, Menu):
layout.operator("asset.catalog_undo", text="Undo")
layout.operator("asset.catalog_redo", text="Redo")
layout.separator()
layout.operator("asset.catalogs_save")
layout.operator("asset.catalog_new").parent_path = ""
class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel):
bl_region_type = 'TOOL_PROPS'
@ -844,7 +848,7 @@ classes = (
ASSETBROWSER_MT_editor_menus,
ASSETBROWSER_MT_view,
ASSETBROWSER_MT_select,
ASSETBROWSER_MT_edit,
ASSETBROWSER_MT_catalog,
ASSETBROWSER_MT_metadata_preview_menu,
ASSETBROWSER_PT_metadata,
ASSETBROWSER_PT_metadata_preview,