|
23 | 23 | #include <date/date.h> |
24 | 24 | #include <lvgl/lvgl.h> |
25 | 25 | #include <cstdio> |
| 26 | +#include <displayapp/Colors.h> |
26 | 27 | #include "BatteryIcon.h" |
27 | 28 | #include "BleIcon.h" |
28 | 29 | #include "NotificationIcon.h" |
@@ -63,33 +64,33 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app, |
63 | 64 |
|
64 | 65 | //Create a 200px wide background rectangle |
65 | 66 | timebar = lv_obj_create(lv_scr_act(), nullptr); |
66 | | - lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, pts_colors[settingsController.GetPTSColorBG()]); |
| 67 | + lv_obj_set_style_local_bg_color(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorBG())); |
67 | 68 | lv_obj_set_style_local_radius(timebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0); |
68 | 69 | lv_obj_set_size(timebar, 200, 240); |
69 | 70 | lv_obj_align(timebar, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 5, 0); |
70 | 71 |
|
71 | 72 | // Display the time |
72 | 73 | timeDD1 = lv_label_create(lv_scr_act(), nullptr); |
73 | 74 | lv_obj_set_style_local_text_font(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &open_sans_light); |
74 | | - lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, pts_colors[settingsController.GetPTSColorTime()]); |
| 75 | + lv_obj_set_style_local_text_color(timeDD1, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorTime())); |
75 | 76 | lv_label_set_text(timeDD1, "12"); |
76 | 77 | lv_obj_align(timeDD1, timebar, LV_ALIGN_IN_TOP_MID, 5, 5); |
77 | 78 |
|
78 | 79 | timeDD2 = lv_label_create(lv_scr_act(), nullptr); |
79 | 80 | lv_obj_set_style_local_text_font(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &open_sans_light); |
80 | | - lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, pts_colors[settingsController.GetPTSColorTime()]); |
| 81 | + lv_obj_set_style_local_text_color(timeDD2, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorTime())); |
81 | 82 | lv_label_set_text(timeDD2, "34"); |
82 | 83 | lv_obj_align(timeDD2, timebar, LV_ALIGN_IN_BOTTOM_MID, 5, -5); |
83 | 84 |
|
84 | 85 | timeAMPM = lv_label_create(lv_scr_act(), nullptr); |
85 | | - lv_obj_set_style_local_text_color(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, pts_colors[settingsController.GetPTSColorTime()]); |
| 86 | + lv_obj_set_style_local_text_color(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorTime())); |
86 | 87 | lv_obj_set_style_local_text_line_space(timeAMPM, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, -3); |
87 | 88 | lv_label_set_text(timeAMPM, ""); |
88 | 89 | lv_obj_align(timeAMPM, timebar, LV_ALIGN_IN_BOTTOM_LEFT, 2, -20); |
89 | 90 |
|
90 | 91 | // Create a 40px wide bar down the right side of the screen |
91 | 92 | sidebar = lv_obj_create(lv_scr_act(), nullptr); |
92 | | - lv_obj_set_style_local_bg_color(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, pts_colors[settingsController.GetPTSColorBar()]); |
| 93 | + lv_obj_set_style_local_bg_color(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, Convert(settingsController.GetPTSColorBar())); |
93 | 94 | lv_obj_set_style_local_radius(sidebar, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, 0); |
94 | 95 | lv_obj_set_size(sidebar, 40, 240); |
95 | 96 | lv_obj_align(sidebar, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0); |
|
0 commit comments