Let a card's back button take its taps again (0.2.56)

Since firmware 0.2.44 the back arrow of the brightness, colour and climate
cards barely responded, and so did the button at the top right of the
climate card. on_boot created the settings hold strip after the YAML cards
on home_page, so the transparent strip lay on top of them and LVGL's hit
test gave it the taps in the top bar region.

attach_hold now takes the first card as `below` and moves the strip and its
fill line to that index, under every card. Holding the top bar opens the
settings page from the tile pages only. The dim wake overlay was never
affected: apply_screen_settings moves it to the foreground when dimmed.

Checked with 215 Python and 14 C++ tests, generate_packages --check, and
ESP32 builds of both Easy profiles. Firmware 0.2.48.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Max Gramser
2026-09-16 11:34:21 +02:00
parent 6df967bfef
commit 93fa7e2712
11 changed files with 95 additions and 12 deletions
+8 -2
View File
@@ -712,8 +712,10 @@ inline void hold_event(lv_event_t *event) {
}
// A transparent strip over the top bar plus the line that fills while it is held. Both belong to the
// page below, so they survive every redraw of the tiles.
inline void attach_hold(lv_obj_t *page, int x, int y, int width, int height) {
// page below, so they survive every redraw of the tiles. `below` is the first card that opens over the
// page: the strip goes under it, so a card's back button and its action at the top right get their taps
// (firmware 0.2.44-0.2.47 created the strip last, on top of every card).
inline void attach_hold(lv_obj_t *page, int x, int y, int width, int height, lv_obj_t *below = nullptr) {
bool large = lv_display_get_horizontal_resolution(lv_display_get_default()) >= 480;
hold_area = plain(page, x, y, width, height);
lv_obj_add_flag(hold_area, LV_OBJ_FLAG_CLICKABLE);
@@ -727,6 +729,10 @@ inline void attach_hold(lv_obj_t *page, int x, int y, int width, int height) {
lv_obj_set_style_bg_color(hold_bar, lv_color_hex(0x009FE3), 0);
lv_obj_add_flag(hold_bar, LV_OBJ_FLAG_HIDDEN);
lv_obj_move_foreground(hold_bar);
if (below && lv_obj_get_parent(below) == page) {
lv_obj_move_to_index(hold_area, lv_obj_get_index(below));
lv_obj_move_to_index(hold_bar, lv_obj_get_index(below));
}
}
} // namespace settings_screen