v2 Phase 2: fix launcher scroll rest position + back chevron placement
The tile grid used track_cross_place=CENTER, which vertically centers the overflowing block of rows — hiding the top row under the title and springing back to it after an elastic pull. Switch to START so rows stack from the top: the first row sits under the title and the rest is reached by scrolling down. Nudge the back chevron down/right so it clears the rounded top-left corner. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+6
-2
@@ -504,7 +504,11 @@ static void init_menu_screen(lv_obj_t* scr) {
|
|||||||
lv_obj_set_style_pad_row(grid, 12, 0);
|
lv_obj_set_style_pad_row(grid, 12, 0);
|
||||||
lv_obj_set_style_pad_column(grid, 12, 0);
|
lv_obj_set_style_pad_column(grid, 12, 0);
|
||||||
lv_obj_set_flex_flow(grid, LV_FLEX_FLOW_ROW_WRAP);
|
lv_obj_set_flex_flow(grid, LV_FLEX_FLOW_ROW_WRAP);
|
||||||
lv_obj_set_flex_align(grid, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
// track_cross_place = START: stack rows from the top so the first row sits
|
||||||
|
// just under the title and the rest is reached by scrolling DOWN. (CENTER
|
||||||
|
// would vertically center the overflowing block, hiding the top row under
|
||||||
|
// the title and springing back to it after an elastic pull.)
|
||||||
|
lv_obj_set_flex_align(grid, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START);
|
||||||
lv_obj_set_scroll_dir(grid, LV_DIR_VER);
|
lv_obj_set_scroll_dir(grid, LV_DIR_VER);
|
||||||
lv_obj_set_scrollbar_mode(grid, LV_SCROLLBAR_MODE_AUTO);
|
lv_obj_set_scrollbar_mode(grid, LV_SCROLLBAR_MODE_AUTO);
|
||||||
|
|
||||||
@@ -627,7 +631,7 @@ void ui_init(void) {
|
|||||||
lv_label_set_text(nav_back_btn, LV_SYMBOL_LEFT);
|
lv_label_set_text(nav_back_btn, LV_SYMBOL_LEFT);
|
||||||
lv_obj_set_style_text_font(nav_back_btn, &lv_font_montserrat_28, 0);
|
lv_obj_set_style_text_font(nav_back_btn, &lv_font_montserrat_28, 0);
|
||||||
lv_obj_set_style_text_color(nav_back_btn, COL_TEXT, 0);
|
lv_obj_set_style_text_color(nav_back_btn, COL_TEXT, 0);
|
||||||
lv_obj_set_pos(nav_back_btn, L.margin, L.title_y);
|
lv_obj_set_pos(nav_back_btn, L.margin + 4, L.title_y + 10); // clear of the rounded top-left corner
|
||||||
lv_obj_add_flag(nav_back_btn, LV_OBJ_FLAG_CLICKABLE);
|
lv_obj_add_flag(nav_back_btn, LV_OBJ_FLAG_CLICKABLE);
|
||||||
lv_obj_set_ext_click_area(nav_back_btn, 18);
|
lv_obj_set_ext_click_area(nav_back_btn, 18);
|
||||||
lv_obj_add_event_cb(nav_back_btn, nav_back_cb, LV_EVENT_CLICKED, NULL);
|
lv_obj_add_event_cb(nav_back_btn, nav_back_cb, LV_EVENT_CLICKED, NULL);
|
||||||
|
|||||||
Reference in New Issue
Block a user