From e32a86a85e594191591055286b06e822d377f867 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Thu, 17 Oct 2024 21:34:23 +0200 Subject: [PATCH] autosize the simple entities, avoiding scrollbars forever --- src/uicomponents/UIComponents.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uicomponents/UIComponents.cpp b/src/uicomponents/UIComponents.cpp index b35db924..7fd902b6 100644 --- a/src/uicomponents/UIComponents.cpp +++ b/src/uicomponents/UIComponents.cpp @@ -88,7 +88,7 @@ UISwitch::UISwitch(std::shared_ptr _entity, lv_obj_t* _parent) : // This code is duplicated in UISwitch, consider this after another few UIentities lv_obj_t* switchcontainer = lv_obj_create(_parent); lv_obj_set_width(switchcontainer, uiEntityWidth); - lv_obj_set_height(switchcontainer, 50); + lv_obj_set_height(switchcontainer, LV_SIZE_CONTENT); lv_obj_remove_flag(switchcontainer, LV_OBJ_FLAG_SCROLLABLE); lv_obj_set_style_pad_all(switchcontainer, 5, LV_PART_MAIN | LV_STATE_DEFAULT); @@ -134,7 +134,7 @@ UIDummy::UIDummy(std::shared_ptr _entity, lv_obj_t* _parent) : { lv_obj_t* flowpanel = lv_obj_create(_parent); lv_obj_set_width(flowpanel, uiEntityWidth); - lv_obj_set_height(flowpanel, 85); + lv_obj_set_height(flowpanel, LV_SIZE_CONTENT); lv_obj_set_style_pad_all(flowpanel, 5, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_align(flowpanel, LV_ALIGN_CENTER); lv_obj_set_flex_flow(flowpanel, LV_FLEX_FLOW_COLUMN); @@ -183,7 +183,7 @@ UISensor::UISensor(std::shared_ptr _entity, lv_obj_t* _parent) : { lv_obj_t* flowpanel = lv_obj_create(_parent); lv_obj_set_width(flowpanel, uiEntityWidth); - lv_obj_set_height(flowpanel, 60); + lv_obj_set_height(flowpanel, LV_SIZE_CONTENT); lv_obj_set_style_pad_all(flowpanel, 5, LV_PART_MAIN | LV_STATE_DEFAULT); lv_obj_set_align(flowpanel, LV_ALIGN_CENTER); lv_obj_set_flex_flow(flowpanel, LV_FLEX_FLOW_COLUMN);