mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-08-27 21:20:07 +00:00
Cyrillic and Latin Extended font support (fixes #14)
Regenerated Montserrat 10/12/14 with Cyrillic and Latin Extended Unicode ranges so messages in Russian, Ukrainian, Bulgarian, and accented European languages render properly instead of rectangles.
This commit is contained in:
@@ -3,6 +3,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
// Forward-declare custom ratdeck fonts for LV_FONT_DEFAULT
|
||||
typedef struct _lv_font_t lv_font_t;
|
||||
extern const lv_font_t lv_font_ratdeck_14;
|
||||
|
||||
// Color depth: 16-bit RGB565
|
||||
#define LV_COLOR_DEPTH 16
|
||||
|
||||
@@ -36,13 +40,13 @@
|
||||
#define LV_USE_THEME_DEFAULT 1
|
||||
#define LV_THEME_DEFAULT_DARK 1
|
||||
|
||||
// Fonts - built-in
|
||||
#define LV_FONT_MONTSERRAT_10 1
|
||||
#define LV_FONT_MONTSERRAT_12 1
|
||||
#define LV_FONT_MONTSERRAT_14 1
|
||||
// Fonts - built-in (only 16 still used for titles; 10/12/14 replaced by custom ratdeck fonts)
|
||||
#define LV_FONT_MONTSERRAT_10 0
|
||||
#define LV_FONT_MONTSERRAT_12 0
|
||||
#define LV_FONT_MONTSERRAT_14 0
|
||||
#define LV_FONT_MONTSERRAT_16 1
|
||||
#define LV_FONT_UNSCII_8 0
|
||||
#define LV_FONT_DEFAULT &lv_font_montserrat_14
|
||||
#define LV_FONT_DEFAULT &lv_font_ratdeck_14
|
||||
|
||||
// Widgets
|
||||
#define LV_USE_LABEL 1
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
// Custom Montserrat fonts with extended Unicode ranges:
|
||||
// ASCII (0x20-0x7F), Latin-1 Supplement (0xA0-0xFF),
|
||||
// Latin Extended-A (0x100-0x17F), Cyrillic (0x400-0x4FF)
|
||||
//
|
||||
// Generated with lv_font_conv from Montserrat-Medium.ttf (OFL license)
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
LV_FONT_DECLARE(lv_font_ratdeck_10)
|
||||
LV_FONT_DECLARE(lv_font_ratdeck_12)
|
||||
LV_FONT_DECLARE(lv_font_ratdeck_14)
|
||||
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
@@ -2,6 +2,7 @@
|
||||
#include "Theme.h"
|
||||
#include <Arduino.h>
|
||||
#include <time.h>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvStatusBar::create(lv_obj_t* parent) {
|
||||
_bar = lv_obj_create(parent);
|
||||
@@ -16,7 +17,7 @@ void LvStatusBar::create(lv_obj_t* parent) {
|
||||
lv_obj_set_style_radius(_bar, 0, 0);
|
||||
lv_obj_clear_flag(_bar, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
const lv_font_t* font = &lv_font_montserrat_12;
|
||||
const lv_font_t* font = &lv_font_ratdeck_12;
|
||||
|
||||
// Left: Time display (hidden until valid time is available)
|
||||
_lblTime = lv_label_create(_bar);
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
#include "LvTabBar.h"
|
||||
#include "Theme.h"
|
||||
#include <cstdio>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
constexpr const char* LvTabBar::TAB_NAMES[TAB_COUNT];
|
||||
|
||||
@@ -33,7 +34,7 @@ void LvTabBar::create(lv_obj_t* parent) {
|
||||
lv_obj_set_flex_flow(_bar, LV_FLEX_FLOW_ROW);
|
||||
lv_obj_set_flex_align(_bar, LV_FLEX_ALIGN_SPACE_EVENLY, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_CENTER);
|
||||
|
||||
const lv_font_t* font = &lv_font_montserrat_12;
|
||||
const lv_font_t* font = &lv_font_ratdeck_12;
|
||||
|
||||
for (int i = 0; i < TAB_COUNT; i++) {
|
||||
_tabs[i] = lv_label_create(_bar);
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
#include "LvTheme.h"
|
||||
#include "Theme.h"
|
||||
#include <Arduino.h>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
namespace LvTheme {
|
||||
|
||||
@@ -27,7 +28,7 @@ void init(lv_disp_t* disp) {
|
||||
lv_style_set_bg_color(&s_screen, lv_color_hex(Theme::BG));
|
||||
lv_style_set_bg_opa(&s_screen, LV_OPA_COVER);
|
||||
lv_style_set_text_color(&s_screen, lv_color_hex(Theme::PRIMARY));
|
||||
lv_style_set_text_font(&s_screen, &lv_font_montserrat_14);
|
||||
lv_style_set_text_font(&s_screen, &lv_font_ratdeck_14);
|
||||
|
||||
// Labels
|
||||
lv_style_init(&s_label);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "ui/Theme.h"
|
||||
#include "ui/LvTheme.h"
|
||||
#include "config/Config.h"
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvBootScreen::createUI(lv_obj_t* parent) {
|
||||
_screen = parent;
|
||||
@@ -18,7 +19,7 @@ void LvBootScreen::createUI(lv_obj_t* parent) {
|
||||
|
||||
// Version
|
||||
_lblVersion = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(_lblVersion, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(_lblVersion, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(_lblVersion, lv_color_hex(Theme::SECONDARY), 0);
|
||||
char ver[32];
|
||||
snprintf(ver, sizeof(ver), "v%s", RATDECK_VERSION_STRING);
|
||||
@@ -36,7 +37,7 @@ void LvBootScreen::createUI(lv_obj_t* parent) {
|
||||
|
||||
// Status text
|
||||
_lblStatus = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(_lblStatus, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(_lblStatus, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(_lblStatus, lv_color_hex(Theme::SECONDARY), 0);
|
||||
lv_label_set_text(_lblStatus, "Starting...");
|
||||
lv_obj_align(_lblStatus, LV_ALIGN_TOP_MID, 0, 128);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include "ui/UIManager.h"
|
||||
#include "reticulum/AnnounceManager.h"
|
||||
#include <Arduino.h>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvContactsScreen::createUI(lv_obj_t* parent) {
|
||||
_screen = parent;
|
||||
@@ -10,7 +11,7 @@ void LvContactsScreen::createUI(lv_obj_t* parent) {
|
||||
lv_obj_set_style_pad_all(parent, 0, 0);
|
||||
|
||||
_lblEmpty = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(_lblEmpty, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(_lblEmpty, &lv_font_ratdeck_14, 0);
|
||||
lv_obj_set_style_text_color(_lblEmpty, lv_color_hex(Theme::MUTED), 0);
|
||||
lv_label_set_text(_lblEmpty, "No saved contacts");
|
||||
lv_obj_center(_lblEmpty);
|
||||
@@ -29,7 +30,7 @@ void LvContactsScreen::createUI(lv_obj_t* parent) {
|
||||
lv_obj_set_flex_flow(_list, LV_FLEX_FLOW_COLUMN);
|
||||
|
||||
// Pre-allocate row pool
|
||||
const lv_font_t* font = &lv_font_montserrat_14;
|
||||
const lv_font_t* font = &lv_font_ratdeck_14;
|
||||
for (int i = 0; i < ROW_POOL_SIZE; i++) {
|
||||
lv_obj_t* row = lv_obj_create(_list);
|
||||
lv_obj_set_size(row, Theme::CONTENT_W, 28);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "ui/Theme.h"
|
||||
#include "ui/LvTheme.h"
|
||||
#include "config/Config.h"
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvDataCleanScreen::createUI(lv_obj_t* parent) {
|
||||
_screen = parent;
|
||||
@@ -17,34 +18,34 @@ void LvDataCleanScreen::createUI(lv_obj_t* parent) {
|
||||
|
||||
// Subtitle
|
||||
lv_obj_t* sub = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(sub, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(sub, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(sub, lv_color_hex(Theme::ACCENT), 0);
|
||||
lv_label_set_text(sub, "ratspeak.org");
|
||||
lv_obj_align(sub, LV_ALIGN_TOP_MID, 0, 42);
|
||||
|
||||
// Message
|
||||
lv_obj_t* msg = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(msg, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(msg, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(msg, lv_color_hex(Theme::SECONDARY), 0);
|
||||
lv_label_set_text(msg, "Old data found on SD card.");
|
||||
lv_obj_align(msg, LV_ALIGN_TOP_MID, 0, 75);
|
||||
|
||||
// Prompt
|
||||
lv_obj_t* prompt = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(prompt, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(prompt, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(prompt, lv_color_hex(Theme::SECONDARY), 0);
|
||||
lv_label_set_text(prompt, "Remove old data and start fresh?");
|
||||
lv_obj_align(prompt, LV_ALIGN_TOP_MID, 0, 95);
|
||||
|
||||
// Yes label
|
||||
_yesLabel = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(_yesLabel, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(_yesLabel, &lv_font_ratdeck_14, 0);
|
||||
lv_label_set_text(_yesLabel, "[ Yes ]");
|
||||
lv_obj_align(_yesLabel, LV_ALIGN_TOP_MID, -50, 135);
|
||||
|
||||
// No label
|
||||
_noLabel = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(_noLabel, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(_noLabel, &lv_font_ratdeck_14, 0);
|
||||
lv_label_set_text(_noLabel, "[ No ]");
|
||||
lv_obj_align(_noLabel, LV_ALIGN_TOP_MID, 50, 135);
|
||||
|
||||
@@ -52,14 +53,14 @@ void LvDataCleanScreen::createUI(lv_obj_t* parent) {
|
||||
|
||||
// Hint
|
||||
_hintLabel = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(_hintLabel, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(_hintLabel, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(_hintLabel, lv_color_hex(Theme::ACCENT), 0);
|
||||
lv_label_set_text(_hintLabel, "[</>] Select [Enter] OK");
|
||||
lv_obj_align(_hintLabel, LV_ALIGN_TOP_MID, 0, 165);
|
||||
|
||||
// Status label (hidden until showStatus is called)
|
||||
_statusLabel = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(_statusLabel, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(_statusLabel, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(_statusLabel, lv_color_hex(Theme::PRIMARY), 0);
|
||||
lv_label_set_text(_statusLabel, "");
|
||||
lv_obj_align(_statusLabel, LV_ALIGN_TOP_MID, 0, 140);
|
||||
@@ -67,7 +68,7 @@ void LvDataCleanScreen::createUI(lv_obj_t* parent) {
|
||||
|
||||
// Version
|
||||
lv_obj_t* ver = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(ver, &lv_font_montserrat_10, 0);
|
||||
lv_obj_set_style_text_font(ver, &lv_font_ratdeck_10, 0);
|
||||
lv_obj_set_style_text_color(ver, lv_color_hex(Theme::MUTED), 0);
|
||||
char verBuf[32];
|
||||
snprintf(verBuf, sizeof(verBuf), "v%s", RATDECK_VERSION_STRING);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "LvHelpOverlay.h"
|
||||
#include "ui/Theme.h"
|
||||
#include <lvgl.h>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvHelpOverlay::create() {
|
||||
_overlay = lv_obj_create(lv_layer_top());
|
||||
@@ -16,7 +17,7 @@ void LvHelpOverlay::create() {
|
||||
lv_obj_set_layout(_overlay, LV_LAYOUT_FLEX);
|
||||
lv_obj_set_flex_flow(_overlay, LV_FLEX_FLOW_COLUMN);
|
||||
|
||||
const lv_font_t* font = &lv_font_montserrat_12;
|
||||
const lv_font_t* font = &lv_font_ratdeck_12;
|
||||
|
||||
auto mkLabel = [&](const char* text, uint32_t color) {
|
||||
lv_obj_t* lbl = lv_label_create(_overlay);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "transport/TCPClientInterface.h"
|
||||
#include <Arduino.h>
|
||||
#include <WiFi.h>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvHomeScreen::createUI(lv_obj_t* parent) {
|
||||
_screen = parent;
|
||||
@@ -17,7 +18,7 @@ void LvHomeScreen::createUI(lv_obj_t* parent) {
|
||||
lv_obj_set_style_pad_row(parent, 4, 0);
|
||||
lv_obj_clear_flag(parent, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
const lv_font_t* font = &lv_font_montserrat_14;
|
||||
const lv_font_t* font = &lv_font_ratdeck_14;
|
||||
auto mkLabel = [&](const char* initial) -> lv_obj_t* {
|
||||
lv_obj_t* lbl = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(lbl, font, 0);
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
#include "LvMapScreen.h"
|
||||
#include "ui/Theme.h"
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvMapScreen::createUI(lv_obj_t* parent) {
|
||||
_screen = parent;
|
||||
lv_obj_clear_flag(parent, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
lv_obj_t* lbl = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(lbl, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(lbl, &lv_font_ratdeck_14, 0);
|
||||
lv_obj_set_style_text_color(lbl, lv_color_hex(Theme::MUTED), 0);
|
||||
lv_label_set_text(lbl, "Map\n\nComing soon\n\nNode topology view\nwill appear here");
|
||||
lv_obj_set_style_text_align(lbl, LV_TEXT_ALIGN_CENTER, 0);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "reticulum/AnnounceManager.h"
|
||||
#include <Arduino.h>
|
||||
#include <time.h>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
std::string LvMessageView::getPeerName() {
|
||||
if (_am) {
|
||||
@@ -26,7 +27,7 @@ void LvMessageView::createUI(lv_obj_t* parent) {
|
||||
lv_obj_set_flex_flow(parent, LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_style_pad_row(parent, 0, 0);
|
||||
|
||||
const lv_font_t* font = &lv_font_montserrat_12;
|
||||
const lv_font_t* font = &lv_font_ratdeck_12;
|
||||
int headerH = 22;
|
||||
int inputH = 28;
|
||||
|
||||
@@ -43,7 +44,7 @@ void LvMessageView::createUI(lv_obj_t* parent) {
|
||||
lv_obj_clear_flag(_header, LV_OBJ_FLAG_SCROLLABLE);
|
||||
|
||||
_lblHeader = lv_label_create(_header);
|
||||
lv_obj_set_style_text_font(_lblHeader, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(_lblHeader, &lv_font_ratdeck_14, 0);
|
||||
lv_obj_set_style_text_color(_lblHeader, lv_color_hex(Theme::ACCENT), 0);
|
||||
lv_obj_align(_lblHeader, LV_ALIGN_LEFT_MID, 4, 0);
|
||||
|
||||
@@ -90,7 +91,7 @@ void LvMessageView::createUI(lv_obj_t* parent) {
|
||||
lv_obj_set_style_radius(_btnSend, 3, 0);
|
||||
lv_obj_set_style_pad_all(_btnSend, 0, 0);
|
||||
lv_obj_t* sendLbl = lv_label_create(_btnSend);
|
||||
lv_obj_set_style_text_font(sendLbl, &lv_font_montserrat_10, 0);
|
||||
lv_obj_set_style_text_font(sendLbl, &lv_font_ratdeck_10, 0);
|
||||
lv_obj_set_style_text_color(sendLbl, lv_color_hex(Theme::PRIMARY), 0);
|
||||
lv_label_set_text(sendLbl, "Send");
|
||||
lv_obj_center(sendLbl);
|
||||
@@ -183,7 +184,7 @@ void LvMessageView::refreshUI() {
|
||||
void LvMessageView::appendMessage(const LXMFMessage& msg) {
|
||||
if (!_msgScroll) return;
|
||||
|
||||
const lv_font_t* font = &lv_font_montserrat_12;
|
||||
const lv_font_t* font = &lv_font_ratdeck_12;
|
||||
int maxBubbleW = Theme::CONTENT_W * 3 / 4;
|
||||
|
||||
// Bubble container
|
||||
@@ -246,7 +247,7 @@ void LvMessageView::appendMessage(const LXMFMessage& msg) {
|
||||
ind = "!"; indColor = Theme::ERROR_CLR;
|
||||
}
|
||||
lv_obj_t* statusLbl = lv_label_create(box);
|
||||
lv_obj_set_style_text_font(statusLbl, &lv_font_montserrat_10, 0);
|
||||
lv_obj_set_style_text_font(statusLbl, &lv_font_ratdeck_10, 0);
|
||||
lv_obj_set_style_text_color(statusLbl, lv_color_hex(indColor), 0);
|
||||
lv_label_set_text(statusLbl, ind);
|
||||
lv_obj_align(statusLbl, LV_ALIGN_BOTTOM_RIGHT, 0, 0);
|
||||
@@ -265,7 +266,7 @@ void LvMessageView::appendMessage(const LXMFMessage& msg) {
|
||||
char timeBuf[8];
|
||||
snprintf(timeBuf, sizeof(timeBuf), "%02d:%02d", tm->tm_hour, tm->tm_min);
|
||||
lv_obj_t* timeLbl = lv_label_create(bubble);
|
||||
lv_obj_set_style_text_font(timeLbl, &lv_font_montserrat_10, 0);
|
||||
lv_obj_set_style_text_font(timeLbl, &lv_font_ratdeck_10, 0);
|
||||
lv_obj_set_style_text_color(timeLbl, lv_color_hex(Theme::MUTED), 0);
|
||||
lv_label_set_text(timeLbl, timeBuf);
|
||||
if (msg.incoming) {
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include <Arduino.h>
|
||||
#include <time.h>
|
||||
#include <algorithm>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvMessagesScreen::createUI(lv_obj_t* parent) {
|
||||
_screen = parent;
|
||||
@@ -14,7 +15,7 @@ void LvMessagesScreen::createUI(lv_obj_t* parent) {
|
||||
lv_obj_set_style_pad_all(parent, 0, 0);
|
||||
|
||||
_lblEmpty = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(_lblEmpty, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(_lblEmpty, &lv_font_ratdeck_14, 0);
|
||||
lv_obj_set_style_text_color(_lblEmpty, lv_color_hex(Theme::MUTED), 0);
|
||||
lv_label_set_text(_lblEmpty, "No conversations");
|
||||
lv_obj_center(_lblEmpty);
|
||||
@@ -33,8 +34,8 @@ void LvMessagesScreen::createUI(lv_obj_t* parent) {
|
||||
lv_obj_set_flex_flow(_list, LV_FLEX_FLOW_COLUMN);
|
||||
|
||||
// Pre-allocate row pool (following LvNodesScreen pattern)
|
||||
const lv_font_t* nameFont = &lv_font_montserrat_14;
|
||||
const lv_font_t* smallFont = &lv_font_montserrat_12;
|
||||
const lv_font_t* nameFont = &lv_font_ratdeck_14;
|
||||
const lv_font_t* smallFont = &lv_font_ratdeck_12;
|
||||
|
||||
for (int i = 0; i < ROW_POOL_SIZE; i++) {
|
||||
lv_obj_t* row = lv_obj_create(_list);
|
||||
@@ -69,7 +70,7 @@ void LvMessagesScreen::createUI(lv_obj_t* parent) {
|
||||
|
||||
// Time label (line 1, right)
|
||||
lv_obj_t* timeLbl = lv_label_create(row);
|
||||
lv_obj_set_style_text_font(timeLbl, &lv_font_montserrat_10, 0);
|
||||
lv_obj_set_style_text_font(timeLbl, &lv_font_ratdeck_10, 0);
|
||||
lv_obj_set_style_text_color(timeLbl, lv_color_hex(Theme::MUTED), 0);
|
||||
lv_label_set_text(timeLbl, "");
|
||||
lv_obj_align(timeLbl, LV_ALIGN_TOP_RIGHT, -4, 4);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "ui/Theme.h"
|
||||
#include "ui/LvTheme.h"
|
||||
#include "config/Config.h"
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvNameInputScreen::createUI(lv_obj_t* parent) {
|
||||
_screen = parent;
|
||||
@@ -17,14 +18,14 @@ void LvNameInputScreen::createUI(lv_obj_t* parent) {
|
||||
|
||||
// Subtitle
|
||||
lv_obj_t* sub = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(sub, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(sub, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(sub, lv_color_hex(Theme::ACCENT), 0);
|
||||
lv_label_set_text(sub, "ratspeak.org");
|
||||
lv_obj_align(sub, LV_ALIGN_TOP_MID, 0, 42);
|
||||
|
||||
// Prompt
|
||||
lv_obj_t* prompt = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(prompt, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(prompt, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(prompt, lv_color_hex(Theme::SECONDARY), 0);
|
||||
lv_label_set_text(prompt, "Enter your display name:");
|
||||
lv_obj_align(prompt, LV_ALIGN_TOP_MID, 0, 70);
|
||||
@@ -37,18 +38,18 @@ void LvNameInputScreen::createUI(lv_obj_t* parent) {
|
||||
lv_textarea_set_one_line(_textarea, true);
|
||||
lv_textarea_set_placeholder_text(_textarea, "Optional");
|
||||
lv_obj_add_style(_textarea, LvTheme::styleTextarea(), 0);
|
||||
lv_obj_set_style_text_font(_textarea, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(_textarea, &lv_font_ratdeck_14, 0);
|
||||
|
||||
// Hint
|
||||
lv_obj_t* hint = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(hint, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(hint, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(hint, lv_color_hex(Theme::ACCENT), 0);
|
||||
lv_label_set_text(hint, "[Enter] OK");
|
||||
lv_obj_align(hint, LV_ALIGN_TOP_MID, 0, 140);
|
||||
|
||||
// Version
|
||||
lv_obj_t* ver = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(ver, &lv_font_montserrat_10, 0);
|
||||
lv_obj_set_style_text_font(ver, &lv_font_ratdeck_10, 0);
|
||||
lv_obj_set_style_text_color(ver, lv_color_hex(Theme::MUTED), 0);
|
||||
char verBuf[32];
|
||||
snprintf(verBuf, sizeof(verBuf), "v%s", RATDECK_VERSION_STRING);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "config/UserConfig.h"
|
||||
#include <Arduino.h>
|
||||
#include <algorithm>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvNodesScreen::createUI(lv_obj_t* parent) {
|
||||
_screen = parent;
|
||||
@@ -14,7 +15,7 @@ void LvNodesScreen::createUI(lv_obj_t* parent) {
|
||||
|
||||
// Empty state label
|
||||
_lblEmpty = lv_label_create(parent);
|
||||
lv_obj_set_style_text_font(_lblEmpty, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(_lblEmpty, &lv_font_ratdeck_14, 0);
|
||||
lv_obj_set_style_text_color(_lblEmpty, lv_color_hex(Theme::MUTED), 0);
|
||||
lv_label_set_text(_lblEmpty, "No nodes discovered");
|
||||
lv_obj_center(_lblEmpty);
|
||||
@@ -34,8 +35,8 @@ void LvNodesScreen::createUI(lv_obj_t* parent) {
|
||||
lv_obj_set_flex_flow(_list, LV_FLEX_FLOW_COLUMN);
|
||||
|
||||
// Pre-allocate ROW_POOL_SIZE row widgets
|
||||
const lv_font_t* font = &lv_font_montserrat_14;
|
||||
const lv_font_t* smallFont = &lv_font_montserrat_10;
|
||||
const lv_font_t* font = &lv_font_ratdeck_14;
|
||||
const lv_font_t* smallFont = &lv_font_ratdeck_10;
|
||||
|
||||
for (int i = 0; i < ROW_POOL_SIZE; i++) {
|
||||
lv_obj_t* row = lv_obj_create(_list);
|
||||
@@ -90,7 +91,7 @@ void LvNodesScreen::createUI(lv_obj_t* parent) {
|
||||
const char* menuText[] = {"Add Contact", "Message", "Back"};
|
||||
for (int i = 0; i < 3; i++) {
|
||||
_menuLabels[i] = lv_label_create(_overlay);
|
||||
lv_obj_set_style_text_font(_menuLabels[i], &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(_menuLabels[i], &lv_font_ratdeck_14, 0);
|
||||
lv_obj_set_style_text_color(_menuLabels[i], lv_color_hex(Theme::PRIMARY), 0);
|
||||
lv_label_set_text(_menuLabels[i], menuText[i]);
|
||||
}
|
||||
@@ -109,17 +110,17 @@ void LvNodesScreen::createUI(lv_obj_t* parent) {
|
||||
lv_obj_add_flag(_nicknameBox, LV_OBJ_FLAG_HIDDEN);
|
||||
|
||||
lv_obj_t* nickTitle = lv_label_create(_nicknameBox);
|
||||
lv_obj_set_style_text_font(nickTitle, &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(nickTitle, &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(nickTitle, lv_color_hex(Theme::ACCENT), 0);
|
||||
lv_label_set_text(nickTitle, "Enter nickname:");
|
||||
|
||||
_nicknameLbl = lv_label_create(_nicknameBox);
|
||||
lv_obj_set_style_text_font(_nicknameLbl, &lv_font_montserrat_14, 0);
|
||||
lv_obj_set_style_text_font(_nicknameLbl, &lv_font_ratdeck_14, 0);
|
||||
lv_obj_set_style_text_color(_nicknameLbl, lv_color_hex(Theme::PRIMARY), 0);
|
||||
lv_label_set_text(_nicknameLbl, "_");
|
||||
|
||||
_nicknameHint = lv_label_create(_nicknameBox);
|
||||
lv_obj_set_style_text_font(_nicknameHint, &lv_font_montserrat_10, 0);
|
||||
lv_obj_set_style_text_font(_nicknameHint, &lv_font_ratdeck_10, 0);
|
||||
lv_obj_set_style_text_color(_nicknameHint, lv_color_hex(Theme::MUTED), 0);
|
||||
lv_label_set_text(_nicknameHint, "Enter=Save Esc=Cancel");
|
||||
}
|
||||
@@ -261,7 +262,7 @@ void LvNodesScreen::syncVisibleRows() {
|
||||
lv_obj_set_style_border_width(_poolRows[i], 1, 0);
|
||||
lv_obj_set_style_border_color(_poolRows[i], lv_color_hex(Theme::BORDER), 0);
|
||||
lv_obj_set_style_border_side(_poolRows[i], LV_BORDER_SIDE_BOTTOM, 0);
|
||||
lv_obj_set_style_text_font(_poolNameLabels[i], &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(_poolNameLabels[i], &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(_poolNameLabels[i], lv_color_hex(Theme::ACCENT), 0);
|
||||
lv_label_set_text(_poolNameLabels[i], buf);
|
||||
lv_obj_align(_poolNameLabels[i], LV_ALIGN_LEFT_MID, 4, 0);
|
||||
@@ -287,7 +288,7 @@ void LvNodesScreen::syncVisibleRows() {
|
||||
std::string displayHash = node.hash.toHex().substr(0, 12);
|
||||
char buf[64];
|
||||
snprintf(buf, sizeof(buf), "%s [%s]", truncName.c_str(), displayHash.c_str());
|
||||
lv_obj_set_style_text_font(_poolNameLabels[i], &lv_font_montserrat_12, 0);
|
||||
lv_obj_set_style_text_font(_poolNameLabels[i], &lv_font_ratdeck_12, 0);
|
||||
lv_obj_set_style_text_color(_poolNameLabels[i], lv_color_hex(
|
||||
node.saved ? Theme::ACCENT : Theme::PRIMARY), 0);
|
||||
lv_label_set_text(_poolNameLabels[i], buf);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <WiFi.h>
|
||||
#include <HTTPClient.h>
|
||||
#include <ArduinoJson.h>
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
struct RadioPresetLv {
|
||||
const char* name;
|
||||
@@ -701,7 +702,7 @@ void LvSettingsScreen::rebuildCategoryList() {
|
||||
_rowObjs.clear();
|
||||
lv_obj_clean(_scrollContainer);
|
||||
|
||||
const lv_font_t* font = &lv_font_montserrat_12;
|
||||
const lv_font_t* font = &lv_font_ratdeck_12;
|
||||
|
||||
// Title
|
||||
lv_obj_t* titleRow = lv_obj_create(_scrollContainer);
|
||||
@@ -744,7 +745,7 @@ void LvSettingsScreen::rebuildCategoryList() {
|
||||
// Summary
|
||||
if (cat.summary) {
|
||||
lv_obj_t* sumLbl = lv_label_create(row);
|
||||
lv_obj_set_style_text_font(sumLbl, &lv_font_montserrat_10, 0);
|
||||
lv_obj_set_style_text_font(sumLbl, &lv_font_ratdeck_10, 0);
|
||||
lv_obj_set_style_text_color(sumLbl, lv_color_hex(Theme::MUTED), 0);
|
||||
lv_label_set_text(sumLbl, cat.summary().c_str());
|
||||
lv_obj_align(sumLbl, LV_ALIGN_BOTTOM_LEFT, 20, -2);
|
||||
@@ -766,7 +767,7 @@ void LvSettingsScreen::rebuildItemList() {
|
||||
_rowObjs.clear();
|
||||
lv_obj_clean(_scrollContainer);
|
||||
|
||||
const lv_font_t* font = &lv_font_montserrat_12;
|
||||
const lv_font_t* font = &lv_font_ratdeck_12;
|
||||
|
||||
// Category header
|
||||
lv_obj_t* headerRow = lv_obj_create(_scrollContainer);
|
||||
@@ -876,7 +877,7 @@ void LvSettingsScreen::rebuildWifiList() {
|
||||
_rowObjs.clear();
|
||||
lv_obj_clean(_scrollContainer);
|
||||
|
||||
const lv_font_t* font = &lv_font_montserrat_12;
|
||||
const lv_font_t* font = &lv_font_ratdeck_12;
|
||||
|
||||
// Header
|
||||
lv_obj_t* headerRow = lv_obj_create(_scrollContainer);
|
||||
@@ -928,7 +929,7 @@ void LvSettingsScreen::rebuildWifiList() {
|
||||
char sigBuf[12];
|
||||
snprintf(sigBuf, sizeof(sigBuf), "%ddBm", net.rssi);
|
||||
lv_obj_t* sigLbl = lv_label_create(row);
|
||||
lv_obj_set_style_text_font(sigLbl, &lv_font_montserrat_10, 0);
|
||||
lv_obj_set_style_text_font(sigLbl, &lv_font_ratdeck_10, 0);
|
||||
lv_obj_set_style_text_color(sigLbl, lv_color_hex(Theme::MUTED), 0);
|
||||
lv_label_set_text(sigLbl, sigBuf);
|
||||
lv_obj_align(sigLbl, LV_ALIGN_RIGHT_MID, -4, 0);
|
||||
|
||||
@@ -2,14 +2,15 @@
|
||||
#include "ui/Theme.h"
|
||||
#include "ui/LvTheme.h"
|
||||
#include "config/Config.h"
|
||||
#include "fonts/fonts.h"
|
||||
|
||||
void LvTimezoneScreen::createUI(lv_obj_t* parent) {
|
||||
_screen = parent;
|
||||
lv_obj_clear_flag(parent, LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_set_style_bg_color(parent, lv_color_hex(Theme::BG), 0);
|
||||
|
||||
const lv_font_t* font12 = &lv_font_montserrat_12;
|
||||
const lv_font_t* font14 = &lv_font_montserrat_14;
|
||||
const lv_font_t* font12 = &lv_font_ratdeck_12;
|
||||
const lv_font_t* font14 = &lv_font_ratdeck_14;
|
||||
|
||||
// Title
|
||||
lv_obj_t* title = lv_label_create(parent);
|
||||
@@ -94,8 +95,8 @@ void LvTimezoneScreen::updateSelection(int oldIdx, int newIdx) {
|
||||
if (!_scrollContainer) return;
|
||||
uint32_t count = lv_obj_get_child_cnt(_scrollContainer);
|
||||
|
||||
const lv_font_t* font14 = &lv_font_montserrat_14;
|
||||
const lv_font_t* font12 = &lv_font_montserrat_12;
|
||||
const lv_font_t* font14 = &lv_font_ratdeck_14;
|
||||
const lv_font_t* font12 = &lv_font_ratdeck_12;
|
||||
|
||||
// Deselect old
|
||||
if (oldIdx >= 0 && oldIdx < (int)count) {
|
||||
|
||||
Reference in New Issue
Block a user