[Bf-blender-cvs] [baf45e1ac8a] asset-shelf: Show asset name in tooltip, add a small gap before catalog tabs

Julian Eisel noreply at git.blender.org
Fri Feb 3 15:51:09 CET 2023


Commit: baf45e1ac8ab944fead1f41e17cfc499ec422604
Author: Julian Eisel
Date:   Fri Feb 3 15:50:22 2023 +0100
Branches: asset-shelf
https://developer.blender.org/rBbaf45e1ac8ab944fead1f41e17cfc499ec422604

Show asset name in tooltip, add a small gap before catalog tabs

===================================================================

M	source/blender/editors/asset/intern/asset_shelf.cc
M	source/blender/editors/interface/interface_template_asset_shelf.cc

===================================================================

diff --git a/source/blender/editors/asset/intern/asset_shelf.cc b/source/blender/editors/asset/intern/asset_shelf.cc
index 6974397abfe..f770e2e668b 100644
--- a/source/blender/editors/asset/intern/asset_shelf.cc
+++ b/source/blender/editors/asset/intern/asset_shelf.cc
@@ -488,6 +488,8 @@ static void asset_shelf_footer_draw(const bContext *C, Header *header)
                     UI_UNIT_Y,
                     TIP_("Select catalogs to display"));
 
+  uiItemS(layout);
+
   AssetShelfSettings *shelf_settings = get_asset_shelf_settings_from_context(C);
   if (shelf_settings) {
     add_catalog_toggle_buttons(*shelf_settings, *layout);
diff --git a/source/blender/editors/interface/interface_template_asset_shelf.cc b/source/blender/editors/interface/interface_template_asset_shelf.cc
index 114062716f9..d709df573e2 100644
--- a/source/blender/editors/interface/interface_template_asset_shelf.cc
+++ b/source/blender/editors/interface/interface_template_asset_shelf.cc
@@ -66,11 +66,13 @@ static void asset_tile_draw(uiLayout &layout,
   uiLayoutSetContextPointer(&layout, "active_file", &file_ptr);
 
   uiBlock *block = uiLayoutGetBlock(&layout);
+  const StringRefNull name = ED_asset_handle_get_name(&asset_handle);
+
   uiBut *but = uiDefIconTextBut(block,
                                 UI_BTYPE_PREVIEW_TILE,
                                 0,
                                 ED_asset_handle_get_preview_icon_id(&asset_handle),
-                                show_names ? ED_asset_handle_get_name(&asset_handle) : "",
+                                show_names ? name.c_str() : "",
                                 0,
                                 0,
                                 width,
@@ -80,7 +82,7 @@ static void asset_tile_draw(uiLayout &layout,
                                 0,
                                 0,
                                 0,
-                                "");
+                                name.c_str());
   ui_def_but_icon(but,
                   ED_asset_handle_get_preview_icon_id(&asset_handle),
                   /* NOLINTNEXTLINE: bugprone-suspicious-enum-usage */



More information about the Bf-blender-cvs mailing list