Skip to content

Commit

Permalink
Add images
Browse files Browse the repository at this point in the history
  • Loading branch information
zyphlar committed Jan 20, 2024
1 parent 7b3c48a commit 2dc10ff
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/displayapp/fonts/fonts.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"jetbrains_mono_42": {
"sources": [
{
"disabledfile": "JetBrainsMono-Regular.ttf",
"file": "Vulf Mono Light Italic.ttf",
"file": "JetBrainsMono-Regular.ttf",
"disabledfile": "Vulf Mono Light Italic.ttf",
"range": "0x20, 0x25, 0x27, 0x2b, 0x2d, 0x30-0x3a, 0x4b-0x4d, 0x61-0x7a"
}
],
Expand Down
11 changes: 11 additions & 0 deletions src/displayapp/screens/WatchFaceDigital.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ WatchFaceDigital::WatchFaceDigital(Controllers::DateTime& dateTimeController,
sMinute = 99;
statusIcons.Create();

lv_obj_t* bg = lv_img_create(lv_scr_act(), nullptr);
lv_img_set_src(bg, "F:/images/aor.bin");
lv_img_set_auto_size(bg, false);
lv_obj_set_size(bg, 240, 240);
// lv_img_set_src(bg, image.fileName);
lv_img_set_offset_x(bg, 0);
lv_img_set_offset_y(bg, 0);
// lv_obj_set_style_local_image_recolor_opa(bg, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_COVER);
// lv_obj_set_style_local_image_recolor(bg, LV_IMG_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_CYAN);
lv_obj_align(bg, nullptr, LV_ALIGN_CENTER, 0, 0);

notificationIcon = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(notificationIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_LIME);
lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false));
Expand Down
2 changes: 1 addition & 1 deletion src/resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ message(STATUS "Using ${LV_FONT_CONV} to generate font files")

find_program(LV_IMG_CONV "lv_img_conv.py" NO_CACHE REQUIRED
HINTS "${CMAKE_CURRENT_SOURCE_DIR}")
message(STATUS "Using ${LV_IMG_CONV} to generate font files")
message(STATUS "Using ${LV_IMG_CONV} to generate image files")

if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.12)
# FindPython3 module introduces with CMake 3.12
Expand Down
7 changes: 7 additions & 0 deletions src/resources/images.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
"binary_format": "ARGB8565_RBSWAP",
"target_path": "/images/"
},
"aor" : {
"sources": "images/aor.png",
"color_format": "CF_TRUE_COLOR_ALPHA",
"output_format": "bin",
"binary_format": "ARGB8565_RBSWAP",
"target_path": "/images/"
},
"navigation0" : {
"sources": "images/navigation0.png",
"color_format": "CF_INDEXED_1_BIT",
Expand Down
Binary file added src/resources/images/aor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2dc10ff

Please sign in to comment.