Fix typo in the name of the font "jetbrains_mono_extrabold_compressed" + use it as the default font.

This commit is contained in:
JF 2020-03-01 19:09:59 +01:00
parent 21375eab81
commit 5bc0640b73
7 changed files with 27 additions and 12 deletions

View File

@ -120,6 +120,17 @@ void DisplayApp::Refresh() {
if(!currentScreen->OnButtonPushed()) { if(!currentScreen->OnButtonPushed()) {
systemTask.PushMessage(System::SystemTask::Messages::GoToSleep); 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; break;
} }
} }

View File

@ -6,11 +6,11 @@
* Opts: * Opts:
******************************************************************************/ ******************************************************************************/
#ifndef JETBRAINS_MONO_EXTRABOLD_COMPRESSEDEXTRABOLD_COMPRESSED #ifndef JETBRAINS_MONO_EXTRABOLD_COMPRESSED
#define JETBRAINS_MONO_EXTRABOLD_COMPRESSEDEXTRABOLD_COMPRESSED 1 #define JETBRAINS_MONO_EXTRABOLD_COMPRESSED 1
#endif #endif
#if JETBRAINS_MONO_EXTRABOLD_COMPRESSEDEXTRABOLD_COMPRESSED #if JETBRAINS_MONO_EXTRABOLD_COMPRESSED
/*----------------- /*-----------------
* BITMAPS * BITMAPS
@ -492,7 +492,7 @@ static lv_font_fmt_txt_dsc_t font_dsc = {
*----------------*/ *----------------*/
/*Initialize a public general font descriptor*/ /*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_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*/ .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*/ .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` */ .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*/

View File

@ -12,6 +12,11 @@
using namespace Pinetime::Components; 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) { static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p) {
auto* lvgl = static_cast<LittleVgl*>(disp_drv->user_data); auto* lvgl = static_cast<LittleVgl*>(disp_drv->user_data);
lvgl->FlushDisplay(area, color_p); lvgl->FlushDisplay(area, color_p);
@ -135,8 +140,7 @@ void LittleVgl::InitTheme() {
} }
void LittleVgl::InitBaseTheme() { 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*/ lv_style_copy(&def, &lv_style_plain); /*Initialize the default style*/
def.text.font = font; def.text.font = font;

View File

@ -7,7 +7,7 @@
#include "../DisplayApp.h" #include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; 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; extern lv_font_t jetbrains_mono_bold_20;
static void event_handler(lv_obj_t * obj, lv_event_t event) { 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; labelStyle->text.font = &jetbrains_mono_bold_20;
lv_style_copy(&labelBigStyle, labelStyle); 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); lv_label_set_style(label_battery, LV_LABEL_STYLE_MAIN, labelStyle);

View File

@ -3,7 +3,7 @@
#include "../DisplayApp.h" #include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; 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; extern lv_font_t jetbrains_mono_bold_20;

View File

@ -3,7 +3,7 @@
#include "../DisplayApp.h" #include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; 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; extern lv_font_t jetbrains_mono_bold_20;

View File

@ -3,7 +3,7 @@
#include "../DisplayApp.h" #include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens; 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; extern lv_font_t jetbrains_mono_bold_20;
Modal::Modal(Pinetime::Applications::DisplayApp *app) : Screen(app) { Modal::Modal(Pinetime::Applications::DisplayApp *app) : Screen(app) {