|
TachyonUI 0.1.0
High-performance UI for building tools.
|
Click-gesture tracker, owned per widget instance so instances (and tests) don't share it. More...
#include <gui_controls/gui_widget_state_types.h>
Classes | |
| struct | Result |
| Whether this click hit the same item as the previous one, and the time since it. More... | |
Public Member Functions | |
| Result | Update (tachyon::ID id) |
| Records a click on id and compares it with the previous click. | |
| bool | IsDoubleClick (tachyon::ID id) |
| Records a click on id: true when it is the second click of a double-click (the same item, within DoubleClickMilliseconds()). | |
| void | Reset () |
| Forgets the previous click, so the next one never counts as a repeat. | |
Public Attributes | |
| tachyon::ID | lastID = tachyon::ID::Invalid() |
| item of the previous click | |
| int64_t | lastTimeNanos = 0 |
| steady-clock ns; see SteadyClockNowNanos() | |
Click-gesture tracker, owned per widget instance so instances (and tests) don't share it.
|
inline |
Records a click on id and compares it with the previous click.
|
inline |
Records a click on id: true when it is the second click of a double-click (the same item, within DoubleClickMilliseconds()).
A double-click is forgotten, so a third click starts over.
|
inline |
Forgets the previous click, so the next one never counts as a repeat.
| tachyon::ID tachyon::DoubleClickTracker::lastID = tachyon::ID::Invalid() |
item of the previous click
| int64_t tachyon::DoubleClickTracker::lastTimeNanos = 0 |
steady-clock ns; see SteadyClockNowNanos()