From 5bc0640b735573b465cfef16fb729ad5f5149eb4 Mon Sep 17 00:00:00 2001 From: JF Date: Sun, 1 Mar 2020 19:09:59 +0100 Subject: Fix typo in the name of the font "jetbrains_mono_extrabold_compressed" + use it as the default font. --- src/DisplayApp/DisplayApp.cpp | 11 +++++++++++ src/DisplayApp/Fonts/jetbrains_mono_extrabold_compressed.c | 10 +++++----- src/DisplayApp/LittleVgl.cpp | 8 ++++++-- src/DisplayApp/Screens/Clock.cpp | 4 ++-- src/DisplayApp/Screens/Gauge.cpp | 2 +- src/DisplayApp/Screens/Meter.cpp | 2 +- src/DisplayApp/Screens/Modal.cpp | 2 +- 7 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/DisplayApp/DisplayApp.cpp b/src/DisplayApp/DisplayApp.cpp index 316312ed..d7d62dde 100644 --- a/src/DisplayApp/DisplayApp.cpp +++ b/src/DisplayApp/DisplayApp.cpp @@ -120,6 +120,17 @@ void DisplayApp::Refresh() { if(!currentScreen->OnButtonPushed()) { systemTask.PushMessage(System::SystemTask::Messages::GoToSleep); } +// currentScreen.reset(nullptr); +// if(toggle) { +// modal.Show(); +//// currentScreen.reset(new Screens::Tile(this)); +// toggle = false; +// } else { +// modal.Hide(); +//// currentScreen.reset(new Screens::Clock(this, dateTimeController, batteryController, bleController)); +// toggle = true; +// } + break; } } diff --git a/src/DisplayApp/Fonts/jetbrains_mono_extrabold_compressed.c b/src/DisplayApp/Fonts/jetbrains_mono_extrabold_compressed.c index c850cd91..c9917e40 100644 --- a/src/DisplayApp/Fonts/jetbrains_mono_extrabold_compressed.c +++ b/src/DisplayApp/Fonts/jetbrains_mono_extrabold_compressed.c @@ -6,11 +6,11 @@ * Opts: ******************************************************************************/ -#ifndef JETBRAINS_MONO_EXTRABOLD_COMPRESSEDEXTRABOLD_COMPRESSED -#define JETBRAINS_MONO_EXTRABOLD_COMPRESSEDEXTRABOLD_COMPRESSED 1 +#ifndef JETBRAINS_MONO_EXTRABOLD_COMPRESSED +#define JETBRAINS_MONO_EXTRABOLD_COMPRESSED 1 #endif -#if JETBRAINS_MONO_EXTRABOLD_COMPRESSEDEXTRABOLD_COMPRESSED +#if JETBRAINS_MONO_EXTRABOLD_COMPRESSED /*----------------- * BITMAPS @@ -492,7 +492,7 @@ static lv_font_fmt_txt_dsc_t font_dsc = { *----------------*/ /*Initialize a public general font descriptor*/ -lv_font_t jetbrains_mono_extrabold_compressedextrabold_compressed = { +lv_font_t jetbrains_mono_extrabold_compressed = { .get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/ .get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/ .line_height = 60, /*The maximum line height required by the font*/ @@ -503,5 +503,5 @@ lv_font_t jetbrains_mono_extrabold_compressedextrabold_compressed = { .dsc = &font_dsc /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */ }; -#endif /*#if JETBRAINS_MONO_EXTRABOLD_COMPRESSEDEXTRABOLD_COMPRESSED*/ +#endif /*#if JETBRAINS_MONO_EXTRABOLD_COMPRESSED*/ diff --git a/src/DisplayApp/LittleVgl.cpp b/src/DisplayApp/LittleVgl.cpp index c4fa1793..59334931 100644 --- a/src/DisplayApp/LittleVgl.cpp +++ b/src/DisplayApp/LittleVgl.cpp @@ -12,6 +12,11 @@ using namespace Pinetime::Components; +extern "C" { +LV_FONT_DECLARE(jetbrains_mono_extrabold_compressed) +LV_FONT_DECLARE(jetbrains_mono_bold_20) +} + static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p) { auto* lvgl = static_cast(disp_drv->user_data); lvgl->FlushDisplay(area, color_p); @@ -135,8 +140,7 @@ void LittleVgl::InitTheme() { } void LittleVgl::InitBaseTheme() { - if(font == nullptr) font = LV_FONT_DEFAULT; - + if(font == nullptr) font = &jetbrains_mono_bold_20; lv_style_copy(&def, &lv_style_plain); /*Initialize the default style*/ def.text.font = font; diff --git a/src/DisplayApp/Screens/Clock.cpp b/src/DisplayApp/Screens/Clock.cpp index f0bd8338..1dff88c2 100644 --- a/src/DisplayApp/Screens/Clock.cpp +++ b/src/DisplayApp/Screens/Clock.cpp @@ -7,7 +7,7 @@ #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; -extern lv_font_t jetbrains_mono_extrabold_compressedextrabold_compressed; +extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_bold_20; static void event_handler(lv_obj_t * obj, lv_event_t event) { @@ -33,7 +33,7 @@ Clock::Clock(DisplayApp* app, labelStyle->text.font = &jetbrains_mono_bold_20; lv_style_copy(&labelBigStyle, labelStyle); - labelBigStyle.text.font = &jetbrains_mono_extrabold_compressedextrabold_compressed; + labelBigStyle.text.font = &jetbrains_mono_extrabold_compressed; lv_label_set_style(label_battery, LV_LABEL_STYLE_MAIN, labelStyle); diff --git a/src/DisplayApp/Screens/Gauge.cpp b/src/DisplayApp/Screens/Gauge.cpp index 33f76a74..4c4cccd9 100644 --- a/src/DisplayApp/Screens/Gauge.cpp +++ b/src/DisplayApp/Screens/Gauge.cpp @@ -3,7 +3,7 @@ #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; -extern lv_font_t jetbrains_mono_extrabold_compressedextrabold_compressed; +extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_bold_20; diff --git a/src/DisplayApp/Screens/Meter.cpp b/src/DisplayApp/Screens/Meter.cpp index 9daafad3..c74b8bdf 100644 --- a/src/DisplayApp/Screens/Meter.cpp +++ b/src/DisplayApp/Screens/Meter.cpp @@ -3,7 +3,7 @@ #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; -extern lv_font_t jetbrains_mono_extrabold_compressedextrabold_compressed; +extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_bold_20; diff --git a/src/DisplayApp/Screens/Modal.cpp b/src/DisplayApp/Screens/Modal.cpp index 13bd42fa..7a0264e3 100644 --- a/src/DisplayApp/Screens/Modal.cpp +++ b/src/DisplayApp/Screens/Modal.cpp @@ -3,7 +3,7 @@ #include "../DisplayApp.h" using namespace Pinetime::Applications::Screens; -extern lv_font_t jetbrains_mono_extrabold_compressedextrabold_compressed; +extern lv_font_t jetbrains_mono_extrabold_compressed; extern lv_font_t jetbrains_mono_bold_20; Modal::Modal(Pinetime::Applications::DisplayApp *app) : Screen(app) { -- cgit v1.2.3