commit acf688d137096fdc8bf47c73c9b8b810acb4d5a6
parent 78a2f1112a6222c34b7984054adbeaa17a26d6c4
Author: Manuel Geissbühler <manuel@debian>
Date: Sat, 28 Dec 2024 09:23:36 +0100
testing
Diffstat:
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/gui/screen.hpp b/src/gui/screen.hpp
@@ -5,10 +5,12 @@
#include <src/core/lv_obj.h>
#include <src/core/lv_obj_pos.h>
#include <src/core/lv_obj_style_gen.h>
+#include <src/layouts/flex/lv_flex.h>
#include <src/layouts/grid/lv_grid.h>
#include <src/layouts/lv_layout.h>
#include <src/misc/lv_area.h>
#include <src/misc/lv_color.h>
+#include <src/misc/lv_style_gen.h>
#include <src/widgets/button/lv_button.h>
#include <src/widgets/label/lv_label.h>
#include <vector>
@@ -89,11 +91,18 @@ class Screen {
buttons.push_back(button);
label = lv_label_create(button);
lv_label_set_text_fmt(label, "button %d", i);
- lv_obj_center(button);
+ lv_obj_center(label);
}
+
+ lv_obj_set_layout(buttonsContainer, LV_LAYOUT_FLEX);
+ lv_obj_set_flex_flow(buttonsContainer, LV_FLEX_FLOW_ROW_REVERSE);
+ lv_obj_set_flex_align(buttonsContainer, LV_FLEX_ALIGN_END, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_SPACE_EVENLY);
+
+
//add the buttons to the layout
for (lv_obj_t* x : buttons) {
+
break;
}