@@ -54,6 +54,10 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app,
5454 lv_label_set_recolor (batteryPercent, true );
5555 lv_obj_align (batteryPercent, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , -20 );
5656
57+ connectState = lv_label_create (lv_scr_act (), nullptr );
58+ lv_label_set_recolor (connectState, true );
59+ lv_obj_align (connectState, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 40 );
60+
5761 bleIcon = lv_label_create (lv_scr_act (), nullptr );
5862 lv_label_set_text (bleIcon, Symbols::bluetooth);
5963 lv_obj_align (bleIcon, batteryPlug, LV_ALIGN_OUT_LEFT_MID, -5 , 0 );
@@ -71,7 +75,7 @@ WatchFaceTerminal::WatchFaceTerminal(DisplayApp* app,
7175 lv_label_set_text (label_prompt_1, " user@watch:~ $ now" );
7276
7377 label_prompt_2 = lv_label_create (lv_scr_act (), nullptr );
74- lv_obj_align (label_prompt_2, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 40 );
78+ lv_obj_align (label_prompt_2, lv_scr_act (), LV_ALIGN_IN_LEFT_MID, 0 , 60 );
7579 lv_label_set_text (label_prompt_2, " user@watch:~ $" );
7680
7781 label_time = lv_label_create (lv_scr_act (), nullptr );
@@ -113,12 +117,15 @@ void WatchFaceTerminal::Refresh() {
113117 lv_label_set_text (batteryPlug, BatteryIcon::GetPlugIcon (isCharging));
114118 }
115119
120+ char * bleValue;
116121 bleState = bleController.IsConnected ();
117122 if (bleState.IsUpdated ()) {
118123 if (bleState.Get () == true ) {
119124 lv_label_set_text (bleIcon, BleIcon::GetIcon (true ));
125+ bleValue = " Connected" ;
120126 } else {
121127 lv_label_set_text (bleIcon, BleIcon::GetIcon (false ));
128+ bleValue = " Disconnected" ;
122129 }
123130 }
124131 lv_obj_align (batteryIcon, lv_scr_act (), LV_ALIGN_IN_TOP_RIGHT, -5 , 5 );
@@ -156,25 +163,6 @@ void WatchFaceTerminal::Refresh() {
156163
157164 char hoursChar[8 ];
158165
159- char ampmChar[3 ];
160- if (settingsController.GetClockType () == Controllers::Settings::ClockType::H24) {
161- sprintf (hoursChar, " %02d" , hour);
162- } else {
163- if (hour == 0 && hour != 12 ) {
164- hour = 12 ;
165- sprintf (ampmChar, " AM" );
166- } else if (hour == 12 && hour != 0 ) {
167- hour = 12 ;
168- sprintf (ampmChar, " PM" );
169- } else if (hour < 12 && hour != 0 ) {
170- sprintf (ampmChar, " AM" );
171- } else if (hour > 12 && hour != 0 ) {
172- hour = hour - 12 ;
173- sprintf (ampmChar, " PM" );
174- }
175- sprintf (hoursChar, " %02d" , hour);
176- }
177-
178166 char secondsChar[5 ];
179167 sprintf (secondsChar, " %02d" , static_cast <int >(second));
180168
@@ -184,6 +172,10 @@ void WatchFaceTerminal::Refresh() {
184172 sprintf (battStr, " [BATT]#387b54 %d%\%#" , batteryValue);
185173 lv_label_set_text (batteryPercent, battStr);
186174
175+ char bleStr[24 ];
176+ sprintf (bleStr, " [BLE]#387b54 %s#" , bleValue);
177+ lv_label_set_text (connectState, bleStr);
178+
187179 if (hoursChar[0 ] != displayedChar[0 ] || hoursChar[1 ] != displayedChar[1 ] || minutesChar[0 ] != displayedChar[2 ] ||
188180 minutesChar[1 ] != displayedChar[3 ] || secondsChar[0 ] != displayedChar[4 ] || secondsChar[1 ] != displayedChar[5 ]) {
189181 displayedChar[0 ] = hoursChar[0 ];
@@ -201,14 +193,13 @@ void WatchFaceTerminal::Refresh() {
201193
202194 char timeStr[42 ];
203195 sprintf (timeStr,
204- " [TIME]#11cc55 %c%c:%c%c:%c%c %s #" ,
196+ " [TIME]#11cc55 %c%c:%c%c:%c%c#" ,
205197 hoursChar[0 ],
206198 hoursChar[1 ],
207199 minutesChar[0 ],
208200 minutesChar[1 ],
209201 secondsChar[0 ],
210- secondsChar[1 ],
211- ampmChar);
202+ secondsChar[1 ]);
212203
213204 lv_label_set_text (label_time, timeStr);
214205 }
0 commit comments