InfiniTime FOSDEM 2023 special edition
Add a background image in Digital and Analog watchface. The content of the image is read from /images/fosdem.bin in external storage. Generate fosdem.bin from fosdem.png and add it in the external resource pack.
This commit is contained in:
parent
e823c8ed9e
commit
10beda289b
@ -80,10 +80,11 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen1() {
|
||||
lv_label_set_text_fmt(label,
|
||||
"#FFFF00 InfiniTime#\n\n"
|
||||
"#808080 Version# %ld.%ld.%ld\n"
|
||||
"#AB1B94 FOSDEM edition#\n"
|
||||
"#808080 Short Ref# %s\n"
|
||||
"#808080 Build date#\n"
|
||||
"%s\n"
|
||||
"%s\n\n"
|
||||
"%s\n"
|
||||
"#808080 Bootloader# %s",
|
||||
Version::Major(),
|
||||
Version::Minor(),
|
||||
|
@ -61,9 +61,8 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
|
||||
sMinute = 99;
|
||||
sSecond = 99;
|
||||
|
||||
lv_obj_t* bg_clock_img = lv_img_create(lv_scr_act(), NULL);
|
||||
lv_img_set_src(bg_clock_img, &bg_clock);
|
||||
lv_obj_align(bg_clock_img, NULL, LV_ALIGN_CENTER, 0, 0);
|
||||
bg = lv_img_create(lv_scr_act(), nullptr);
|
||||
lv_obj_align(bg, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0);
|
||||
|
||||
batteryIcon.Create(lv_scr_act());
|
||||
lv_obj_align(batteryIcon.GetObject(), nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0);
|
||||
@ -124,6 +123,7 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
|
||||
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
|
||||
|
||||
Refresh();
|
||||
doNotLoadBg = false;
|
||||
}
|
||||
|
||||
WatchFaceAnalog::~WatchFaceAnalog() {
|
||||
@ -186,6 +186,11 @@ void WatchFaceAnalog::SetBatteryIcon() {
|
||||
}
|
||||
|
||||
void WatchFaceAnalog::Refresh() {
|
||||
if(!bgLoaded && !doNotLoadBg) {
|
||||
lv_img_set_src(bg, "F:/images/fosdem.bin");
|
||||
bgLoaded = true;
|
||||
}
|
||||
|
||||
isCharging = batteryController.IsCharging();
|
||||
if (isCharging.IsUpdated()) {
|
||||
if (isCharging.Get()) {
|
||||
|
@ -70,6 +70,10 @@ namespace Pinetime {
|
||||
|
||||
BatteryIcon batteryIcon;
|
||||
|
||||
lv_obj_t* bg;
|
||||
bool bgLoaded = false;
|
||||
bool doNotLoadBg = true;
|
||||
|
||||
const Controllers::DateTime& dateTimeController;
|
||||
Controllers::Battery& batteryController;
|
||||
Controllers::Ble& bleController;
|
||||
|
@ -31,6 +31,9 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
|
||||
motionController {motionController},
|
||||
statusIcons(batteryController, bleController) {
|
||||
|
||||
bg = lv_img_create(lv_scr_act(), nullptr);
|
||||
lv_obj_align(bg, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0);
|
||||
|
||||
statusIcons.Create();
|
||||
|
||||
notificationIcon = lv_label_create(lv_scr_act(), nullptr);
|
||||
@ -73,6 +76,7 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
|
||||
|
||||
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
|
||||
Refresh();
|
||||
doNotLoadBg = false;
|
||||
}
|
||||
|
||||
WatchFaceDigital::~WatchFaceDigital() {
|
||||
@ -81,6 +85,11 @@ WatchFaceDigital::~WatchFaceDigital() {
|
||||
}
|
||||
|
||||
void WatchFaceDigital::Refresh() {
|
||||
if(!bgLoaded && !doNotLoadBg) {
|
||||
lv_img_set_src(bg, "F:/images/fosdem.bin");
|
||||
bgLoaded = true;
|
||||
}
|
||||
|
||||
statusIcons.Update();
|
||||
|
||||
notificationState = notificationManager.AreNewNotificationsAvailable();
|
||||
|
@ -64,6 +64,9 @@ namespace Pinetime {
|
||||
lv_obj_t* stepIcon;
|
||||
lv_obj_t* stepValue;
|
||||
lv_obj_t* notificationIcon;
|
||||
lv_obj_t* bg;
|
||||
bool bgLoaded = false;
|
||||
bool doNotLoadBg = true;
|
||||
|
||||
Controllers::DateTime& dateTimeController;
|
||||
Controllers::NotificationManager& notificationManager;
|
||||
|
@ -5,5 +5,12 @@
|
||||
"output_format": "bin",
|
||||
"binary_format": "ARGB8565_RBSWAP",
|
||||
"target_path": "/images/"
|
||||
},
|
||||
"fosdem" : {
|
||||
"sources": "images/fosdem.png",
|
||||
"color_format": "CF_INDEXED_1_BIT",
|
||||
"output_format": "bin",
|
||||
"binary_format": "ARGB8565_RBSWAP",
|
||||
"target_path": "/images/"
|
||||
}
|
||||
}
|
||||
|
BIN
src/resources/images/fosdem.png
Normal file
BIN
src/resources/images/fosdem.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in New Issue
Block a user