Merge remote-tracking branch 'upstream/develop' into pinetimestyle-colorpicker

This commit is contained in:
Kieran Cawthray 2021-06-25 08:48:16 +02:00
commit d5d8438b60
7 changed files with 213 additions and 199 deletions

Binary file not shown.

View file

@ -10,7 +10,7 @@
* Size : 20 * Size : 20
* Bpp : 1 bit-per-pixel * Bpp : 1 bit-per-pixel
* Do not enable font compression and horizontal subpixel hinting * Do not enable font compression and horizontal subpixel hinting
* Load the file `JetBrainsMono-Bold.tff` and specify the following range : `0x20-0x7f, 0x410-0x44f` * Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x20-0x7f, 0x410-0x44f`
* Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following
range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252` range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252`
* Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts` * Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts`

File diff suppressed because it is too large Load diff

View file

@ -141,9 +141,6 @@ std::unique_ptr<Screen> SystemInfo::CreateScreen2() {
uptimeSeconds = uptimeSeconds % secondsInAMinute; uptimeSeconds = uptimeSeconds % secondsInAMinute;
// TODO handle more than 100 days of uptime // TODO handle more than 100 days of uptime
if (batteryPercent == -1)
batteryPercent = 0;
// hack to not use the flot functions from printf // hack to not use the flot functions from printf
uint8_t batteryVoltageBytes[2]; uint8_t batteryVoltageBytes[2];
batteryVoltageBytes[1] = static_cast<uint8_t>(batteryVoltage); // truncate whole numbers batteryVoltageBytes[1] = static_cast<uint8_t>(batteryVoltage); // truncate whole numbers

View file

@ -30,14 +30,14 @@ WatchFaceAnalog::WatchFaceAnalog(Pinetime::Applications::DisplayApp* app,
Controllers::DateTime& dateTimeController, Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController, Controllers::Battery& batteryController,
Controllers::Ble& bleController, Controllers::Ble& bleController,
Controllers::NotificationManager& notificatioManager, Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController) Controllers::Settings& settingsController)
: Screen(app), : Screen(app),
currentDateTime {{}}, currentDateTime {{}},
dateTimeController {dateTimeController}, dateTimeController {dateTimeController},
batteryController {batteryController}, batteryController {batteryController},
bleController {bleController}, bleController {bleController},
notificatioManager {notificatioManager}, notificationManager {notificationManager},
settingsController {settingsController} { settingsController {settingsController} {
settingsController.SetClockFace(1); settingsController.SetClockFace(1);
@ -172,7 +172,7 @@ bool WatchFaceAnalog::Refresh() {
lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent));
} }
notificationState = notificatioManager.AreNewNotificationsAvailable(); notificationState = notificationManager.AreNewNotificationsAvailable();
if (notificationState.IsUpdated()) { if (notificationState.IsUpdated()) {
if (notificationState.Get() == true) if (notificationState.Get() == true)

View file

@ -27,7 +27,7 @@ namespace Pinetime {
Controllers::DateTime& dateTimeController, Controllers::DateTime& dateTimeController,
Controllers::Battery& batteryController, Controllers::Battery& batteryController,
Controllers::Ble& bleController, Controllers::Ble& bleController,
Controllers::NotificationManager& notificatioManager, Controllers::NotificationManager& notificationManager,
Controllers::Settings& settingsController); Controllers::Settings& settingsController);
~WatchFaceAnalog() override; ~WatchFaceAnalog() override;
@ -79,7 +79,7 @@ namespace Pinetime {
Controllers::DateTime& dateTimeController; Controllers::DateTime& dateTimeController;
Controllers::Battery& batteryController; Controllers::Battery& batteryController;
Controllers::Ble& bleController; Controllers::Ble& bleController;
Controllers::NotificationManager& notificatioManager; Controllers::NotificationManager& notificationManager;
Controllers::Settings& settingsController; Controllers::Settings& settingsController;
void UpdateClock(); void UpdateClock();

View file

@ -140,8 +140,9 @@ void St7789::Uninit() {
} }
void St7789::DrawPixel(uint16_t x, uint16_t y, uint32_t color) { void St7789::DrawPixel(uint16_t x, uint16_t y, uint32_t color) {
if ((x < 0) || (x >= Width) || (y < 0) || (y >= Height)) if (x >= Width || y >= Height) {
return; return;
}
SetAddrWindow(x, y, x + 1, y + 1); SetAddrWindow(x, y, x + 1, y + 1);