10#include <unordered_set>
33 std::string
hint =
"Search or run a command";
66 std::function<void(uintptr_t srcPayload,
tachyon::ID targetID,
87 .sameAsPrevious = (
lastID == id),
88 .elapsedMs =
static_cast<float>(now -
lastTimeNanos) / 1'000'000.0f,
TreeDropPosition
Where a tree reorder drop lands relative to the target row.
Definition gui_widget_state_types.h:44
@ InsideLast
last child of the target (rectangle around the row)
Definition gui_widget_state_types.h:48
@ After
next sibling of the target (line at the row bottom)
Definition gui_widget_state_types.h:49
@ Inside
first child of an open target branch (indented line at the row bottom)
Definition gui_widget_state_types.h:47
std::function< void(const DragVisualContext &context)> DragVisualizer
Draws the dragged item while a drag is in progress.
Definition gui_drag_drop_state.h:33
@ None
Definition gui_element_flags.h:19
@ Before
Force a line break before this element (CSS: left).
Definition gui_style.h:468
int64_t SteadyClockNowNanos()
Monotonic steady_clock time in nanoseconds; a plain int64_t keeps <chrono> out of widely-included hea...
Definition gui_logging.h:24
State of a CommandSearch box; user-owned, keep it alive across frames.
Definition gui_widget_state_types.h:31
tachyon::ID listWindowID
internal: the results popup
Definition gui_widget_state_types.h:39
std::string shortcut
Keycap at the right, e.g. the key that focuses the search.
Definition gui_widget_state_types.h:35
int current
highlighted match, moved by Up / Down
Definition gui_widget_state_types.h:36
std::string hint
shown while the query is empty
Definition gui_widget_state_types.h:33
bool focusRequested
set by FocusCommandSearch, taken next frame
Definition gui_widget_state_types.h:37
std::string query
the typed text
Definition gui_widget_state_types.h:32
bool ranCommand
a command ran since the last CommandSearch call
Definition gui_widget_state_types.h:38
Whether this click hit the same item as the previous one, and the time since it.
Definition gui_widget_state_types.h:80
bool sameAsPrevious
Definition gui_widget_state_types.h:80
float elapsedMs
Definition gui_widget_state_types.h:80
Click-gesture tracker, owned per widget instance so instances (and tests) don't share it.
Definition gui_widget_state_types.h:75
int64_t lastTimeNanos
steady-clock ns; see SteadyClockNowNanos()
Definition gui_widget_state_types.h:77
void Reset()
Forgets the previous click, so the next one never counts as a repeat.
Definition gui_widget_state_types.h:108
bool IsDoubleClick(tachyon::ID id)
Records a click on id: true when it is the second click of a double-click (the same item,...
Definition gui_widget_state_types.h:98
Result Update(tachyon::ID id)
Records a click on id and compares it with the previous click.
Definition gui_widget_state_types.h:83
tachyon::ID lastID
item of the previous click
Definition gui_widget_state_types.h:76
A 64-bit element ID whose bit layout depends on its IDMode.
Definition gui_id.h:23
static constexpr ID Invalid()
The "no element" ID (all bits zero); also the default for optional ID parameters.
Definition gui_id.h:66
Drag & drop setup for item-based views (tree, list, grid): items drag a payload and accept drops of t...
Definition gui_widget_state_types.h:55
bool dropInsideOnly
Every drop on a row means InsideLast (folder-style targets, no sibling reordering).
Definition gui_widget_state_types.h:69
std::function< uintptr_t(tachyon::ID)> getPayload
What to drag: the payload value for an item ID.
Definition gui_widget_state_types.h:58
uint32_t payloadType
0 = disabled
Definition gui_widget_state_types.h:56
tachyon::DragVisualizer visualizer
optional visual feedback
Definition gui_widget_state_types.h:70
std::function< bool(uintptr_t payload, tachyon::ID targetID)> canDrop
Optional: returning false refuses the payload at that target (e.g.
Definition gui_widget_state_types.h:61
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 backgro...
Definition gui_widget_state_types.h:64
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.
Definition gui_widget_state_types.h:67
Selected item IDs of a multi-select view; user-owned, keep it alive across frames.
Definition gui_widget_state_types.h:22
std::unordered_set< tachyon::ID > selectedIDs
Definition gui_widget_state_types.h:23
std::vector< tachyon::ID > orderedItemIDs
Transient: rebuilt each frame for Shift+Click range selection.
Definition gui_widget_state_types.h:26
tachyon::ID lastClickedID
anchor for Shift+Click ranges
Definition gui_widget_state_types.h:24