Updated lvgl simulated screen files

This commit is contained in:
anschrammh 2023-03-30 13:27:24 +02:00
parent ea79af772b
commit 1ef9face5a
3 changed files with 26 additions and 6 deletions

View File

@ -183,7 +183,7 @@ static void apply_altitude_event_cb(lv_event_t *e)
{
AltimeterScreen_t *altimeterScreen = e->user_data;
uint32_t spinbox_value = lv_spinbox_get_value(altimeterScreen->altitudeOffset_spinbox);
int32_t spinbox_value = lv_spinbox_get_value(altimeterScreen->altitudeOffset_spinbox);
destroy_altitude_setting_content(altimeterScreen);
//Show the main value

View File

@ -356,14 +356,14 @@ static void load_connectivity_side_screen(SettingsScreen_t *settingsScreen)
lv_obj_align_to(label, ble_switch, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5);
lv_obj_t *dev_name_label = lv_label_create(settingsScreen->side_screen);
lv_label_set_text_static(dev_name_label, "W800SW");
lv_label_set_text_static(dev_name_label, NULL/*"W800SW"*/);
lv_obj_set_style_text_color(dev_name_label, lv_color_make(130, 130, 130), LV_PART_MAIN);
lv_obj_align_to(dev_name_label, label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5);
lv_obj_t *wifi_switch = lv_switch_create(settingsScreen->side_screen);
lv_obj_align_to(wifi_switch, dev_name_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 10);
lv_obj_add_state(wifi_switch, LV_STATE_DISABLED);
label = lv_label_create(settingsScreen->side_screen);
lv_label_set_text_static(label, "WiFi");
lv_obj_align_to(label, wifi_switch, LV_ALIGN_OUT_RIGHT_MID, 10, 0);
@ -417,9 +417,18 @@ 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 *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_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);
label = lv_label_create(settingsScreen->side_screen);
lv_label_set_text_static(label, "Factory Reset :");
lv_obj_align_to(label, settingsScreen->currentTime.current_time_label, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5);
lv_obj_align_to(label, battery_voltage, LV_ALIGN_OUT_BOTTOM_LEFT, 0, 5);
lv_obj_t *factory_rst_btn = lv_btn_create(settingsScreen->side_screen);
lv_obj_align_to(factory_rst_btn, label, LV_ALIGN_OUT_BOTTOM_MID, 0, 5);

View File

@ -180,7 +180,18 @@ static void hide_hour_and_minutes_hand_cb(lv_event_t *e)
{
WatchFace_t *watchFace = e->user_data;
if(lv_obj_has_flag(watchFace->hourHand.handImg, LV_OBJ_FLAG_HIDDEN))
if(255 == lv_obj_get_style_opa(watchFace->hourHand.handImg, LV_PART_MAIN))
{
lv_obj_set_style_opa(watchFace->hourHand.handImg, 120, LV_PART_MAIN);
lv_obj_set_style_opa(watchFace->minuteHand.handImg, 120, LV_PART_MAIN);
}
else
{
lv_obj_set_style_opa(watchFace->hourHand.handImg, 255, LV_PART_MAIN);
lv_obj_set_style_opa(watchFace->minuteHand.handImg, 255, LV_PART_MAIN);
}
/*if(lv_obj_has_flag(watchFace->hourHand.handImg, LV_OBJ_FLAG_HIDDEN))
{
lv_obj_clear_flag(watchFace->hourHand.handImg, LV_OBJ_FLAG_HIDDEN);
lv_obj_clear_flag(watchFace->minuteHand.handImg, LV_OBJ_FLAG_HIDDEN);
@ -189,7 +200,7 @@ static void hide_hour_and_minutes_hand_cb(lv_event_t *e)
{
lv_obj_add_flag(watchFace->hourHand.handImg, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(watchFace->minuteHand.handImg, LV_OBJ_FLAG_HIDDEN);
}
}*/
}
void watch_face_init(WatchFace_t * const watchFace)