mirror of
https://github.com/m5stack/meshtastic-device-ui.git
synced 2026-05-20 11:51:03 -07:00
add latin extended charactrers, toggle memory button
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
|
||||
#include "lvgl.h"
|
||||
|
||||
extern const lv_font_t ui_font_montserrat_14;
|
||||
extern const lv_font_t ui_font_montserrat_16;
|
||||
extern const lv_font_t ui_font_montserrat_12;
|
||||
|
||||
|
||||
#endif /*EEZ_LVGL_UI_FONTS_H*/
|
||||
@@ -16,6 +16,7 @@ void create_screen_boot_screen() {
|
||||
lv_obj_set_size(obj, 320, 240);
|
||||
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xff67ea94), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
{
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
@@ -50,7 +51,6 @@ void create_screen_boot_screen() {
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(obj, "");
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_BOTTOM_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -65,6 +65,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_size(obj, 320, 240);
|
||||
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xff303030), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
{
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
@@ -230,7 +231,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_style_pad_right(obj, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_bottom(obj, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffaafbff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_flex_flow(obj, LV_FLEX_FLOW_ROW_WRAP, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_clip_corner(obj, false, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_pad_left(obj, 5, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -362,7 +363,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_style_bg_image_src(obj, &img_home_memory_button, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_shadow_width(obj, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_shadow_ofs_y(obj, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_image_recolor(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_image_recolor(obj, lv_color_hex(0xff606060), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_image_recolor_opa(obj, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_image_recolor(obj, lv_color_hex(0xff9b9bff), LV_PART_MAIN | LV_STATE_PRESSED);
|
||||
lv_obj_set_style_bg_image_recolor_opa(obj, 255, LV_PART_MAIN | LV_STATE_PRESSED);
|
||||
@@ -455,7 +456,7 @@ void create_screen_main_screen() {
|
||||
lv_label_set_text(obj, " ");
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_BOTTOM_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xfff0f0f0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
{
|
||||
// UserNameShortLabel
|
||||
@@ -467,7 +468,6 @@ void create_screen_main_screen() {
|
||||
lv_label_set_text(obj, " ");
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_BOTTOM_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xfff0f0f0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
{
|
||||
// BatteryLabel
|
||||
@@ -479,7 +479,7 @@ void create_screen_main_screen() {
|
||||
lv_label_set_text(obj, " ");
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_RIGHT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xfff0f0f0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_RIGHT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
{
|
||||
@@ -492,7 +492,7 @@ void create_screen_main_screen() {
|
||||
lv_label_set_text(obj, " ");
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_RIGHT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xfff0f0f0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_RIGHT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
{
|
||||
@@ -505,7 +505,7 @@ void create_screen_main_screen() {
|
||||
lv_label_set_text(obj, " ");
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_RIGHT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xfff0f0f0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_RIGHT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
}
|
||||
@@ -527,7 +527,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_style_flex_cross_place(obj, LV_FLEX_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_flex_track_place(obj, LV_FLEX_ALIGN_CENTER, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_flex_grow(obj, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
{
|
||||
lv_obj_t *parent_obj = obj;
|
||||
{
|
||||
@@ -860,7 +860,6 @@ void create_screen_main_screen() {
|
||||
lv_label_set_text(obj, "ABCD: Username");
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_TOP_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
{
|
||||
// ChatDelButton
|
||||
@@ -1350,7 +1349,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_pos(obj, 25, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(obj, "1 of 1 nodes online");
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffe0e0e0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_LEFT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -1389,7 +1388,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_pos(obj, 25, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(obj, "Group Channels");
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffe0e0e0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_LEFT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -1428,7 +1427,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_pos(obj, 25, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(obj, "no messages");
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffe0e0e0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_LEFT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -1467,7 +1466,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_pos(obj, 25, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(obj, "Settings");
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffe0e0e0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_LEFT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -1506,7 +1505,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_pos(obj, 25, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(obj, "Settings (advanced)");
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffe0e0e0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_LEFT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -1545,7 +1544,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_pos(obj, 25, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(obj, "Locations Map");
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffe0e0e0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_LEFT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -1584,7 +1583,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_pos(obj, 25, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(obj, "no chats");
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffe0e0e0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_LEFT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -1624,7 +1623,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_long_mode(obj, LV_LABEL_LONG_SCROLL);
|
||||
lv_label_set_text(obj, "no messages");
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffe0e0e0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_LEFT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -1674,7 +1673,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_set_pos(obj, -10, 0);
|
||||
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
|
||||
lv_label_set_text(obj, " ");
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffe0e0e0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_RIGHT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
@@ -2238,7 +2237,7 @@ void create_screen_main_screen() {
|
||||
lv_label_set_long_mode(obj, LV_LABEL_LONG_CLIP);
|
||||
lv_label_set_text(obj, "FrequencySlot: 1 (902.0MHz)");
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_TOP_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
{
|
||||
// FrequencySlotSlider
|
||||
@@ -2900,7 +2899,7 @@ void create_screen_main_screen() {
|
||||
lv_obj_clear_flag(obj, LV_OBJ_FLAG_CLICKABLE);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_TOP_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xff1b43db), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffccd1d8), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_max_width(obj, 400, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
|
||||
@@ -2,8 +2,4 @@
|
||||
#include "images.h"
|
||||
#include "fonts.h"
|
||||
|
||||
void apply_style_montserrat16(lv_obj_t *obj) {
|
||||
lv_obj_set_style_text_color(obj, lv_color_hex(0xffaafbff), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_16, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void apply_style_montserrat16(lv_obj_t *obj);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define EEZ_LVGL_UI_GUI_H
|
||||
|
||||
#include "lvgl.h"
|
||||
#include "fonts.h"
|
||||
#include "screens.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -151,6 +151,7 @@ class TFTView_320x240 : public MeshtasticView
|
||||
static void ui_event_ChatButton(lv_event_t *e);
|
||||
static void ui_event_ChatDelButton(lv_event_t *e);
|
||||
static void ui_event_MsgPopupButton(lv_event_t *e);
|
||||
static void ui_event_MemoryButton(lv_event_t *e);
|
||||
static void ui_event_KeyboardButton(lv_event_t *e);
|
||||
static void ui_event_Keyboard(lv_event_t *e);
|
||||
|
||||
|
||||
+5
-5
@@ -401,9 +401,9 @@
|
||||
*https://fonts.google.com/specimen/Montserrat*/
|
||||
#define LV_FONT_MONTSERRAT_8 0
|
||||
#define LV_FONT_MONTSERRAT_10 0
|
||||
#define LV_FONT_MONTSERRAT_12 1 // needed for osd keyboard unless having figured out the missing glyphs
|
||||
#define LV_FONT_MONTSERRAT_14 1
|
||||
#define LV_FONT_MONTSERRAT_16 1
|
||||
#define LV_FONT_MONTSERRAT_12 0
|
||||
#define LV_FONT_MONTSERRAT_14 1 // needed for osd keyboard unless having figured out to add the missing glyphs
|
||||
#define LV_FONT_MONTSERRAT_16 0
|
||||
#define LV_FONT_MONTSERRAT_18 0
|
||||
#define LV_FONT_MONTSERRAT_20 1 // only used for title
|
||||
#define LV_FONT_MONTSERRAT_22 0
|
||||
@@ -433,10 +433,10 @@
|
||||
/*Optionally declare custom fonts here.
|
||||
*You can use these fonts as default font too and they will be available globally.
|
||||
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
|
||||
#define LV_FONT_CUSTOM_DECLARE
|
||||
#define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(ui_font_montserrat_14)
|
||||
|
||||
/*Always set a default font*/
|
||||
#define LV_FONT_DEFAULT &lv_font_montserrat_14
|
||||
#define LV_FONT_DEFAULT &ui_font_montserrat_14
|
||||
|
||||
/*Enable handling large font and/or fonts with a lot of characters.
|
||||
*The limit depends on the font size, font face and bpp.
|
||||
|
||||
+27
-11
@@ -184,6 +184,9 @@ void TFTView_320x240::ui_events_init(void)
|
||||
lv_obj_add_event_cb(objects.map_button, this->ui_event_MapButton, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event_cb(objects.settings_button, this->ui_event_SettingsButton, LV_EVENT_ALL, NULL);
|
||||
|
||||
// home buttons
|
||||
lv_obj_add_event_cb(objects.home_memory_button, this->ui_event_MemoryButton, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
// node and channel buttons
|
||||
lv_obj_add_event_cb(objects.node_button, ui_event_NodeButton, LV_EVENT_ALL, (void *)ownNode);
|
||||
|
||||
@@ -443,6 +446,19 @@ void TFTView_320x240::ui_event_MsgPopupButton(lv_event_t *e)
|
||||
}
|
||||
}
|
||||
|
||||
void TFTView_320x240::ui_event_MemoryButton(lv_event_t *e)
|
||||
{
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
if (event_code == LV_EVENT_CLICKED) {
|
||||
// toggle memory display updates
|
||||
uint32_t toggle = (unsigned long)objects.home_memory_button->user_data;
|
||||
objects.home_memory_button->user_data = (void *)(1 - toggle);
|
||||
lv_obj_set_style_bg_image_recolor(objects.home_memory_button,
|
||||
toggle ? lv_color_hex(0xff606060) : lv_color_hex(0xffffffff),
|
||||
LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
void TFTView_320x240::ui_event_KeyboardButton(lv_event_t *e)
|
||||
{
|
||||
lv_event_code_t event_code = lv_event_get_code(e);
|
||||
@@ -1229,7 +1245,7 @@ void TFTView_320x240::addMessage(uint32_t requestId, char *msg)
|
||||
|
||||
lv_obj_t *textLabel = lv_label_create(hiddenPanel);
|
||||
// calculate expected size of text bubble, to make it look nicer
|
||||
lv_coord_t width = lv_txt_get_width(msg, strlen(msg), &lv_font_montserrat_12, 0);
|
||||
lv_coord_t width = lv_txt_get_width(msg, strlen(msg), &ui_font_montserrat_12, 0);
|
||||
lv_obj_set_width(textLabel, std::max(std::min(width + 20, 200), 40));
|
||||
lv_obj_set_height(textLabel, LV_SIZE_CONTENT);
|
||||
lv_obj_set_y(textLabel, 0);
|
||||
@@ -1243,7 +1259,7 @@ void TFTView_320x240::addMessage(uint32_t requestId, char *msg)
|
||||
lv_obj_set_style_text_color(textLabel, lv_color_hex(0xF0F0F0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
// lv_obj_set_style_text_opa(textLabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(textLabel, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(textLabel, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(textLabel, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(textLabel, 10, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(textLabel, lv_color_hex(0x404040), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
// lv_obj_set_style_bg_opa(textLabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -1326,7 +1342,7 @@ void TFTView_320x240::addNode(uint32_t nodeNum, uint8_t ch, const char *userShor
|
||||
ln_lbl->user_data = (void *)strlen(userLong);
|
||||
lv_obj_set_style_align(ln_lbl, LV_ALIGN_BOTTOM_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_color(ln_lbl, lv_color_hex(0xF0F0F0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ln_lbl, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ln_lbl, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *sn_lbl = lv_label_create(p);
|
||||
lv_obj_set_width(sn_lbl, LV_SIZE_CONTENT);
|
||||
@@ -1348,7 +1364,7 @@ void TFTView_320x240::addNode(uint32_t nodeNum, uint8_t ch, const char *userShor
|
||||
lv_obj_set_style_text_color(ui_BatteryLabel, lv_color_hex(0xF0F0F0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(ui_BatteryLabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(ui_BatteryLabel, LV_TEXT_ALIGN_RIGHT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_BatteryLabel, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_BatteryLabel, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_t *ui_lastHeardLabel = lv_label_create(p);
|
||||
lv_obj_set_width(ui_lastHeardLabel, LV_SIZE_CONTENT);
|
||||
@@ -1376,7 +1392,7 @@ void TFTView_320x240::addNode(uint32_t nodeNum, uint8_t ch, const char *userShor
|
||||
lv_obj_set_style_text_color(ui_lastHeardLabel, lv_color_hex(0xF0F0F0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(ui_lastHeardLabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(ui_lastHeardLabel, LV_TEXT_ALIGN_RIGHT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_lastHeardLabel, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_lastHeardLabel, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
ui_lastHeardLabel->user_data = (void *)lastHeard;
|
||||
|
||||
lv_obj_t *ui_SignalLabel = lv_label_create(p);
|
||||
@@ -1388,7 +1404,7 @@ void TFTView_320x240::addNode(uint32_t nodeNum, uint8_t ch, const char *userShor
|
||||
lv_label_set_text(ui_SignalLabel, "");
|
||||
lv_obj_set_style_text_color(ui_SignalLabel, lv_color_hex(0xFFFFFF), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(ui_SignalLabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_SignalLabel, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(ui_SignalLabel, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
|
||||
lv_obj_add_event_cb(nodeButton, ui_event_NodeButton, LV_EVENT_ALL, (void *)nodeNum);
|
||||
|
||||
@@ -1972,14 +1988,14 @@ void TFTView_320x240::newMessage(uint32_t nodeNum, lv_obj_t *container, uint8_t
|
||||
|
||||
lv_obj_t *msgLabel = lv_label_create(hiddenPanel);
|
||||
// calculate expected size of text bubble, to make it look nicer
|
||||
lv_coord_t width = lv_txt_get_width(msg, strlen(msg), &lv_font_montserrat_12, 0);
|
||||
lv_coord_t width = lv_txt_get_width(msg, strlen(msg), &ui_font_montserrat_12, 0);
|
||||
lv_obj_set_width(msgLabel, std::max(std::min(width + 20, 200), 40));
|
||||
lv_obj_set_height(msgLabel, LV_SIZE_CONTENT); /// 1
|
||||
lv_obj_set_align(msgLabel, LV_ALIGN_LEFT_MID);
|
||||
lv_label_set_text(msgLabel, msg);
|
||||
lv_obj_set_style_text_color(msgLabel, lv_color_hex(0xD0D0D0), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_opa(msgLabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(msgLabel, &lv_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(msgLabel, &ui_font_montserrat_12, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_radius(msgLabel, 10, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_color(msgLabel, lv_color_hex(0x404040), LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_bg_opa(msgLabel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
@@ -2051,7 +2067,7 @@ void TFTView_320x240::addChat(uint32_t from, uint32_t to, uint8_t ch)
|
||||
lv_label_set_text(obj, buf);
|
||||
lv_obj_set_style_align(obj, LV_ALIGN_LEFT_MID, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_align(obj, LV_TEXT_ALIGN_LEFT, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &lv_font_montserrat_14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
lv_obj_set_style_text_font(obj, &ui_font_montserrat_14, LV_PART_MAIN | LV_STATE_DEFAULT);
|
||||
}
|
||||
{
|
||||
// ChatDelButton
|
||||
@@ -2371,8 +2387,8 @@ void TFTView_320x240::updateUnreadMessages(void)
|
||||
|
||||
void TFTView_320x240::updateFreeMem(void)
|
||||
{
|
||||
// only update if HomePanel is active (since this is some critical code that did crash once)
|
||||
if (activePanel == objects.home_panel) {
|
||||
// only update if HomePanel is active (since this is some critical code that did sporadically)
|
||||
if (activePanel == objects.home_panel && (unsigned long)objects.home_memory_button->user_data) {
|
||||
char buf[64];
|
||||
uint32_t freeHeap = 0;
|
||||
uint32_t freeHeap_pct = 100;
|
||||
|
||||
Reference in New Issue
Block a user