Assets/UI: Improve asset library Preferences UI

* Open File Browser when pressing "Add Asset Library". This just makes sense,
  since users have to select a directory for the asset library anyway.
* Move '+' icon back to the right side of the box. Then it is right under the
  'x' icons for each indivdual library, which seems like the more natural
  place.
* Correct tooltip for the "Add Asset Library" operator.
* Mark empty asset library name or paths field in red, to make clear that these
  need to be set.
This commit is contained in:
2021-10-23 18:07:48 +02:00
parent 50e7645211
commit 9ad642c59a
2 changed files with 42 additions and 7 deletions

View File

@@ -1410,12 +1410,18 @@ class USERPREF_PT_file_paths_asset_libraries(FilePathsPanel, Panel):
row.label(text="Path")
for i, library in enumerate(paths.asset_libraries):
name_col.prop(library, "name", text="")
row = name_col.row()
row.alert = not library.name
row.prop(library, "name", text="")
row = path_col.row()
row.prop(library, "path", text="")
subrow = row.row()
subrow.alert = not library.path
subrow.prop(library, "path", text="")
row.operator("preferences.asset_library_remove", text="", icon='X', emboss=False).index = i
row = box.row()
row.alignment = 'LEFT'
row.alignment = 'RIGHT'
row.operator("preferences.asset_library_add", text="", icon='ADD', emboss=False)