Give a card's small slider the whole card and keep a quick drag on it from turning the page (0.2.81)
On a CYD the strip at the bottom of a compact card is 8 px high, so a finger landing a little above it pressed the card: the light's card opened, the light toggled, or the page-swipe gesture turned the page without a log line. The strip's click area now covers its card (slider_zone); a press that never moves forwards the card's tap or hold and shows the card pressed; the CYD's page-swipe handler and the Guition's flick handler leave a captured slider alone and log what they do; a slider commit no longer bounces against its own previous send (TouchGuard::accept_within); the CYD's edge band is 20 px because its resistive panel reports up to the bezel. App 0.2.81, firmware 0.2.68. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
+8
-4
@@ -18,14 +18,15 @@
|
||||
############################################################
|
||||
|
||||
substitutions:
|
||||
SCREEN_FIRMWARE_VERSION: "0.2.67"
|
||||
SCREEN_FIRMWARE_VERSION: "0.2.68"
|
||||
# A tap survives a finger that drifts up to this far (320 px over 58 mm: 1 cm); further is a swipe.
|
||||
TOUCH_MOVE_LIMIT_PX: "56"
|
||||
# Shortest contact that counts as a tap; a resistive panel bounces, a capacitive one does not.
|
||||
TOUCH_MIN_PRESS_MS: "60"
|
||||
# A slider let go this close to the left or right edge of the glass (about 1 cm) meant its end when
|
||||
# that end lies in the band: a panel loses a finger swiped off the glass before the edge.
|
||||
SLIDER_EDGE_SNAP_PX: "56"
|
||||
# A slider let go this close to the left or right edge of the glass meant its end when that end lies in
|
||||
# the band. The resistive panel reports a finger up to the bezel, so only the strip's last pixels and
|
||||
# the margin beside them count (a capacitive Guition loses a fast finger 30-50 px before its edge).
|
||||
SLIDER_EDGE_SNAP_PX: "20"
|
||||
DASHBOARD_INBOX_INTERNAL: "false"
|
||||
DEVICE_NAME: "cyd-new"
|
||||
DEVICE_FRIENDLY_NAME: "My CYD"
|
||||
@@ -331,8 +332,11 @@ esphome:
|
||||
auto *input=lv_indev_active();if(!input)return;
|
||||
auto direction=lv_indev_get_gesture_dir(input);
|
||||
if(direction!=LV_DIR_LEFT && direction!=LV_DIR_RIGHT)return;
|
||||
// A quick drag on a slider is that slider's, never a page swipe (firmware 0.2.68+).
|
||||
if(runtime_tiles::captured_slider){ESP_LOGI("touch","page swipe ignored: a slider is being dragged");return;}
|
||||
cyd::touch_guard.consume();
|
||||
lv_indev_wait_release(input);
|
||||
ESP_LOGI("touch","page swipe: page %d -> %d",id(tile_page),id(tile_page)+(direction==LV_DIR_LEFT?1:-1));
|
||||
id(tile_page)+=direction==LV_DIR_LEFT?1:-1;
|
||||
id(show_tile_page).execute();
|
||||
}, LV_EVENT_GESTURE, nullptr);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# Source profile for packages/guition.yaml (tools/generate_packages.py); see docs/GUITION.md.
|
||||
# A screen gets its tiles from the ESP Screen Manager add-on while it runs. The CYD is its own profile.
|
||||
substitutions:
|
||||
SCREEN_FIRMWARE_VERSION: "0.2.67"
|
||||
SCREEN_FIRMWARE_VERSION: "0.2.68"
|
||||
# 0: no drift limit. A press that drifts is still a tap as long as the finger lets go on the tile
|
||||
# (runtime_tiles::event checks where it let go: LVGL keeps the press on the tile and would click it
|
||||
# anywhere), and a quick flick is LVGL's gesture, never a tap (the home_page gesture handler in on_boot).
|
||||
@@ -240,6 +240,8 @@ esphome:
|
||||
lv_obj_add_event_cb(id(home_page)->obj, [](lv_event_t *) {
|
||||
if (!runtime_tiles::enabled || id(calibration_active) || !id(active_entity).empty() || settings_screen::visible() ||
|
||||
(runtime_tiles::detail_root && !lv_obj_has_flag(runtime_tiles::detail_root, LV_OBJ_FLAG_HIDDEN))) return;
|
||||
// A quick drag on a slider is that slider's: the press stays with it (firmware 0.2.68+).
|
||||
if (runtime_tiles::captured_slider) return;
|
||||
cyd::touch_guard.consume();
|
||||
ESP_LOGI("touch", "flick: no tap");
|
||||
if (id(display_dimmed)) return;
|
||||
|
||||
Reference in New Issue
Block a user