|
ZenitUI
Retained-mode C++20 UI framework
|
Hover / press / focus state and click-callback dispatch for one node. More...
Go to the source code of this file.
Classes | |
| struct | ZenitUI::InputController |
| Stateless per-node input dispatcher. More... | |
Hover / press / focus state and click-callback dispatch for one node.
Every Layout embeds one InputController (as input_). The controller is stateless: it only mutates the node's public state fields (state.hovered, state.pressed, state.focused) and fires the node's callbacks. The per-node state itself lives in Layout, which is what the style resolver reads to select pseudo-class overlays.
Per-frame responsibilities:
Click routing uses a press-then-release model: pressTarget is set on button-down, releaseTarget on button-up, and onClick fires only if both agree. This prevents clicks from firing when the pointer is released over a different node (e.g. drag off a button).