diff --git a/src/lvgl_win_sim/lv_port_win_codeblocks/settings_screen.c b/src/lvgl_win_sim/lv_port_win_codeblocks/settings_screen.c index a244ebc..2ce3beb 100644 --- a/src/lvgl_win_sim/lv_port_win_codeblocks/settings_screen.c +++ b/src/lvgl_win_sim/lv_port_win_codeblocks/settings_screen.c @@ -407,16 +407,16 @@ static void load_about_side_screen(SettingsScreen_t *settingsScreen) lv_obj_set_style_text_color(version_label, lv_color_make(130, 130, 130), LV_PART_MAIN); lv_obj_align_to(version_label, firmware_label, LV_ALIGN_OUT_RIGHT_MID, 7, 0); - lv_obj_t* compile_label = lv_label_create(settingsScreen->side_screen); + lv_obj_t *compile_label = lv_label_create(settingsScreen->side_screen); lv_label_set_text_static(compile_label, "Compile date :"); lv_obj_align_to(compile_label, firmware_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5); - lv_obj_t* compile_date_label = lv_label_create(settingsScreen->side_screen); + lv_obj_t *compile_date_label = lv_label_create(settingsScreen->side_screen); lv_label_set_text_static(compile_date_label, FIRMWARE_TIME_DATE); lv_obj_set_style_text_color(compile_date_label, lv_color_make(130, 130, 130), LV_PART_MAIN); lv_obj_align_to(compile_date_label, compile_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5); - lv_obj_t* rtc_time = lv_label_create(settingsScreen->side_screen); + lv_obj_t *rtc_time = lv_label_create(settingsScreen->side_screen); lv_label_set_text_static(rtc_time, "RTC :"); lv_obj_align_to(rtc_time, compile_date_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5); @@ -426,14 +426,52 @@ static void load_about_side_screen(SettingsScreen_t *settingsScreen) lv_obj_set_style_text_color(settingsScreen->currentTime.current_time_label, lv_color_make(130, 130, 130), LV_PART_MAIN); lv_obj_align_to(settingsScreen->currentTime.current_time_label, rtc_time, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5); + lv_obj_t *magnetometer_data = lv_label_create(settingsScreen->side_screen); + lv_label_set_text_static(magnetometer_data, "Magnetometer :"); + lv_obj_align_to(magnetometer_data, settingsScreen->currentTime.current_time_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5); + + lv_obj_t *magnetometer_data_x = lv_label_create(settingsScreen->side_screen); + lv_obj_set_style_text_color(magnetometer_data_x, lv_color_make(130, 130, 130), LV_PART_MAIN); + lv_label_set_text_static(magnetometer_data_x, "x: 1456"); + lv_obj_align_to(magnetometer_data_x, magnetometer_data, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 3); + + lv_obj_t *magnetometer_data_y = lv_label_create(settingsScreen->side_screen); + lv_obj_set_style_text_color(magnetometer_data_y, lv_color_make(130, 130, 130), LV_PART_MAIN); + lv_label_set_text_static(magnetometer_data_y, "y: -456"); + lv_obj_align_to(magnetometer_data_y, magnetometer_data_x, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 3); + + lv_obj_t *magnetometer_data_z = lv_label_create(settingsScreen->side_screen); + lv_obj_set_style_text_color(magnetometer_data_z, lv_color_make(130, 130, 130), LV_PART_MAIN); + lv_label_set_text_static(magnetometer_data_z, "z: -20"); + lv_obj_align_to(magnetometer_data_z, magnetometer_data_y, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 3); + + lv_obj_t *magnetometer_data_temp = lv_label_create(settingsScreen->side_screen); + lv_obj_set_style_text_color(magnetometer_data_temp, lv_color_make(130, 130, 130), LV_PART_MAIN); + lv_label_set_text_static(magnetometer_data_temp, "21.52 °C"); + lv_obj_align_to(magnetometer_data_temp, magnetometer_data_z, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 3); + + lv_obj_t *bmp280 = lv_label_create(settingsScreen->side_screen); + lv_label_set_text_static(bmp280, "Pressure & temp :"); + lv_obj_align_to(bmp280, magnetometer_data_temp, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5); + + lv_obj_t *bmp280_temperature = lv_label_create(settingsScreen->side_screen); + lv_obj_set_style_text_color(bmp280_temperature, lv_color_make(130, 130, 130), LV_PART_MAIN); + lv_label_set_text_static(bmp280_temperature, "20.42 °C"); + lv_obj_align_to(bmp280_temperature, bmp280, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 3); + + lv_obj_t *bmp280_pressure = lv_label_create(settingsScreen->side_screen); + lv_obj_set_style_text_color(bmp280_pressure, lv_color_make(130, 130, 130), LV_PART_MAIN); + lv_label_set_text_static(bmp280_pressure, "9525 hPa"); + lv_obj_align_to(bmp280_pressure, bmp280_temperature, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 3); + lv_obj_t *battery_label = lv_label_create(settingsScreen->side_screen); lv_label_set_text_static(battery_label, "Battery Voltage :"); - lv_obj_align_to(battery_label, settingsScreen->currentTime.current_time_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5); + lv_obj_align_to(battery_label, bmp280_pressure, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5); lv_obj_t *battery_voltage = lv_label_create(settingsScreen->side_screen); lv_label_set_text_static(battery_voltage, "4277 mV"); lv_obj_set_style_text_color(battery_voltage, lv_color_make(130, 130, 130), LV_PART_MAIN); - lv_obj_align_to(battery_voltage, battery_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5); + lv_obj_align_to(battery_voltage, battery_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 3); label = lv_label_create(settingsScreen->side_screen); lv_label_set_text_static(label, "Factory Reset :"); diff --git a/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.c b/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.c index 5b460a4..efb846a 100644 --- a/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.c +++ b/src/lvgl_win_sim/lv_port_win_codeblocks/watch_face.c @@ -368,7 +368,7 @@ void watch_face_create(WatchFace_t * const watchFace) } watchFace->dateWindow.dateWindowWidget = lv_label_create(watchFace->display); lv_label_set_text_static(watchFace->dateWindow.dateWindowWidget, watchFace->dateWindow.dateWindowText); - lv_obj_set_pos(watchFace->dateWindow.dateWindowWidget, 182,112); + lv_obj_set_pos(watchFace->dateWindow.dateWindowWidget, 182,111); if(watchFace->hourHand.handImg) {