mirror of
https://github.com/InfiniTimeOrg/InfiniTime.git
synced 2024-10-22 23:21:53 +02:00
Compare commits
No commits in common. "42bcd5654596c3df7714599d8af65c59ff6726ff" and "f0211e5fcbab990da6b989b533c3e42ca63f5e18" have entirely different histories.
42bcd56545
...
f0211e5fcb
|
@ -62,7 +62,7 @@
|
||||||
#define configTICK_RATE_HZ 1024
|
#define configTICK_RATE_HZ 1024
|
||||||
#define configMAX_PRIORITIES (3)
|
#define configMAX_PRIORITIES (3)
|
||||||
#define configMINIMAL_STACK_SIZE (120)
|
#define configMINIMAL_STACK_SIZE (120)
|
||||||
#define configTOTAL_HEAP_SIZE (1024 * 40)
|
#define configTOTAL_HEAP_SIZE (1024 * 35)
|
||||||
#define configMAX_TASK_NAME_LEN (4)
|
#define configMAX_TASK_NAME_LEN (4)
|
||||||
#define configUSE_16_BIT_TICKS 0
|
#define configUSE_16_BIT_TICKS 0
|
||||||
#define configIDLE_SHOULD_YIELD 1
|
#define configIDLE_SHOULD_YIELD 1
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "displayapp/screens/Weather.h"
|
#include "displayapp/screens/Weather.h"
|
||||||
#include "displayapp/screens/PassKey.h"
|
#include "displayapp/screens/PassKey.h"
|
||||||
#include "displayapp/screens/Error.h"
|
#include "displayapp/screens/Error.h"
|
||||||
|
#include "displayapp/screens/Symbols.h"
|
||||||
|
|
||||||
#include "drivers/Cst816s.h"
|
#include "drivers/Cst816s.h"
|
||||||
#include "drivers/St7789.h"
|
#include "drivers/St7789.h"
|
||||||
|
@ -101,6 +102,7 @@ DisplayApp::DisplayApp(Drivers::St7789& lcd,
|
||||||
spiNorFlash {spiNorFlash},
|
spiNorFlash {spiNorFlash},
|
||||||
lvgl {lcd, filesystem},
|
lvgl {lcd, filesystem},
|
||||||
timer(this, TimerCallback),
|
timer(this, TimerCallback),
|
||||||
|
popupMessage {Screens::Symbols::lock, 90, 90},
|
||||||
controllers {batteryController,
|
controllers {batteryController,
|
||||||
bleController,
|
bleController,
|
||||||
dateTimeController,
|
dateTimeController,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
set(FONTS jetbrains_mono_42 jetbrains_mono_76 jetbrains_mono_bold_20
|
set(FONTS jetbrains_mono_42 jetbrains_mono_76 jetbrains_mono_bold_20
|
||||||
jetbrains_mono_extrabold_compressed lv_font_sys_48
|
jetbrains_mono_extrabold_compressed lv_font_sys_48 lv_font_sys_80
|
||||||
open_sans_light fontawesome_weathericons)
|
open_sans_light fontawesome_weathericons)
|
||||||
find_program(LV_FONT_CONV "lv_font_conv" NO_CACHE REQUIRED
|
find_program(LV_FONT_CONV "lv_font_conv" NO_CACHE REQUIRED
|
||||||
HINTS "${CMAKE_SOURCE_DIR}/node_modules/.bin")
|
HINTS "${CMAKE_SOURCE_DIR}/node_modules/.bin")
|
||||||
|
|
|
@ -64,6 +64,16 @@
|
||||||
"bpp": 1,
|
"bpp": 1,
|
||||||
"size": 48
|
"size": 48
|
||||||
},
|
},
|
||||||
|
"lv_font_sys_80": {
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"file": "material-design-icons/MaterialIcons-Regular.ttf",
|
||||||
|
"range": "0xe897"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"bpp": 1,
|
||||||
|
"size": 80
|
||||||
|
},
|
||||||
"fontawesome_weathericons": {
|
"fontawesome_weathericons": {
|
||||||
"sources": [
|
"sources": [
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,6 +64,9 @@ namespace Pinetime {
|
||||||
|
|
||||||
static constexpr const char* flashlight = "\xEF\x80\x8B";
|
static constexpr const char* flashlight = "\xEF\x80\x8B";
|
||||||
static constexpr const char* paintbrushLg = "\xEE\x90\x8A";
|
static constexpr const char* paintbrushLg = "\xEE\x90\x8A";
|
||||||
|
|
||||||
|
// wake-up screenlock icon, from material icons
|
||||||
|
static constexpr const char* lock = "\xEE\xA2\x97";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,40 +1,21 @@
|
||||||
#include "displayapp/widgets/PopupMessage.h"
|
#include "displayapp/widgets/PopupMessage.h"
|
||||||
#include "displayapp/InfiniTimeTheme.h"
|
|
||||||
#include <libraries/log/nrf_log.h>
|
#include <libraries/log/nrf_log.h>
|
||||||
|
|
||||||
using namespace Pinetime::Applications::Widgets;
|
using namespace Pinetime::Applications::Widgets;
|
||||||
|
|
||||||
PopupMessage::PopupMessage() {
|
PopupMessage::PopupMessage(const char* msg, int16_t h, int16_t w) : message {msg}, height {h}, width {w} {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupMessage::Create() {
|
void PopupMessage::Create() {
|
||||||
popup = lv_obj_create(lv_scr_act(), nullptr);
|
btnPopup = lv_btn_create(lv_scr_act(), nullptr);
|
||||||
lv_obj_set_size(popup, 90, 90);
|
btnPopup->user_data = this;
|
||||||
lv_obj_align(popup, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
|
lv_obj_set_size(btnPopup, height, width);
|
||||||
lv_obj_set_style_local_bg_color(popup, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, Colors::bg);
|
lv_obj_align(btnPopup, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
|
||||||
lv_obj_set_style_local_bg_opa(popup, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_60);
|
lv_obj_set_style_local_bg_opa(btnPopup, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_60);
|
||||||
lv_obj_t* lockBody = lv_obj_create(popup, nullptr);
|
lv_obj_set_style_local_text_font(btnPopup, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &lv_font_sys_80);
|
||||||
lv_obj_set_size(lockBody, 55, 50);
|
lv_obj_t* lblMessage = lv_label_create(btnPopup, nullptr);
|
||||||
lv_obj_align(lockBody, popup, LV_ALIGN_CENTER, 0, 10);
|
lv_label_set_text_static(lblMessage, message);
|
||||||
|
lv_obj_set_hidden(btnPopup, isHidden);
|
||||||
lv_obj_set_style_local_bg_color(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
|
|
||||||
lv_obj_set_style_local_bg_opa(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_0);
|
|
||||||
lv_obj_set_style_local_border_color(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
|
|
||||||
lv_obj_set_style_local_border_width(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 22);
|
|
||||||
lv_obj_set_style_local_border_side(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_BORDER_SIDE_FULL);
|
|
||||||
lv_obj_set_style_local_border_opa(lockBody, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_100);
|
|
||||||
|
|
||||||
lv_obj_t* lockTop = lv_obj_create(popup, nullptr);
|
|
||||||
lv_obj_set_size(lockTop, 30, 35);
|
|
||||||
lv_obj_align(lockTop, popup, LV_ALIGN_CENTER, 0, -20);
|
|
||||||
lv_obj_set_style_local_bg_color(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
|
|
||||||
lv_obj_set_style_local_bg_opa(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_0);
|
|
||||||
lv_obj_set_style_local_border_color(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);
|
|
||||||
lv_obj_set_style_local_border_width(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, 6);
|
|
||||||
lv_obj_set_style_local_border_side(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_BORDER_SIDE_FULL);
|
|
||||||
lv_obj_set_style_local_border_opa(lockTop, LV_OBJ_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_100);
|
|
||||||
|
|
||||||
lv_obj_set_hidden(popup, isHidden);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PopupMessage::SetHidden(bool hidden) {
|
void PopupMessage::SetHidden(bool hidden) {
|
||||||
|
@ -43,11 +24,11 @@ void PopupMessage::SetHidden(bool hidden) {
|
||||||
}
|
}
|
||||||
isHidden = hidden;
|
isHidden = hidden;
|
||||||
// create/delete on demand
|
// create/delete on demand
|
||||||
if (popup == nullptr && !isHidden) {
|
if (btnPopup == nullptr && !isHidden) {
|
||||||
Create();
|
Create();
|
||||||
} else if (popup != nullptr) {
|
} else if (btnPopup != nullptr) {
|
||||||
lv_obj_del(popup);
|
lv_obj_del(btnPopup);
|
||||||
popup = nullptr;
|
btnPopup = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,14 +6,18 @@ namespace Pinetime {
|
||||||
namespace Widgets {
|
namespace Widgets {
|
||||||
class PopupMessage {
|
class PopupMessage {
|
||||||
public:
|
public:
|
||||||
PopupMessage();
|
// The caller owns the message string, it is not copied.
|
||||||
|
PopupMessage(const char* msg, int16_t h, int16_t w);
|
||||||
void Create();
|
void Create();
|
||||||
void SetHidden(bool hidden);
|
void SetHidden(bool hidden);
|
||||||
bool IsHidden();
|
bool IsHidden();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
lv_obj_t* popup = nullptr;
|
const char* message;
|
||||||
|
lv_obj_t* btnPopup = nullptr;
|
||||||
bool isHidden = true;
|
bool isHidden = true;
|
||||||
|
int16_t height;
|
||||||
|
int16_t width;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -419,7 +419,8 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in
|
||||||
LV_FONT_DECLARE(jetbrains_mono_76) \
|
LV_FONT_DECLARE(jetbrains_mono_76) \
|
||||||
LV_FONT_DECLARE(open_sans_light) \
|
LV_FONT_DECLARE(open_sans_light) \
|
||||||
LV_FONT_DECLARE(fontawesome_weathericons) \
|
LV_FONT_DECLARE(fontawesome_weathericons) \
|
||||||
LV_FONT_DECLARE(lv_font_sys_48)
|
LV_FONT_DECLARE(lv_font_sys_48) \
|
||||||
|
LV_FONT_DECLARE(lv_font_sys_80)
|
||||||
|
|
||||||
/* Enable it if you have fonts with a lot of characters.
|
/* Enable it if you have fonts with a lot of characters.
|
||||||
* The limit depends on the font size, font face and bpp
|
* The limit depends on the font size, font face and bpp
|
||||||
|
|
Loading…
Reference in a new issue