@@ -28,44 +28,43 @@ WatchFaceTerminal::WatchFaceTerminal(Controllers::DateTime& dateTimeController,
28
28
heartRateController {heartRateController},
29
29
motionController {motionController} {
30
30
31
- notificationIcon = lv_label_create (lv_scr_act (), nullptr );
32
- lv_obj_align (notificationIcon, nullptr , LV_ALIGN_IN_LEFT_MID, 0 , -90 );
31
+ container = lv_cont_create (lv_scr_act (), nullptr );
32
+ lv_cont_set_layout (container, LV_LAYOUT_COLUMN_LEFT);
33
+ lv_cont_set_fit (container, LV_FIT_TIGHT);
34
+ lv_obj_set_style_local_pad_inner (container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, -3 );
35
+ lv_obj_set_style_local_bg_opa (container, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP);
33
36
34
- label_prompt_1 = lv_label_create (lv_scr_act (), nullptr );
37
+ notificationIcon = lv_label_create (container, nullptr );
38
+
39
+ label_prompt_1 = lv_label_create (container, nullptr );
35
40
lv_obj_set_style_local_text_color (label_prompt_1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
36
- lv_obj_align (label_prompt_1, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -70 );
37
41
lv_label_set_text_static (label_prompt_1, " user@watch:~ $ now" );
38
42
39
- label_time = lv_label_create (lv_scr_act () , nullptr );
43
+ label_time = lv_label_create (container , nullptr );
40
44
lv_label_set_recolor (label_time, true );
41
- lv_obj_align (label_time, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -50 );
42
45
43
- label_date = lv_label_create (lv_scr_act () , nullptr );
46
+ label_date = lv_label_create (container , nullptr );
44
47
lv_label_set_recolor (label_date, true );
45
- lv_obj_align (label_date, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -30 );
46
48
47
- batteryValue = lv_label_create (lv_scr_act () , nullptr );
49
+ batteryValue = lv_label_create (container , nullptr );
48
50
lv_label_set_recolor (batteryValue, true );
49
- lv_obj_align (batteryValue, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -10 );
50
51
51
- stepValue = lv_label_create (lv_scr_act () , nullptr );
52
+ stepValue = lv_label_create (container , nullptr );
52
53
lv_label_set_recolor (stepValue, true );
53
54
lv_obj_set_style_local_text_color (stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::orange);
54
- lv_obj_align (stepValue, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 10 );
55
55
56
- heartbeatValue = lv_label_create (lv_scr_act () , nullptr );
56
+ heartbeatValue = lv_label_create (container , nullptr );
57
57
lv_label_set_recolor (heartbeatValue, true );
58
- lv_obj_align (heartbeatValue, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 30 );
59
58
60
- connectState = lv_label_create (lv_scr_act () , nullptr );
59
+ connectState = lv_label_create (container , nullptr );
61
60
lv_label_set_recolor (connectState, true );
62
- lv_obj_align (connectState, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 50 );
63
61
64
- label_prompt_2 = lv_label_create (lv_scr_act () , nullptr );
62
+ label_prompt_2 = lv_label_create (container , nullptr );
65
63
lv_obj_set_style_local_text_color (label_prompt_2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
66
- lv_obj_align (label_prompt_2, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 70 );
67
64
lv_label_set_text_static (label_prompt_2, " user@watch:~ $" );
68
65
66
+ lv_obj_align (container, nullptr , LV_ALIGN_IN_TOP_LEFT, 0 , 20 );
67
+
69
68
taskRefresh = lv_task_create (RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this );
70
69
Refresh ();
71
70
}
0 commit comments