1
0
Fork 0

show owner name (on Analog, Digital, Terminal)

This commit is contained in:
Julian Foad 2024-05-07 14:07:25 +01:00
parent 2105a7b63d
commit 63493078ef
7 changed files with 31 additions and 2 deletions

View file

@ -75,5 +75,11 @@ namespace Pinetime {
using UserWatchFaceTypes = WatchFaceTypeList<@WATCHFACE_TYPES@>; using UserWatchFaceTypes = WatchFaceTypeList<@WATCHFACE_TYPES@>;
static_assert(UserWatchFaceTypes::Count >= 1); static_assert(UserWatchFaceTypes::Count >= 1);
// a label such as the owner's name
// up to 20 characters (fits screen width in default font)
static const char OwnerText[] = "@OWNER_TEXT@";
// up to 6 characters (fits username in "Terminal" watch face in default font)
static const char OwnerTextShort[] = "@OWNER_TEXT_SHORT@";
} }
} }

View file

@ -30,6 +30,11 @@ else()
set(WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}" CACHE STRING "List of watch faces to build into the firmware") set(WATCHFACE_TYPES "${DEFAULT_WATCHFACE_TYPES}" CACHE STRING "List of watch faces to build into the firmware")
endif() endif()
# Owner text displayed on watch faces, <=20ch
set(OWNER_TEXT "Pine Time")
# Owner text displayed on watch faces, <=6ch
set(OWNER_TEXT_SHORT "pine")
add_library(infinitime_apps INTERFACE) add_library(infinitime_apps INTERFACE)
target_sources(infinitime_apps INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/Apps.h") target_sources(infinitime_apps INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/Apps.h")
target_include_directories(infinitime_apps INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/") target_include_directories(infinitime_apps INTERFACE "${CMAKE_CURRENT_BINARY_DIR}/")

View file

@ -110,6 +110,13 @@ WatchFaceAnalog::WatchFaceAnalog(Controllers::DateTime& dateTimeController,
lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false)); lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false));
lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0); lv_obj_align(notificationIcon, nullptr, LV_ALIGN_IN_TOP_LEFT, 0, 0);
// Owner's text
label_owner = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(label_owner, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xFF, 0xAE, 0xC9));
lv_label_set_text_static(label_owner, Pinetime::Applications::OwnerText);
lv_label_set_align(label_owner, LV_LABEL_ALIGN_CENTER);
lv_obj_align(label_owner, nullptr, LV_ALIGN_CENTER, 0, 50);
// Date - Day / Week day // Date - Day / Week day
label_date_day = lv_label_create(lv_scr_act(), nullptr); label_date_day = lv_label_create(lv_scr_act(), nullptr);

View file

@ -68,6 +68,8 @@ namespace Pinetime {
lv_style_t minute_line_style_trace; lv_style_t minute_line_style_trace;
lv_style_t second_line_style; lv_style_t second_line_style;
lv_obj_t* label_owner;
lv_obj_t* label_date_day; lv_obj_t* label_date_day;
lv_obj_t* plugIcon; lv_obj_t* plugIcon;
lv_obj_t* notificationIcon; lv_obj_t* notificationIcon;

View file

@ -35,6 +35,13 @@ WatchFaceDigital::WatchFaceDigital(Controllers::DateTime& dateTimeController,
statusIcons.Create(); statusIcons.Create();
// Owner's text
label_owner = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(label_owner, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_MAKE(0xFF, 0xAE, 0xC9));
lv_label_set_text_static(label_owner, Pinetime::Applications::OwnerText);
lv_label_set_align(label_owner, LV_LABEL_ALIGN_CENTER);
lv_obj_align(label_owner, nullptr, LV_ALIGN_CENTER, 0, -80);
notificationIcon = lv_label_create(lv_scr_act(), nullptr); 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_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)); lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(false));

View file

@ -52,6 +52,8 @@ namespace Pinetime {
Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate; Utility::DirtyValue<std::chrono::time_point<std::chrono::system_clock, std::chrono::days>> currentDate;
lv_obj_t* label_owner;
lv_obj_t* label_time; lv_obj_t* label_time;
lv_obj_t* label_time_ampm; lv_obj_t* label_time_ampm;
lv_obj_t* label_date; lv_obj_t* label_date;

View file

@ -44,11 +44,11 @@ WatchFaceTerminal::WatchFaceTerminal(Controllers::DateTime& dateTimeController,
label_prompt_1 = lv_label_create(lv_scr_act(), nullptr); label_prompt_1 = lv_label_create(lv_scr_act(), nullptr);
lv_obj_align(label_prompt_1, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -80); lv_obj_align(label_prompt_1, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, -80);
lv_label_set_text_static(label_prompt_1, "user@watch:~ $ now"); lv_label_set_text_fmt(label_prompt_1, "%s@watch:~ $ now", Pinetime::Applications::OwnerTextShort);
label_prompt_2 = lv_label_create(lv_scr_act(), nullptr); label_prompt_2 = lv_label_create(lv_scr_act(), nullptr);
lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60); lv_obj_align(label_prompt_2, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 60);
lv_label_set_text_static(label_prompt_2, "user@watch:~ $"); lv_label_set_text_fmt(label_prompt_2, "%s@watch:~ $", Pinetime::Applications::OwnerTextShort);
label_time = lv_label_create(lv_scr_act(), nullptr); label_time = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_recolor(label_time, true); lv_label_set_recolor(label_time, true);