diff options
author | Julian Eisel <julian@blender.org> | 2022-05-23 21:04:51 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2022-05-23 21:11:42 +0300 |
commit | 9039fbaa9ce171d40a75cc7fb56b2e3f004334bb (patch) | |
tree | f552d86f95334a4eef91558c609d243fa84f0f5d | |
parent | 917c096be6b93ce5ad1eb284d344da10000ab896 (diff) |
Asset Browser: Show "Current File" icon in sidebar source field
If the asset is stored in the current file, display the corresponding
icon in the "Source" button in the sidebar. This is a nice indicator and
helps users learn what this icon represents (it's used in the main
region without text too).
-rw-r--r-- | release/scripts/startup/bl_ui/space_filebrowser.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py index 07ec0cd85a6..e69a1024712 100644 --- a/release/scripts/startup/bl_ui/space_filebrowser.py +++ b/release/scripts/startup/bl_ui/space_filebrowser.py @@ -696,11 +696,12 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel): prefs = context.preferences show_asset_debug_info = prefs.view.show_developer_ui and prefs.experimental.show_asset_debug_info + is_local_asset = bool(asset_file_handle.local_id) layout.use_property_split = True layout.use_property_decorate = False # No animation. - if asset_file_handle.local_id: + if is_local_asset: # If the active file is an ID, use its name directly so renaming is possible from right here. layout.prop(asset_file_handle.local_id, "name") @@ -720,7 +721,7 @@ class ASSETBROWSER_PT_metadata(asset_utils.AssetBrowserPanel, Panel): col.prop(asset_file_handle.asset_data, "catalog_simple_name", text="Simple Name") row = layout.row(align=True) - row.prop(wm, "asset_path_dummy", text="Source") + row.prop(wm, "asset_path_dummy", text="Source", icon='CURRENT_FILE' if is_local_asset else 'NONE') row.operator("asset.open_containing_blend_file", text="", icon='TOOL_SETTINGS') layout.prop(asset_file_handle.asset_data, "description") |