[Bf-blender-cvs] [5854438265c] asset-browser: Add refresh button for external repositories
Julian Eisel
noreply at git.blender.org
Sat Nov 21 00:26:27 CET 2020
Commit: 5854438265c57320519094b60fbbb44eb327c1c2
Author: Julian Eisel
Date: Sat Nov 21 00:24:50 2020 +0100
Branches: asset-browser
https://developer.blender.org/rB5854438265c57320519094b60fbbb44eb327c1c2
Add refresh button for external repositories
External repositories (ie all repositories but the "Current File" one) need
manual refreshing to reflect changes. So show a button for that in the Asset
Browser header, attached to the repository selector.
===================================================================
M release/scripts/startup/bl_ui/space_filebrowser.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index ea043e98671..5f3f21d5336 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -33,7 +33,11 @@ class FILEBROWSER_HT_header(Header):
space_data = context.space_data
params = space_data.params
- layout.prop(params, "asset_repository", text="")
+ row = layout.row(align=True)
+ row.prop(params, "asset_repository", text="")
+ # External repositories don't auto-refresh, add refresh button.
+ if params.asset_repository != 'LOCAL':
+ row.operator("file.refresh", text="", icon="FILE_REFRESH")
layout.separator_spacer()
More information about the Bf-blender-cvs
mailing list