Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Curry <KevinCurry_Unity>2022-06-15 16:18:39 +0300
committerJulian Eisel <julian@blender.org>2022-06-15 16:27:20 +0300
commit2e33172719c99267ed4fbf99145c26ef09b3ef1d (patch)
tree993075835973dbc500f060487bc3d801a5d4d281 /source/blender/editors/space_file/asset_catalog_tree_view.cc
parent15b4120064f192c29ed5b324bf8e63aa49b95ca6 (diff)
Assets: Don't show duplicated catalog name when dragging assets
While dragging assets over a catalog, we would show both the name and the full catalog path in the drag tooltip. For catalogs at the root level (catalogs without parents) the name and the full path are the same, so it would just display the name twice. This is more confusing than helpful. Now skip displaying the full path in that case. Reviewed by: Julian Eisel Addresses T92855 Differential Revision: https://developer.blender.org/D15190
Diffstat (limited to 'source/blender/editors/space_file/asset_catalog_tree_view.cc')
-rw-r--r--source/blender/editors/space_file/asset_catalog_tree_view.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/editors/space_file/asset_catalog_tree_view.cc b/source/blender/editors/space_file/asset_catalog_tree_view.cc
index e5a4919f548..87595ecdb88 100644
--- a/source/blender/editors/space_file/asset_catalog_tree_view.cc
+++ b/source/blender/editors/space_file/asset_catalog_tree_view.cc
@@ -407,8 +407,15 @@ std::string AssetCatalogDropController::drop_tooltip_asset_list(const wmDrag &dr
std::string basic_tip = is_multiple_assets ? TIP_("Move assets to catalog") :
TIP_("Move asset to catalog");
- return basic_tip + ": " + catalog_item_.get_name() + " (" + catalog_item_.catalog_path().str() +
- ")";
+ basic_tip += ": " + catalog_item_.get_name();
+
+ /* Display the full catalog path, but only if it's not exactly the same as the already shown name
+ * (i.e. not a root level catalog with no parent). */
+ if (catalog_item_.get_name() != catalog_item_.catalog_path().str()) {
+ basic_tip += " (" + catalog_item_.catalog_path().str() + ")";
+ }
+
+ return basic_tip;
}
bool AssetCatalogDropController::on_drop(struct bContext *C, const wmDrag &drag)