diff --git a/tutorials/9_new_widget/.gitignore b/tutorials/9_new_widget/.gitignore new file mode 100644 index 0000000..8b23de8 --- /dev/null +++ b/tutorials/9_new_widget/.gitignore @@ -0,0 +1 @@ +preview-build diff --git a/tutorials/9_new_widget/CMakeLists.txt b/tutorials/9_new_widget/CMakeLists.txt new file mode 100644 index 0000000..e46feb5 --- /dev/null +++ b/tutorials/9_new_widget/CMakeLists.txt @@ -0,0 +1,41 @@ +# This basic file is used to compile the runtime for the Editor preview. +# Generated file, do not edit. + +# Only set project if this is the top-level CMakeLists.txt +if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) + cmake_minimum_required(VERSION 3.10) + # can be customized + project(LVGLProject) + set(IS_TOP_LEVEL TRUE) +else() + set(IS_TOP_LEVEL FALSE) +endif() + +# Handles giving component libraries unique names when included as subprojects. +if (DEFINED LVGL_COMPONENT_LIB_NAME) + set(LIB_NAME ${LVGL_COMPONENT_LIB_NAME}) +else() + set(LIB_NAME lib-ui) +endif() + +# This includes the generated list of .c files +include(${CMAKE_CURRENT_LIST_DIR}/file_list_gen.cmake) +# Include any component libraries +include(${CMAKE_CURRENT_LIST_DIR}/component_lib_list_gen.cmake) + +# Create the UI sources as a library +add_library(${LIB_NAME} ${LV_EDITOR_PROJECT_SOURCES}) +if (DEFINED LV_EDITOR_COMPONENT_LIB_LIST) + target_link_libraries(${LIB_NAME} PUBLIC ${LV_EDITOR_COMPONENT_LIB_LIST}) +endif () + +if(TARGET lvgl) + target_link_libraries(${LIB_NAME} PUBLIC lvgl) +endif() + +# Add the project folder as include folder +target_include_directories(${LIB_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +# Set include directories for the project +# This will include the LVGL includes +target_include_directories(${LIB_NAME} PRIVATE ${COMMON_INCLUDE_DIRS}) diff --git a/tutorials/9_new_widget/component_lib_list_gen.cmake b/tutorials/9_new_widget/component_lib_list_gen.cmake new file mode 100644 index 0000000..b28b04f --- /dev/null +++ b/tutorials/9_new_widget/component_lib_list_gen.cmake @@ -0,0 +1,3 @@ + + + diff --git a/tutorials/9_new_widget/components/README.md b/tutorials/9_new_widget/components/README.md new file mode 100644 index 0000000..c44ff7a --- /dev/null +++ b/tutorials/9_new_widget/components/README.md @@ -0,0 +1 @@ +Create XML files here that start with a `` tag diff --git a/tutorials/9_new_widget/components/segment_item/segment_item.xml b/tutorials/9_new_widget/components/segment_item/segment_item.xml new file mode 100644 index 0000000..6be4574 --- /dev/null +++ b/tutorials/9_new_widget/components/segment_item/segment_item.xml @@ -0,0 +1,29 @@ + + + + + + + + + + +