From bde464a7844fd51daf73b9ec939fbd9412424a5e Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Sun, 27 Mar 2022 09:16:20 +0200 Subject: this appears to fix a simulator crash! diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp index b71e333..01dd534 100644 --- a/src/displayapp/screens/settings/Settings.cpp +++ b/src/displayapp/screens/settings/Settings.cpp @@ -17,6 +17,9 @@ Settings::Settings(Pinetime::Applications::DisplayApp* app, Pinetime::Controller [this]() -> std::unique_ptr { return CreateScreen1(); }, + [this]() -> std::unique_ptr { + return CreateScreen2(); + }, }, Screens::ScreenListModes::UpDown} { } @@ -34,10 +37,20 @@ std::unique_ptr Settings::CreateScreen1() { {Symbols::sun, "Display", Apps::SettingDisplay}, {Symbols::eye, "Wake Up", Apps::SettingWakeUp}, {Symbols::clock, "Time format", Apps::SettingTimeFormat}, - {Symbols::check, "Firmware", Apps::FirmwareValidation}, + {Symbols::none, "None", Apps::None} }}; return std::make_unique(0, 1, app, settingsController, applications); } +std::unique_ptr Settings::CreateScreen2() { + std::array applications {{ + {Symbols::tachometer, "Shake Calib.", Apps::SettingShakeThreshold}, + {Symbols::check, "Firmware", Apps::FirmwareValidation}, + {Symbols::none, "None", Apps::None}, + {Symbols::none, "None", Apps::None} +}}; + + return std::make_unique(1, 2, app, settingsController, applications); +} -- cgit v0.10.2 From 5313a788fed9a4cf19214eee8e9b1b4a67d043c4 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Sun, 27 Mar 2022 09:17:30 +0200 Subject: Test neofont1 in theme diff --git a/src/displayapp/fonts/neofont.c b/src/displayapp/fonts/neofont.c index e2e67e7..538b16b 100644 --- a/src/displayapp/fonts/neofont.c +++ b/src/displayapp/fonts/neofont.c @@ -532,7 +532,7 @@ static const uint8_t * neofont1_glyph_bitmap_cb(const lv_font_t * font, uint32_t } /*Describe the properties of a font*/ -const lv_font_t neofont1 = { +lv_font_t neofont1 = { .get_glyph_dsc = neofont1_glyph_dsc_cb, /*Set a callback to get info about gylphs*/ .get_glyph_bitmap = neofont1_glyph_bitmap_cb, /*Set a callback to get bitmap of a glyp*/ .line_height = 12, /*The real line height where any text fits*/ diff --git a/src/displayapp/fonts/neofont.h b/src/displayapp/fonts/neofont.h index 94d9e59..b6064b5 100644 --- a/src/displayapp/fonts/neofont.h +++ b/src/displayapp/fonts/neofont.h @@ -9,7 +9,7 @@ extern "C" { #endif extern const lv_font_t neofont0; -extern const lv_font_t neofont1; +// extern const lv_font_t neofont1; // extern const lv_font_t neofont2; extern const lv_font_t neofont3; diff --git a/src/libs/lv_conf.h b/src/libs/lv_conf.h index c1af42d..73b2d50 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(neofont2) \ +#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(neofont1) \ + LV_FONT_DECLARE(neofont2) \ LV_FONT_DECLARE(lv_font_sys_48) /* Enable it if you have fonts with a lot of characters. @@ -474,7 +475,7 @@ typedef void* lv_font_user_data_t; #define LV_THEME_DEFAULT_COLOR_PRIMARY lv_color_hex(0xffffff) #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 &neofont2 +#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 -- cgit v0.10.2 From bedaa08f560063ce64514108d67d84a90321ad90 Mon Sep 17 00:00:00 2001 From: Michele Bini Date: Sun, 27 Mar 2022 09:22:39 +0200 Subject: Revert "this appears to fix a simulator crash!" This reverts commit bde464a7844fd51daf73b9ec939fbd9412424a5e. diff --git a/src/displayapp/screens/settings/Settings.cpp b/src/displayapp/screens/settings/Settings.cpp index 01dd534..b71e333 100644 --- a/src/displayapp/screens/settings/Settings.cpp +++ b/src/displayapp/screens/settings/Settings.cpp @@ -17,9 +17,6 @@ Settings::Settings(Pinetime::Applications::DisplayApp* app, Pinetime::Controller [this]() -> std::unique_ptr { return CreateScreen1(); }, - [this]() -> std::unique_ptr { - return CreateScreen2(); - }, }, Screens::ScreenListModes::UpDown} { } @@ -37,20 +34,10 @@ std::unique_ptr Settings::CreateScreen1() { {Symbols::sun, "Display", Apps::SettingDisplay}, {Symbols::eye, "Wake Up", Apps::SettingWakeUp}, {Symbols::clock, "Time format", Apps::SettingTimeFormat}, - {Symbols::none, "None", Apps::None} + {Symbols::check, "Firmware", Apps::FirmwareValidation}, }}; return std::make_unique(0, 1, app, settingsController, applications); } -std::unique_ptr Settings::CreateScreen2() { - std::array applications {{ - {Symbols::tachometer, "Shake Calib.", Apps::SettingShakeThreshold}, - {Symbols::check, "Firmware", Apps::FirmwareValidation}, - {Symbols::none, "None", Apps::None}, - {Symbols::none, "None", Apps::None} -}}; - - return std::make_unique(1, 2, app, settingsController, applications); -} -- cgit v0.10.2