TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::ItemDragDropConfig Struct Reference

Drag & drop setup for item-based views (tree, list, grid): items drag a payload and accept drops of the same payloadType. More...

#include <gui_controls/gui_widget_state_types.h>

Public Attributes

uint32_t payloadType = 0
 0 = disabled
std::function< uintptr_t(tachyon::ID)> getPayload
 What to drag: the payload value for an item ID.
std::function< bool(uintptr_t payload, tachyon::ID targetID)> canDrop
 Optional: returning false refuses the payload at that target (e.g.
std::function< void(uintptr_t, tachyon::ID)> onDrop
 Called with the dropped payload and the target ID (in a grid, the view's ID for a drop on the background).
std::function< void(uintptr_t srcPayload, tachyon::ID targetID, TreeDropPosition pos)> onReorder
 Tree reorder; when set, rows become drop targets with sibling and child zones.
bool dropInsideOnly = false
 Every drop on a row means InsideLast (folder-style targets, no sibling reordering).
tachyon::DragVisualizer visualizer
 optional visual feedback

Detailed Description

Drag & drop setup for item-based views (tree, list, grid): items drag a payload and accept drops of the same payloadType.

Member Data Documentation

◆ payloadType

uint32_t tachyon::ItemDragDropConfig::payloadType = 0

0 = disabled

◆ getPayload

std::function<uintptr_t(tachyon::ID)> tachyon::ItemDragDropConfig::getPayload

What to drag: the payload value for an item ID.

◆ canDrop

std::function<bool(uintptr_t payload, tachyon::ID targetID)> tachyon::ItemDragDropConfig::canDrop

Optional: returning false refuses the payload at that target (e.g.

a folder rejecting its own parent).

◆ onDrop

std::function<void(uintptr_t, tachyon::ID)> tachyon::ItemDragDropConfig::onDrop

Called with the dropped payload and the target ID (in a grid, the view's ID for a drop on the background).

◆ onReorder

std::function<void(uintptr_t srcPayload, tachyon::ID targetID, TreeDropPosition pos)> tachyon::ItemDragDropConfig::onReorder

Tree reorder; when set, rows become drop targets with sibling and child zones.

◆ dropInsideOnly

bool tachyon::ItemDragDropConfig::dropInsideOnly = false

Every drop on a row means InsideLast (folder-style targets, no sibling reordering).

◆ visualizer

tachyon::DragVisualizer tachyon::ItemDragDropConfig::visualizer

optional visual feedback


The documentation for this struct was generated from the following file: