From a43929fb81cf24d83ddf76619a070957227d2ad9 Mon Sep 17 00:00:00 2001
From: luocai
Date: Fri, 22 Nov 2024 19:25:57 +0800
Subject: [PATCH] make lvgl resize.
---
LvglApplication/lvgl_shell.html | 28 +++++++++++++++++++++-------
LvglApplication/main.cpp | 2 +-
resources/build.sh | 1 +
3 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/LvglApplication/lvgl_shell.html b/LvglApplication/lvgl_shell.html
index f3673d9..b52e810 100644
--- a/LvglApplication/lvgl_shell.html
+++ b/LvglApplication/lvgl_shell.html
@@ -17,9 +17,12 @@
align-items: center;
justify-content: center;
}
- #output {
+ #output, #canvas {
margin: 0;
padding: 0;
+ width: 100%;
+ height: 100%;
+ background-color: burlywood;
}
@@ -29,12 +32,10 @@
diff --git a/LvglApplication/main.cpp b/LvglApplication/main.cpp
index f520dbf..b7bd0e6 100644
--- a/LvglApplication/main.cpp
+++ b/LvglApplication/main.cpp
@@ -46,7 +46,7 @@ void do_loop() {
static void hal_init(void) {
lv_display_t *disp = lv_sdl_window_create(monitor_hor_res, monitor_ver_res);
-
+ lv_sdl_window_set_resizeable(disp, true);
lv_group_t *g = lv_group_create();
lv_group_set_default(g);
diff --git a/resources/build.sh b/resources/build.sh
index 7cc1f4a..7ed672f 100755
--- a/resources/build.sh
+++ b/resources/build.sh
@@ -112,6 +112,7 @@ function build_docker_images(){
}
function lvgl(){
+ rm ${build_path}/LvglApplication/lvglapp.html
emcmake cmake -DSDL2_DIR=/home/amass/emsdk/upstream/emscripten/system/lib/cmake/SDL2 -S LvglApplication -B ${build_path}/LvglApplication
cmake --build ${build_path}/LvglApplication --target all
# python3 -m http.server -d ./build/LvglApplication