Clarify touch gesture and input API comments
Simplify and clarify documentation for touch gesture detection (back gesture, item taps, long-press) and board detection flags. No functional changes, just improved comment readability.
This commit is contained in:
@@ -8,15 +8,10 @@
|
||||
#include "components/themes/BaseTheme.h" // Rect
|
||||
|
||||
// Frame-scoped registry of tappable UI elements. Theme draw methods record each
|
||||
// interactive element's LOGICAL rect + id during render() (on the render task);
|
||||
// the input layer hit-tests a tap against it during the next loop() (main task).
|
||||
//
|
||||
// Lock-free single-writer (render) / single-reader (loop) via double buffering:
|
||||
// render writes the back buffer and publish() atomically flips it to live, so the
|
||||
// reader never observes a half-built frame. No per-frame heap allocation.
|
||||
//
|
||||
// Runtime-gated: disabled on boards without touch (setEnabled(gpio.hasTouch())),
|
||||
// so add()/hitTest() are a single branch on the C3.
|
||||
// element's logical rect + id during render() (render task); the input layer
|
||||
// hit-tests a tap in the next loop() (main task). Lock-free via double buffering:
|
||||
// render writes the back buffer, publish() flips it live. No per-frame heap.
|
||||
// Runtime-gated off on boards without touch (setEnabled).
|
||||
class TouchRegistry {
|
||||
public:
|
||||
enum Kind : uint8_t { Item = 0, Back = 1, Tab = 2, Cover = 3 };
|
||||
|
||||
@@ -355,9 +355,7 @@ void BaseTheme::drawList(const GfxRenderer& renderer, Rect rect, int itemCount,
|
||||
}
|
||||
|
||||
void BaseTheme::drawHeader(const GfxRenderer& renderer, Rect rect, const char* title, const char* subtitle) const {
|
||||
// Left strip of the header is a tap-to-go-back zone (orientation-mapped; the
|
||||
// title is centered so this area is normally empty). Mirrors the legacy corner
|
||||
// gesture but as a real, theme-positioned target.
|
||||
// Left strip of the header is a tap-to-go-back zone (title is centered, so it's empty).
|
||||
TouchRegistry::getInstance().add(Rect{rect.x, rect.y, 64, rect.height + 8}, -1, TouchRegistry::Back);
|
||||
|
||||
// Hide last battery draw
|
||||
|
||||
Reference in New Issue
Block a user