From 865ba72ed0b528a6f40c7ae45ac7eb141a81bdcd Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sun, 23 Jan 2022 15:57:24 +0100 Subject: [PATCH] Snap to main menu icons --- radio/src/gui/colorlcd/select_fab_carousel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/radio/src/gui/colorlcd/select_fab_carousel.cpp b/radio/src/gui/colorlcd/select_fab_carousel.cpp index cb5e44c3b..04921226f 100644 --- a/radio/src/gui/colorlcd/select_fab_carousel.cpp +++ b/radio/src/gui/colorlcd/select_fab_carousel.cpp @@ -21,11 +21,13 @@ #include "select_fab_carousel.h" -SelectFabCarousel::SelectFabCarousel(Window* parent): +SelectFabCarousel::SelectFabCarousel(Window* parent) : FormGroup(parent, {}, FORM_FORWARD_FOCUS | NO_SCROLLBAR) { - setPageWidth(FAB_BUTTON_SIZE + SELECT_BUTTON_BORDER); - setHeight(FAB_BUTTON_SIZE + 2 * PAGE_LINE_HEIGHT + SELECT_BUTTON_BORDER / 2); + setPageWidth(FAB_BUTTON_SIZE + SELECT_BUTTON_BORDER); + setHeight(FAB_BUTTON_SIZE + 2 * PAGE_LINE_HEIGHT + SELECT_BUTTON_BORDER / 2); + + lv_obj_set_scroll_snap_x(lvobj, LV_SCROLL_SNAP_START); } void SelectFabCarousel::setMaxButtons(uint8_t max)