|
Blender V5.0
|
Inherits blender::ui::TreeViewItemDropTarget.
Public Member Functions | |
| LayerNodeDropTarget (AbstractTreeViewItem &item, TreeNode &drop_tree_node, DropBehavior behavior) | |
| bool | can_drop (const wmDrag &drag, const char **) const override |
| std::string | drop_tooltip (const DragInfo &drag_info) const override |
| bool | on_drop (bContext *C, const DragInfo &drag_info) const override |
| Public Member Functions inherited from blender::ui::TreeViewItemDropTarget | |
| TreeViewItemDropTarget (AbstractTreeViewItem &view_item, DropBehavior behavior=DropBehavior::Insert) | |
| std::optional< DropLocation > | choose_drop_location (const ARegion ®ion, const wmEvent &event) const override |
| template<class ViewType> | |
| ViewType & | get_view () const |
| Public Member Functions inherited from blender::ui::DropTargetInterface | |
| DropTargetInterface ()=default | |
| virtual | ~DropTargetInterface ()=default |
Additional Inherited Members | |
| Protected Attributes inherited from blender::ui::TreeViewItemDropTarget | |
| AbstractTreeViewItem & | view_item_ |
| const DropBehavior | behavior_ |
Definition at line 48 of file interface_template_grease_pencil_layer_tree.cc.
|
inline |
Definition at line 52 of file interface_template_grease_pencil_layer_tree.cc.
References blender::ui::TreeViewItemDropTarget::TreeViewItemDropTarget().
|
inlineoverridevirtual |
Check if the data dragged with drag can be dropped on the element this drop target is for.
| r_disabled_hint | Return a static string to display to the user, explaining why dropping isn't possible on this UI element. Shouldn't be done too aggressively, e.g. don't set this if the drag-type can't be dropped here; only if it can but there's another reason it can't be dropped. Can assume this is a non-null pointer. |
Implements blender::ui::DropTargetInterface.
Definition at line 57 of file interface_template_grease_pencil_layer_tree.cc.
References ELEM, wmDragGreasePencilLayer::node, wmDrag::poin, wmDrag::type, WM_DRAG_GREASE_PENCIL_GROUP, and WM_DRAG_GREASE_PENCIL_LAYER.
|
inlineoverridevirtual |
Custom text to display when dragging over the element using this drop target. Should explain what happens when dropping the data onto this UI element. Will only be used if #DropTargetInterface::can_drop() returns true, so the implementing override doesn't have to check that again. The returned value must be a translated string.
Implements blender::ui::DropTargetInterface.
Definition at line 76 of file interface_template_grease_pencil_layer_tree.cc.
References blender::ui::After, blender::ui::Before, BLI_assert_unreachable, blender::ui::DragInfo::drag_data, blender::ui::DragInfo::drop_location, blender::ui::Into, blender::bke::greasepencil::TreeNode::is_layer(), GreasePencilLayerTreeNode::name, wmDragGreasePencilLayer::node, wmDrag::poin, and TIP_.
|
inlineoverridevirtual |
Execute the logic to apply a drop of the data dragged with drag onto/into the UI element this drop target is for.
Implements blender::ui::DropTargetInterface.
Definition at line 104 of file interface_template_grease_pencil_layer_tree.cc.
References active, blender::ui::After, blender::ui::Before, BLI_assert_msg, BLI_assert_unreachable, C, CTX_wm_message_bus(), DEG_id_tag_update(), blender::ui::DragInfo::drag_data, blender::ui::DragInfo::drop_location, ED_undo_push(), wmDragGreasePencilLayer::grease_pencil, GreasePencil::id, ID_RECALC_GEOMETRY, blender::ui::Into, blender::bke::greasepencil::TreeNode::is_group(), blender::bke::greasepencil::TreeNode::is_layer(), NA_EDITED, NC_GPENCIL, wmDragGreasePencilLayer::node, wmDrag::poin, WM_event_add_notifier(), and WM_msg_publish_rna_prop.