feat: 更新ui_Screen1.c、ui_Screen2.c 和 ui_Screen3.c ,引入 board_config.h 以获取屏幕分辨率
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
// Project name: HeavenlyHeroStar
|
||||
|
||||
#include "../ui.h"
|
||||
#include "board_config.h"
|
||||
|
||||
lv_obj_t * ui_Screen2 = NULL;
|
||||
lv_obj_t * ui_Button1 = NULL;
|
||||
@@ -45,11 +46,14 @@ void ui_event_Button3(lv_event_t * e)
|
||||
void ui_Screen2_screen_init(void)
|
||||
{
|
||||
ui_Screen2 = lv_obj_create(NULL);
|
||||
lv_obj_set_size(ui_Screen2, BOARD_LCD_LOGIC_H_RES, BOARD_LCD_LOGIC_V_RES);
|
||||
lv_obj_remove_flag(ui_Screen2, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
||||
|
||||
ui_Button1 = lv_button_create(ui_Screen2);
|
||||
lv_obj_set_width(ui_Button1, 100);
|
||||
lv_obj_set_height(ui_Button1, 80);
|
||||
lv_obj_set_x(ui_Button1, -100);
|
||||
lv_obj_set_y(ui_Button1, 0);
|
||||
lv_obj_set_align(ui_Button1, LV_ALIGN_CENTER);
|
||||
lv_obj_add_flag(ui_Button1, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /// Flags
|
||||
lv_obj_remove_flag(ui_Button1, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
||||
@@ -58,7 +62,7 @@ void ui_Screen2_screen_init(void)
|
||||
lv_obj_set_width(ui_Button2, 100);
|
||||
lv_obj_set_height(ui_Button2, 80);
|
||||
lv_obj_set_x(ui_Button2, 0);
|
||||
lv_obj_set_y(ui_Button2, 100);
|
||||
lv_obj_set_y(ui_Button2, 0);
|
||||
lv_obj_set_align(ui_Button2, LV_ALIGN_CENTER);
|
||||
lv_obj_add_flag(ui_Button2, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /// Flags
|
||||
lv_obj_remove_flag(ui_Button2, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
||||
@@ -66,8 +70,8 @@ void ui_Screen2_screen_init(void)
|
||||
ui_Button3 = lv_button_create(ui_Screen2);
|
||||
lv_obj_set_width(ui_Button3, 100);
|
||||
lv_obj_set_height(ui_Button3, 80);
|
||||
lv_obj_set_x(ui_Button3, 0);
|
||||
lv_obj_set_y(ui_Button3, -100);
|
||||
lv_obj_set_x(ui_Button3, 100);
|
||||
lv_obj_set_y(ui_Button3, 0);
|
||||
lv_obj_set_align(ui_Button3, LV_ALIGN_CENTER);
|
||||
lv_obj_add_flag(ui_Button3, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /// Flags
|
||||
lv_obj_remove_flag(ui_Button3, LV_OBJ_FLAG_SCROLLABLE); /// Flags
|
||||
@@ -75,6 +79,8 @@ void ui_Screen2_screen_init(void)
|
||||
ui_Label2 = lv_label_create(ui_Screen2);
|
||||
lv_obj_set_width(ui_Label2, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height(ui_Label2, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_x(ui_Label2, -100);
|
||||
lv_obj_set_y(ui_Label2, 0);
|
||||
lv_obj_set_align(ui_Label2, LV_ALIGN_CENTER);
|
||||
lv_label_set_text(ui_Label2, "Ctrl+C");
|
||||
|
||||
@@ -82,15 +88,15 @@ void ui_Screen2_screen_init(void)
|
||||
lv_obj_set_width(ui_Label4, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height(ui_Label4, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_x(ui_Label4, 0);
|
||||
lv_obj_set_y(ui_Label4, 100);
|
||||
lv_obj_set_y(ui_Label4, 0);
|
||||
lv_obj_set_align(ui_Label4, LV_ALIGN_CENTER);
|
||||
lv_label_set_text(ui_Label4, "Ctrl+V");
|
||||
|
||||
ui_Label5 = lv_label_create(ui_Screen2);
|
||||
lv_obj_set_width(ui_Label5, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_height(ui_Label5, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_x(ui_Label5, 0);
|
||||
lv_obj_set_y(ui_Label5, -100);
|
||||
lv_obj_set_x(ui_Label5, 100);
|
||||
lv_obj_set_y(ui_Label5, 0);
|
||||
lv_obj_set_align(ui_Label5, LV_ALIGN_CENTER);
|
||||
lv_label_set_text(ui_Label5, "Ctrl+X");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user