From e16e8ac90658b8cb3ea1c9be8d9cf730fb645fd5 Mon Sep 17 00:00:00 2001 From: Ken Van Hoeylandt Date: Mon, 13 Oct 2025 23:23:04 +0200 Subject: [PATCH] Fix for launcher in vertical mode --- Tactility/Source/app/launcher/Launcher.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Tactility/Source/app/launcher/Launcher.cpp b/Tactility/Source/app/launcher/Launcher.cpp index 591b577e..e6ef1ebf 100644 --- a/Tactility/Source/app/launcher/Launcher.cpp +++ b/Tactility/Source/app/launcher/Launcher.cpp @@ -115,8 +115,14 @@ public: lv_obj_set_flex_flow(buttons_wrapper, LV_FLEX_FLOW_COLUMN); } - const int32_t available_width = std::max(0, lv_display_get_horizontal_resolution(display) - (3 * button_size)); - const int32_t margin = is_landscape_display ? std::min(available_width / 16, button_size) : 0; + int32_t margin; + if (is_landscape_display) { + const int32_t available_width = std::max(0, lv_display_get_horizontal_resolution(display) - (3 * button_size)); + margin = std::min(available_width / 16, button_size); + } else { + const int32_t available_height = std::max(0, lv_display_get_vertical_resolution(display) - (3 * button_size)); + margin = std::min(available_height / 16, button_size); + } const auto paths = app.getPaths(); const auto apps_icon_path = lvgl::PATH_PREFIX + paths->getAssetsPath("icon_apps.png");