12
12
#include " displayapp/screens/WeatherSymbols.h"
13
13
#include " displayapp/InfiniTimeTheme.h"
14
14
15
-
16
15
using namespace Pinetime ::Applications::Screens;
17
16
18
17
namespace {
@@ -55,25 +54,32 @@ WatchFaceTerminal::WatchFaceTerminal(Controllers::DateTime& dateTimeController,
55
54
lv_label_set_text_static (label_prompt_1, " user@watch:~ $ now" );
56
55
57
56
label_time = lv_label_create (lv_scr_act (), nullptr );
57
+ lv_label_set_recolor (label_time, true );
58
58
lv_obj_align (label_time, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -60 );
59
59
60
60
label_date = lv_label_create (lv_scr_act (), nullptr );
61
+ lv_label_set_recolor (label_date, true );
61
62
lv_obj_align (label_date, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -40 );
62
63
63
64
weather = lv_label_create (lv_scr_act (), nullptr );
65
+ lv_label_set_recolor (weather, true );
64
66
lv_obj_align (weather, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -20 );
65
67
66
68
batteryValue = lv_label_create (lv_scr_act (), nullptr );
69
+ lv_label_set_recolor (batteryValue, true );
67
70
lv_obj_align (batteryValue, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 0 );
68
71
69
72
stepValue = lv_label_create (lv_scr_act (), nullptr );
73
+ lv_label_set_recolor (stepValue, true );
70
74
lv_obj_set_style_local_text_color (stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::orange);
71
75
lv_obj_align (stepValue, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 20 );
72
76
73
77
heartbeatValue = lv_label_create (lv_scr_act (), nullptr );
78
+ lv_label_set_recolor (heartbeatValue, true );
74
79
lv_obj_align (heartbeatValue, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 40 );
75
80
76
81
connectState = lv_label_create (lv_scr_act (), nullptr );
82
+ lv_label_set_recolor (connectState, true );
77
83
lv_obj_align (connectState, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 60 );
78
84
79
85
label_prompt_2 = lv_label_create (lv_scr_act (), nullptr );
@@ -100,7 +106,6 @@ void WatchFaceTerminal::Refresh() {
100
106
}
101
107
}
102
108
103
-
104
109
currentDateTime = std::chrono::time_point_cast<std::chrono::seconds>(dateTimeController.CurrentDateTime ());
105
110
if (currentDateTime.IsUpdated ()) {
106
111
uint8_t hour = dateTimeController.Hours ();
@@ -117,20 +122,19 @@ void WatchFaceTerminal::Refresh() {
117
122
hour = hour - 12 ;
118
123
ampmChar[0 ] = ' P' ;
119
124
}
120
- lv_label_set_text_fmt (label_time, " [TIME] %02d:%02d:%02d %s" , hour, minute, second, ampmChar);
125
+ lv_label_set_text_fmt (label_time, " #fffff [TIME]# #11cc55 %02d:%02d:%02d %s# " , hour, minute, second, ampmChar);
121
126
} else {
122
- lv_label_set_text_fmt (label_time, " [TIME] %02d:%02d:%02d" , hour, minute, second);
127
+ lv_label_set_text_fmt (label_time, " #ffffff [TIME]# #11cc55 %02d:%02d:%02d# " , hour, minute, second);
123
128
}
124
129
125
130
currentDate = std::chrono::time_point_cast<days>(currentDateTime.Get ());
126
131
if (currentDate.IsUpdated ()) {
127
132
uint16_t year = dateTimeController.Year ();
128
133
Controllers::DateTime::Months month = dateTimeController.Month ();
129
134
uint8_t day = dateTimeController.Day ();
130
- lv_label_set_text_fmt (label_date, " [DATE] %04d-%02d-%02d" , short (year), char (month), char (day));
135
+ lv_label_set_text_fmt (label_date, " #ffffff [DATE]# #007fff %04d-%02d-%02d# " , short (year), char (month), char (day));
131
136
}
132
137
}
133
-
134
138
135
139
currentWeather = weatherService.Current ();
136
140
if (currentWeather.IsUpdated ()) {
@@ -144,14 +148,13 @@ void WatchFaceTerminal::Refresh() {
144
148
temp = Controllers::SimpleWeatherService::CelsiusToFahrenheit (temp);
145
149
tempUnit = ' F' ;
146
150
}
147
- lv_label_set_text_fmt (weather, " [WTHR] %i°%c %s " , temp/ 100 , tempUnit, condition);
151
+ lv_label_set_text_fmt (weather, " #ffffff [WTHR]# %i°%c %s " , temp / 100 , tempUnit, condition);
148
152
} else {
149
- lv_label_set_text (weather, " [WTHR] ---° " );
153
+ lv_label_set_text (weather, " #ffffff [WTHR]# ---" );
150
154
lv_obj_set_style_local_text_color (weather, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::gray);
151
155
}
152
156
}
153
157
154
-
155
158
powerPresent = batteryController.IsPowerPresent ();
156
159
batteryPercentRemaining = batteryController.PercentRemaining ();
157
160
if (batteryPercentRemaining.IsUpdated () || powerPresent.IsUpdated ()) {
@@ -161,28 +164,26 @@ void WatchFaceTerminal::Refresh() {
161
164
// charges and giving us a much nicer color range.
162
165
uint8_t hue = batteryPercentRemaining.Get () * 120 / 100 ;
163
166
lv_obj_set_style_local_text_color (batteryValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hsv_to_rgb (hue, 100 , 100 ));
164
- lv_label_set_text_fmt (batteryValue, " [BATT] %d%%" , batteryPercentRemaining.Get ());
167
+ lv_label_set_text_fmt (batteryValue, " #ffffff [BATT]# %d%%" , batteryPercentRemaining.Get ());
165
168
if (batteryController.IsPowerPresent ()) {
166
169
lv_label_ins_text (batteryValue, LV_LABEL_POS_LAST, " Charging" );
167
170
}
168
171
}
169
172
170
-
171
173
stepCount = motionController.NbSteps ();
172
174
if (stepCount.IsUpdated ()) {
173
- lv_label_set_text_fmt (stepValue, " [STEP] %lu steps" , stepCount.Get ());
175
+ lv_label_set_text_fmt (stepValue, " #ffffff [STEP]# %lu steps" , stepCount.Get ());
174
176
}
175
177
176
-
177
178
heartbeat = heartRateController.HeartRate ();
178
179
heartbeatRunning = heartRateController.State () != Controllers::HeartRateController::States::Stopped;
179
180
if (heartbeat.IsUpdated () || heartbeatRunning.IsUpdated ()) {
180
181
if (heartbeatRunning.Get ()) {
181
182
182
183
lv_obj_set_style_local_text_color (heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::deepOrange);
183
- lv_label_set_text_fmt (heartbeatValue, " [L_HR] %d bpm" , heartbeat.Get ());
184
+ lv_label_set_text_fmt (heartbeatValue, " #ffffff [L_HR]# %d bpm" , heartbeat.Get ());
184
185
} else {
185
- lv_label_set_text_static (heartbeatValue, " [L_HR] ---" );
186
+ lv_label_set_text_static (heartbeatValue, " #ffffff [L_HR]# ---" );
186
187
lv_obj_set_style_local_text_color (heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::gray);
187
188
}
188
189
}
@@ -191,14 +192,14 @@ void WatchFaceTerminal::Refresh() {
191
192
bleRadioEnabled = bleController.IsRadioEnabled ();
192
193
if (bleState.IsUpdated () || bleRadioEnabled.IsUpdated ()) {
193
194
if (!bleRadioEnabled.Get ()) {
194
- lv_label_set_text_static (connectState, " [STAT] Disabled" );
195
+ lv_label_set_text_static (connectState, " #ffffff [STAT]# Disabled" );
195
196
lv_obj_set_style_local_text_color (connectState, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::gray);
196
197
} else {
197
198
if (bleState.Get ()) {
198
- lv_label_set_text_static (connectState, " [STAT] Connected" );
199
+ lv_label_set_text_static (connectState, " #ffffff [STAT]# Connected" );
199
200
lv_obj_set_style_local_text_color (connectState, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::blue);
200
201
} else {
201
- lv_label_set_text_static (connectState, " [STAT] Disconnected" );
202
+ lv_label_set_text_static (connectState, " #ffffff [STAT]# Disconnected" );
202
203
lv_obj_set_style_local_text_color (connectState, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, Colors::gray);
203
204
}
204
205
}
0 commit comments