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:
authorJulian Eisel <julian@blender.org>2021-10-27 15:50:48 +0300
committerJulian Eisel <julian@blender.org>2021-10-27 15:56:57 +0300
commitaae5f15238f73fcac762a1690e052b86fad23be1 (patch)
tree5549df5789c1b586404a2bae575f0043c56d51db /source/blender/windowmanager/intern/wm_dragdrop.c
parent1832e11f39a36681533c148de9300b290a8c309c (diff)
Asset Browser: Support dragging catalogs to move them in the hierarchy
Uses the additions to the UI tree-view API from the previous commit to enable drag & drop of asset catalogs. The catalogs will be moved in the tree including children. A remaining issue is that a catalog with children will always be collapsed when dropping. I need to find a way to fix that in the tree-view API. There are a few improvements I can think of for the tree-item drag & drop support, but time for these is too short. These can be done as normal cleanups at some point.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_dragdrop.c')
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 50ac046ed54..df6d3d5e9e7 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -181,6 +181,7 @@ wmDrag *WM_event_start_drag(
}
break;
case WM_DRAG_ASSET:
+ case WM_DRAG_ASSET_CATALOG:
/* Move ownership of poin to wmDrag. */
drag->poin = poin;
drag->flags |= WM_DRAG_FREE_DATA;
@@ -649,6 +650,15 @@ void WM_drag_free_imported_drag_ID(struct Main *bmain, wmDrag *drag, wmDropBox *
}
}
+wmDragAssetCatalog *WM_drag_get_asset_catalog_data(const wmDrag *drag)
+{
+ if (drag->type != WM_DRAG_ASSET_CATALOG) {
+ return NULL;
+ }
+
+ return drag->poin;
+}
+
/**
* \note: Does not store \a asset in any way, so it's fine to pass a temporary.
*/