Asset Browser: Add separator line & icon padding for import method menu

Usually when a menu item displays an icon, we indent all other items
with an empty icon so items align nicely. Now with more built-in asset
libraries (the new "Essentials" library), this inconsistency becomes
more apparent.

Also add a separator line between the "All" asset library and the
others, makes the menu look more organized.
This commit is contained in:
Julian Eisel
2023-02-15 13:11:10 +01:00
parent e3b5a2ae15
commit 5bac672e1a

View File

@@ -79,9 +79,10 @@ const EnumPropertyItem *ED_asset_library_reference_to_rna_enum_itemf(const bool
const EnumPropertyItem generated_items[] = {
{ASSET_LIBRARY_ALL,
"ALL",
ICON_NONE,
ICON_BLANK1,
"All",
"Show assets from all of the listed asset libraries"},
RNA_ENUM_ITEM_SEPR,
{ASSET_LIBRARY_LOCAL,
"LOCAL",
ICON_CURRENT_FILE,
@@ -89,7 +90,7 @@ const EnumPropertyItem *ED_asset_library_reference_to_rna_enum_itemf(const bool
"Show the assets currently available in this Blender session"},
{ASSET_LIBRARY_ESSENTIALS,
"ESSENTIALS",
ICON_NONE,
ICON_BLANK1,
"Essentials",
"Show the basic building blocks and utilities coming with Blender"},
{0, nullptr, 0, nullptr, nullptr},
@@ -121,7 +122,7 @@ const EnumPropertyItem *ED_asset_library_reference_to_rna_enum_itemf(const bool
const int enum_value = ED_asset_library_reference_to_enum_value(&library_reference);
/* Use library path as description, it's a nice hint for users. */
EnumPropertyItem tmp = {
enum_value, user_library->name, ICON_NONE, user_library->name, user_library->path};
enum_value, user_library->name, ICON_BLANK1, user_library->name, user_library->path};
RNA_enum_item_add(&item, &totitem, &tmp);
}