summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-03-27 08:32:54 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-03-27 08:32:54 (GMT)
commitc8694c78c6cc05ae09e862e7ecd09407c7a3c3b7 (patch)
tree6bb1cc86276aef2d4f6f8a23727cc23e8bb4e7e0
parent1f39379a6519055d5633a560d041be6a69d4a2f5 (diff)
parentea4e6d8ad74ea982ad29c047c86bdac95a4ca539 (diff)
Merge ../InfiniSim/InfiniTime into ultraredux
-rw-r--r--src/displayapp/LittleVgl.cpp2
-rw-r--r--src/displayapp/fonts/neofont.c10
-rw-r--r--src/displayapp/fonts/neofont.h2
-rw-r--r--src/displayapp/screens/WatchFaceDigital.cpp13
-rw-r--r--src/libs/lv_conf.h9
5 files changed, 22 insertions, 14 deletions
diff --git a/src/displayapp/LittleVgl.cpp b/src/displayapp/LittleVgl.cpp
index 7ab7e29..9dc4e2a 100644
--- a/src/displayapp/LittleVgl.cpp
+++ b/src/displayapp/LittleVgl.cpp
@@ -186,7 +186,7 @@ bool LittleVgl::GetTouchPadInfo(lv_indev_data_t* ptr) {
void LittleVgl::InitTheme() {
lv_theme_t* th = lv_pinetime_theme_init(
- LV_COLOR_WHITE, LV_COLOR_SILVER, 0, &neofont2, &neofont2, &neofont2, &neofont2);
+ LV_COLOR_WHITE, LV_COLOR_SILVER, 0, &neofont1, &neofont1, &neofont1, &neofont1);
lv_theme_set_act(th);
}
diff --git a/src/displayapp/fonts/neofont.c b/src/displayapp/fonts/neofont.c
index 538b16b..12a467a 100644
--- a/src/displayapp/fonts/neofont.c
+++ b/src/displayapp/fonts/neofont.c
@@ -292,6 +292,12 @@ static uint8_t glyphs[][2] = {
_, _, _,
_, X, _ ),
+ G( X, _, _,
+ _, _, X,
+ _, X, _,
+ X, _, _,
+ _, _, X ),
+
G( _, X, _,
X, X, X,
_, X, _,
@@ -344,7 +350,7 @@ static const uint8_t * neofont0_glyph_bitmap_cb(const lv_font_t * font, uint32_t
}
if (unicode_letter == ' ') { return spc; }
- static const char *symbols = "-/:.,_?!#";
+ static const char *symbols = "-/:.,_?!%#";
if (unicode_letter < 0x80) {
char*x = strchr(symbols,((uint8_t)unicode_letter));
if (x != NULL) {
@@ -354,7 +360,7 @@ static const uint8_t * neofont0_glyph_bitmap_cb(const lv_font_t * font, uint32_t
return glyphs[sizeof(glyphs)/sizeof(glyphs[0])-1];
}
-const lv_font_t neofont0 = {
+lv_font_t neofont0 = {
.get_glyph_dsc = neofont0_glyph_dsc_cb, /*Set a callback to get info about gylphs*/
.get_glyph_bitmap = neofont0_glyph_bitmap_cb, /*Set a callback to get bitmap of a glyp*/
.line_height = 6, /*The real line height where any text fits*/
diff --git a/src/displayapp/fonts/neofont.h b/src/displayapp/fonts/neofont.h
index b6064b5..b01a7af 100644
--- a/src/displayapp/fonts/neofont.h
+++ b/src/displayapp/fonts/neofont.h
@@ -8,7 +8,7 @@
extern "C" {
#endif
-extern const lv_font_t neofont0;
+// extern const lv_font_t neofont0;
// extern const lv_font_t neofont1;
// extern const lv_font_t neofont2;
extern const lv_font_t neofont3;
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp
index 43ea8b4..e33a403 100644
--- a/src/displayapp/screens/WatchFaceDigital.cpp
+++ b/src/displayapp/screens/WatchFaceDigital.cpp
@@ -32,12 +32,13 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
motionController {motionController} {
batteryIcon = lv_label_create(lv_scr_act(), nullptr);
- lv_label_set_text_static(batteryIcon, Symbols::batteryFull);
+ lv_label_set_text_fmt(batteryIcon, "B##%%");
+ lv_obj_set_style_local_text_font(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont1);
lv_obj_align(batteryIcon, lv_scr_act(), LV_ALIGN_IN_TOP_RIGHT, 0, 0);
batteryPlug = lv_label_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_text_color(batteryPlug, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFF0000));
- lv_label_set_text_static(batteryPlug, Symbols::plug);
+ lv_obj_set_style_local_text_color(batteryPlug, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xFFFF00));
+ lv_label_set_text_static(batteryPlug, "");
lv_obj_align(batteryPlug, batteryIcon, LV_ALIGN_OUT_LEFT_MID, -5, 0);
bleIcon = lv_label_create(lv_scr_act(), nullptr);
@@ -53,7 +54,7 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
label_date = lv_label_create(lv_scr_act(), nullptr);
lv_obj_align(label_date, lv_scr_act(), LV_ALIGN_CENTER, 0, 60);
lv_obj_set_style_local_text_color(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
- lv_obj_set_style_local_text_font(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont1);
+ lv_obj_set_style_local_text_font(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont2);
label_time = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_font(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &neofont3);
@@ -83,7 +84,7 @@ WatchFaceDigital::~WatchFaceDigital() {
void WatchFaceDigital::Refresh() {
powerPresent = batteryController.IsPowerPresent();
if (powerPresent.IsUpdated()) {
- lv_label_set_text_static(batteryPlug, BatteryIcon::GetPlugIcon(powerPresent.Get()));
+ lv_label_set_text_static(batteryPlug, (powerPresent.Get() ? "PWR" : ""));
}
batteryPercentRemaining = batteryController.PercentRemaining();
@@ -94,7 +95,7 @@ void WatchFaceDigital::Refresh() {
} else {
lv_obj_set_style_local_text_color(batteryIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
}
- lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent));
+ lv_label_set_text_fmt(batteryIcon, "B%d%%", batteryPercent);
}
bleState = bleController.IsConnected();
diff --git a/src/libs/lv_conf.h b/src/libs/lv_conf.h
index 73b2d50..58a8593 100644
--- a/src/libs/lv_conf.h
+++ b/src/libs/lv_conf.h
@@ -413,7 +413,8 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
* LV_FONT_DECLARE(my_font_2)
*/
-#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(neofont1) \
+#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(neofont0) \
+ LV_FONT_DECLARE(neofont1) \
LV_FONT_DECLARE(neofont2) \
LV_FONT_DECLARE(lv_font_sys_48)
@@ -476,9 +477,9 @@ typedef void* lv_font_user_data_t;
#define LV_THEME_DEFAULT_COLOR_SECONDARY lv_color_hex(0xaaaaaa)
#define LV_THEME_DEFAULT_FLAG 0//LV_THEME_MATERIAL_FLAG_DARK
#define LV_THEME_DEFAULT_FONT_SMALL &neofont1
-#define LV_THEME_DEFAULT_FONT_NORMAL &neofont2
-#define LV_THEME_DEFAULT_FONT_SUBTITLE &neofont2
-#define LV_THEME_DEFAULT_FONT_TITLE &neofont2
+#define LV_THEME_DEFAULT_FONT_NORMAL &neofont1
+#define LV_THEME_DEFAULT_FONT_SUBTITLE &neofont1
+#define LV_THEME_DEFAULT_FONT_TITLE &neofont1
/*=================
* Text settings