-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup_scr_Camera.cpp
97 lines (87 loc) · 5.02 KB
/
setup_scr_Camera.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/*
* @Description: None
* @version: V1.0.0
* @Author: LILYGO_L
* @Date: 2023-11-13 17:50:10
* @LastEditors: LILYGO_L
* @LastEditTime: 2024-01-24 17:27:15
* @License: GPL 3.0
*/
#include "lvgl.h"
#include <stdio.h>
#include "gui_guider.h"
#include "events_init.h"
#include "widgets_init.h"
#include "custom.h"
void setup_scr_Camera(lv_ui *ui)
{
// Write codes Camera
ui->Camera = lv_obj_create(NULL);
lv_obj_set_size(ui->Camera, 240, 240);
lv_obj_set_scrollbar_mode(ui->Camera, LV_SCROLLBAR_MODE_OFF);
// Write style for Camera, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_bg_opa(ui->Camera, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui->Camera, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
// Write codes Camera_btnm_1
ui->Camera_btnm_1 = lv_btnmatrix_create(ui->Camera);
static const char *Camera_btnm_1_text_map[] = {
"Wifi STA",
"\n",
"Wifi SoftAP",
// "\n",
// "Screen",
"",
};
lv_btnmatrix_set_map(ui->Camera_btnm_1, Camera_btnm_1_text_map);
lv_obj_set_pos(ui->Camera_btnm_1, 42, 60);
lv_obj_set_size(ui->Camera_btnm_1, 156, 172);
lv_obj_set_scrollbar_mode(ui->Camera_btnm_1, LV_SCROLLBAR_MODE_OFF);
// Write style for Camera_btnm_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->Camera_btnm_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_top(ui->Camera_btnm_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_bottom(ui->Camera_btnm_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_left(ui->Camera_btnm_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_right(ui->Camera_btnm_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_row(ui->Camera_btnm_1, 8, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_column(ui->Camera_btnm_1, 8, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->Camera_btnm_1, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->Camera_btnm_1, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui->Camera_btnm_1, lv_color_hex(0x000000), LV_PART_MAIN | LV_STATE_DEFAULT);
// Write style for Camera_btnm_1, Part: LV_PART_ITEMS, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->Camera_btnm_1, 1, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_border_opa(ui->Camera_btnm_1, 255, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_border_color(ui->Camera_btnm_1, lv_color_hex(0xc9c9c9), LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->Camera_btnm_1, lv_color_hex(0xffffff), LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->Camera_btnm_1, &lv_font_montserratMedium_16, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->Camera_btnm_1, 4, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->Camera_btnm_1, 255, LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui->Camera_btnm_1, lv_color_hex(0x2195f6), LV_PART_ITEMS | LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->Camera_btnm_1, 0, LV_PART_ITEMS | LV_STATE_DEFAULT);
// Write codes Camera_label_1
ui->Camera_label_1 = lv_label_create(ui->Camera);
lv_label_set_text(ui->Camera_label_1, "Camera \nConnection Mode");
lv_label_set_long_mode(ui->Camera_label_1, LV_LABEL_LONG_WRAP);
lv_obj_set_pos(ui->Camera_label_1, 11, 20);
lv_obj_set_size(ui->Camera_label_1, 218, 35);
lv_obj_set_scrollbar_mode(ui->Camera_label_1, LV_SCROLLBAR_MODE_OFF);
// Write style for Camera_label_1, Part: LV_PART_MAIN, State: LV_STATE_DEFAULT.
lv_obj_set_style_border_width(ui->Camera_label_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_radius(ui->Camera_label_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_color(ui->Camera_label_1, lv_color_hex(0xffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_font(ui->Camera_label_1, &lv_font_montserratMedium_16, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_letter_space(ui->Camera_label_1, 2, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_line_space(ui->Camera_label_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_align(ui->Camera_label_1, LV_TEXT_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui->Camera_label_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_top(ui->Camera_label_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_right(ui->Camera_label_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_bottom(ui->Camera_label_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_pad_left(ui->Camera_label_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_shadow_width(ui->Camera_label_1, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
// 刷新状态栏
My_UI_Window_StatusBar(ui, ui->Camera);
// Update current screen layout.
lv_obj_update_layout(ui->Camera);
// Init events for screen.
events_init_Camera(ui);
}