mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 23:21:53 +02:00
Merge fb2219651f
into a2356f2f4a
This commit is contained in:
commit
c5d5346590
|
@ -16,6 +16,7 @@ cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-image-$PROJECT_VERSION.bin"
|
||||||
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip"
|
cp "$BUILD_DIR/src/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip" "$OUTPUT_DIR/pinetime-mcuboot-recovery-loader-dfu-$PROJECT_VERSION.zip"
|
||||||
|
|
||||||
cp "$BUILD_DIR/src/resources/infinitime-resources-$PROJECT_VERSION.zip" "$OUTPUT_DIR/infinitime-resources-$PROJECT_VERSION.zip"
|
cp "$BUILD_DIR/src/resources/infinitime-resources-$PROJECT_VERSION.zip" "$OUTPUT_DIR/infinitime-resources-$PROJECT_VERSION.zip"
|
||||||
|
cp -a "$BUILD_DIR/src/resources/lang_pack/" "$OUTPUT_DIR/"
|
||||||
|
|
||||||
mkdir -p "$OUTPUT_DIR/src"
|
mkdir -p "$OUTPUT_DIR/src"
|
||||||
cp $BUILD_DIR/src/*.bin "$OUTPUT_DIR/src/"
|
cp $BUILD_DIR/src/*.bin "$OUTPUT_DIR/src/"
|
||||||
|
|
|
@ -541,7 +541,8 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
|
||||||
systemTask->nimble().alertService(),
|
systemTask->nimble().alertService(),
|
||||||
motorController,
|
motorController,
|
||||||
*systemTask,
|
*systemTask,
|
||||||
Screens::Notifications::Modes::Normal);
|
Screens::Notifications::Modes::Normal,
|
||||||
|
filesystem);
|
||||||
break;
|
break;
|
||||||
case Apps::NotificationsPreview:
|
case Apps::NotificationsPreview:
|
||||||
currentScreen = std::make_unique<Screens::Notifications>(this,
|
currentScreen = std::make_unique<Screens::Notifications>(this,
|
||||||
|
@ -549,7 +550,8 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio
|
||||||
systemTask->nimble().alertService(),
|
systemTask->nimble().alertService(),
|
||||||
motorController,
|
motorController,
|
||||||
*systemTask,
|
*systemTask,
|
||||||
Screens::Notifications::Modes::Preview);
|
Screens::Notifications::Modes::Preview,
|
||||||
|
filesystem);
|
||||||
break;
|
break;
|
||||||
case Apps::QuickSettings:
|
case Apps::QuickSettings:
|
||||||
currentScreen = std::make_unique<Screens::QuickSettings>(this,
|
currentScreen = std::make_unique<Screens::QuickSettings>(this,
|
||||||
|
|
|
@ -15,7 +15,8 @@ Notifications::Notifications(DisplayApp* app,
|
||||||
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
|
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
|
||||||
Pinetime::Controllers::MotorController& motorController,
|
Pinetime::Controllers::MotorController& motorController,
|
||||||
System::SystemTask& systemTask,
|
System::SystemTask& systemTask,
|
||||||
Modes mode)
|
Modes mode,
|
||||||
|
Controllers::FS& filesystem)
|
||||||
: app {app},
|
: app {app},
|
||||||
notificationManager {notificationManager},
|
notificationManager {notificationManager},
|
||||||
alertNotificationService {alertNotificationService},
|
alertNotificationService {alertNotificationService},
|
||||||
|
@ -23,6 +24,14 @@ Notifications::Notifications(DisplayApp* app,
|
||||||
wakeLock(systemTask),
|
wakeLock(systemTask),
|
||||||
mode {mode} {
|
mode {mode} {
|
||||||
|
|
||||||
|
lfs_file f = {};
|
||||||
|
if (filesystem.FileOpen(&f, "/fonts/lang_pack.bin", LFS_O_RDONLY) >= 0) {
|
||||||
|
filesystem.FileClose(&f);
|
||||||
|
lang_pack = lv_font_load("F:/fonts/lang_pack.bin");
|
||||||
|
jetbrains_mono_bold_20.fallback = lang_pack;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
notificationManager.ClearNewNotificationFlag();
|
notificationManager.ClearNewNotificationFlag();
|
||||||
auto notification = notificationManager.GetLastNotification();
|
auto notification = notificationManager.GetLastNotification();
|
||||||
if (notification.valid) {
|
if (notification.valid) {
|
||||||
|
@ -66,6 +75,10 @@ Notifications::~Notifications() {
|
||||||
// make sure we stop any vibrations before exiting
|
// make sure we stop any vibrations before exiting
|
||||||
motorController.StopRinging();
|
motorController.StopRinging();
|
||||||
lv_obj_clean(lv_scr_act());
|
lv_obj_clean(lv_scr_act());
|
||||||
|
|
||||||
|
if (lang_pack != nullptr) {
|
||||||
|
lv_font_free(lang_pack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Notifications::Refresh() {
|
void Notifications::Refresh() {
|
||||||
|
|
|
@ -26,7 +26,8 @@ namespace Pinetime {
|
||||||
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
|
Pinetime::Controllers::AlertNotificationService& alertNotificationService,
|
||||||
Pinetime::Controllers::MotorController& motorController,
|
Pinetime::Controllers::MotorController& motorController,
|
||||||
System::SystemTask& systemTask,
|
System::SystemTask& systemTask,
|
||||||
Modes mode);
|
Modes mode,
|
||||||
|
Controllers::FS& filesystem);
|
||||||
~Notifications() override;
|
~Notifications() override;
|
||||||
|
|
||||||
void Refresh() override;
|
void Refresh() override;
|
||||||
|
@ -91,6 +92,7 @@ namespace Pinetime {
|
||||||
bool dismissingNotification = false;
|
bool dismissingNotification = false;
|
||||||
|
|
||||||
lv_task_t* taskRefresh;
|
lv_task_t* taskRefresh;
|
||||||
|
lv_font_t* lang_pack = nullptr;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 7c96fb87e33733a7a67b33bf8057e598c6843e3a
|
Subproject commit 1fe2029b42ad6ce354346e853d87a3226dfb46a0
|
|
@ -27,3 +27,16 @@ add_custom_target(GenerateResources
|
||||||
COMMENT "Generate fonts and images for resource package"
|
COMMENT "Generate fonts and images for resource package"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# generate language pack fonts
|
||||||
|
set(LANG_PACK_JSON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lang_pack)
|
||||||
|
file(GLOB LANG_PACK_JSON_LIST "${LANG_PACK_JSON_DIR}/*")
|
||||||
|
|
||||||
|
foreach(LANG_PACK_JSON IN LISTS LANG_PACK_JSON_LIST)
|
||||||
|
get_filename_component(LANG_PACK ${LANG_PACK_JSON} NAME_WE)
|
||||||
|
add_custom_command(TARGET GenerateResources
|
||||||
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/lang_pack
|
||||||
|
COMMAND "${Python3_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/generate-fonts.py --lv-font-conv "${LV_FONT_CONV}" ${CMAKE_CURRENT_SOURCE_DIR}/lang_pack/${LANG_PACK}.json
|
||||||
|
COMMAND "${Python3_EXECUTABLE}" ${CMAKE_CURRENT_SOURCE_DIR}/generate-package.py --config ${CMAKE_CURRENT_SOURCE_DIR}/lang_pack/${LANG_PACK}.json --output ./lang_pack/${LANG_PACK}.zip
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
endforeach()
|
||||||
|
|
BIN
src/resources/JetBrainsMono-Bold.ttf
Normal file
BIN
src/resources/JetBrainsMono-Bold.ttf
Normal file
Binary file not shown.
14
src/resources/lang_pack/greek.json
Normal file
14
src/resources/lang_pack/greek.json
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"lang_pack" : {
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"file": "JetBrainsMono-Bold.ttf",
|
||||||
|
"range": "0x391-0x3a9, 0x3b1-0x3c9"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"bpp": 1,
|
||||||
|
"size": 20,
|
||||||
|
"format": "bin",
|
||||||
|
"target_path": "/fonts/"
|
||||||
|
}
|
||||||
|
}
|
14
src/resources/lang_pack/latin.json
Normal file
14
src/resources/lang_pack/latin.json
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"lang_pack" : {
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"file": "JetBrainsMono-Bold.ttf",
|
||||||
|
"range": "0xc0-0xff"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"bpp": 1,
|
||||||
|
"size": 20,
|
||||||
|
"format": "bin",
|
||||||
|
"target_path": "/fonts/"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue