1212#include " components/heartrate/HeartRateController.h"
1313#include " components/motion/MotionController.h"
1414#include " components/settings/Settings.h"
15- #include " displayapp/fonts/FastFont.h"
1615using namespace Pinetime ::Applications::Screens;
1716
1817WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710 (Controllers::DateTime& dateTimeController,
@@ -64,19 +63,19 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(Controllers::DateTime& dateTi
6463 label_day_of_week = lv_label_create (lv_scr_act (), nullptr );
6564 lv_obj_align (label_day_of_week, lv_scr_act (), LV_ALIGN_IN_TOP_LEFT, 10 , 64 );
6665 lv_obj_set_style_local_text_color (label_day_of_week, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
67- lv_obj_set_style_local_text_font (label_day_of_week, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_dot40);
66+ lv_obj_set_style_local_text_font (label_day_of_week, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_dot40. get () );
6867 lv_label_set_text_static (label_day_of_week, " SUN" );
6968
7069 label_week_number = lv_label_create (lv_scr_act (), nullptr );
7170 lv_obj_align (label_week_number, lv_scr_act (), LV_ALIGN_IN_TOP_LEFT, 5 , 22 );
7271 lv_obj_set_style_local_text_color (label_week_number, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
73- lv_obj_set_style_local_text_font (label_week_number, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_dot40);
72+ lv_obj_set_style_local_text_font (label_week_number, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_dot40. get () );
7473 lv_label_set_text_static (label_week_number, " WK26" );
7574
7675 label_day_of_year = lv_label_create (lv_scr_act (), nullptr );
7776 lv_obj_align (label_day_of_year, lv_scr_act (), LV_ALIGN_IN_TOP_LEFT, 100 , 30 );
7877 lv_obj_set_style_local_text_color (label_day_of_year, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
79- lv_obj_set_style_local_text_font (label_day_of_year, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_segment40);
78+ lv_obj_set_style_local_text_font (label_day_of_year, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_segment40. get () );
8079 lv_label_set_text_static (label_day_of_year, " 181-184" );
8180
8281 lv_style_init (&style_line);
@@ -107,7 +106,7 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(Controllers::DateTime& dateTi
107106 label_date = lv_label_create (lv_scr_act (), nullptr );
108107 lv_obj_align (label_date, lv_scr_act (), LV_ALIGN_IN_TOP_LEFT, 100 , 70 );
109108 lv_obj_set_style_local_text_color (label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
110- lv_obj_set_style_local_text_font (label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_segment40);
109+ lv_obj_set_style_local_text_font (label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_segment40. get () );
111110 lv_label_set_text_static (label_date, " 6-30" );
112111
113112 line_date = lv_line_create (lv_scr_act (), nullptr );
@@ -117,7 +116,7 @@ WatchFaceCasioStyleG7710::WatchFaceCasioStyleG7710(Controllers::DateTime& dateTi
117116
118117 label_time = lv_label_create (lv_scr_act (), nullptr );
119118 lv_obj_set_style_local_text_color (label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, color_text);
120- lv_obj_set_style_local_text_font (label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_segment115);
119+ lv_obj_set_style_local_text_font (label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font_segment115. get () );
121120 lv_obj_align (label_time, lv_scr_act (), LV_ALIGN_CENTER, 0 , 40 );
122121
123122 line_time = lv_line_create (lv_scr_act (), nullptr );
@@ -167,18 +166,6 @@ WatchFaceCasioStyleG7710::~WatchFaceCasioStyleG7710() {
167166 lv_style_reset (&style_line);
168167 lv_style_reset (&style_border);
169168
170- if (font_dot40 != nullptr ) {
171- free (font_dot40);
172- }
173-
174- if (font_segment40 != nullptr ) {
175- free (font_segment40);
176- }
177-
178- if (font_segment115 != nullptr ) {
179- free (font_segment115);
180- }
181-
182169 lv_obj_clean (lv_scr_act ());
183170}
184171
@@ -302,22 +289,17 @@ void WatchFaceCasioStyleG7710::Refresh() {
302289}
303290
304291bool WatchFaceCasioStyleG7710::IsAvailable (Pinetime::Controllers::FS& filesystem) {
305- lfs_file file = {};
292+ lfs_info stat {};
306293
307- if (filesystem.FileOpen (&file, " /fastfonts/lv_font_dots_40.bin" , LFS_O_RDONLY) < 0 ) {
294+ if (filesystem.Stat ( " /fastfonts/lv_font_dots_40.bin" , &stat) != LFS_ERR_OK ) {
308295 return false ;
309296 }
310-
311- filesystem.FileClose (&file);
312- if (filesystem.FileOpen (&file, " /fastfonts/seven_segments_40.bin" , LFS_O_RDONLY) < 0 ) {
297+ if (filesystem.Stat (" /fastfonts/seven_segments_40.bin" , &stat) != LFS_ERR_OK) {
313298 return false ;
314299 }
315-
316- filesystem.FileClose (&file);
317- if (filesystem.FileOpen (&file, " /fastfonts/seven_segments_115.bin" , LFS_O_RDONLY) < 0 ) {
300+ if (filesystem.Stat (" /fastfonts/seven_segments_115.bin" , &stat) != LFS_ERR_OK) {
318301 return false ;
319302 }
320303
321- filesystem.FileClose (&file);
322304 return true ;
323305}
0 commit comments