mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 15:11:51 +02:00
test
This commit is contained in:
parent
ef59bed954
commit
a4389f63fa
Binary file not shown.
|
@ -191,6 +191,7 @@ WatchFaceMeow::WatchFaceMeow(Controllers::DateTime& dateTimeController,
|
|||
lv_line_set_points(lines[i], linePoints[i], 2);
|
||||
}
|
||||
|
||||
//Battery indicator
|
||||
logoPine = lv_img_create(lv_scr_act(), nullptr);
|
||||
lv_img_set_src(logoPine, "F:/images/pine_small.bin");
|
||||
lv_obj_set_pos(logoPine, 15, 106);
|
||||
|
@ -198,6 +199,7 @@ WatchFaceMeow::WatchFaceMeow(Controllers::DateTime& dateTimeController,
|
|||
lineBattery = lv_line_create(lv_scr_act(), nullptr);
|
||||
lv_obj_set_style_local_line_width(lineBattery, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 24);
|
||||
lv_obj_set_style_local_line_color(lineBattery, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, (*colors)[4]);
|
||||
lv_obj_set_style_local_line_color(lineBattery, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, (*colors)[4]);
|
||||
lv_obj_set_style_local_line_opa(lineBattery, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 190);
|
||||
lineBatteryPoints[0] = {27, 105};
|
||||
lineBatteryPoints[1] = {27, 106};
|
||||
|
@ -532,7 +534,6 @@ void WatchFaceMeow::Refresh() {
|
|||
}
|
||||
|
||||
void WatchFaceMeow::SetBatteryLevel(uint8_t batteryPercent) {
|
||||
// starting point (y) + Pine64 logo height * (100 - batteryPercent) / 100
|
||||
lineBatteryPoints[1] = {27, static_cast<lv_coord_t>(105 + 32 * (100 - batteryPercent) / 100)};
|
||||
lv_line_set_points(lineBattery, lineBatteryPoints, 2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue