mirror of
https://github.com/ALLFATHER-BV/wadamesh.git
synced 2026-11-23 04:39:32 +00:00
Tanmatsu: larger nav icons, F-key hints beside buttons, repeater admin layout (#861)
- Tab bar: 24 px icons (was 16) with a small 14 px F-key outline beside each, instead of a large shape drawn around it; same on the Condense Nav rail. Adds person_font24 for the Contacts icon. - Chat composer: the Quick Replies and Emoji F-key shapes sit beside their buttons instead of over them; the Quick Replies icon is 24 px (ui_icons_24) and Send matches the other chips. The text box narrows to fit. - Repeater admin (two-column landscape): cards go under the shorter column, so a tall card beside a short one leaves no gap; a single column is centred. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
1 parent
a33e77add0
commit
a6233fe8d8
5 files changed
+2287
-42
No files matched your search
@@ -426,6 +426,8 @@ generate_fallback_icons() {
|
||||
local name=$1
|
||||
local size=$2
|
||||
local set=$3
|
||||
local guard_expr=${4:-}
|
||||
local guard_label=${5:-$guard_expr}
|
||||
local raw="$work_dir/${name}.c"
|
||||
local output="$stage/src/ui-touch/${name}.c"
|
||||
local text_raw="$work_dir/${name}_text.c"
|
||||
@@ -443,7 +445,7 @@ generate_fallback_icons() {
|
||||
--lv-font-name "$name" -o "$raw"
|
||||
# shellcheck disable=SC2086
|
||||
python3 "$lucide_py" patch "$raw" "$icons" $metrics
|
||||
normalise "$raw" "$output" "Lucide 1.52.0 (${set} icons)"
|
||||
normalise "$raw" "$output" "Lucide 1.52.0 (${set} icons)" "$guard_expr" "$guard_label"
|
||||
}
|
||||
|
||||
# Which boards carry which size is decided here, on board macros, and not in
|
||||
@@ -471,9 +473,13 @@ done
|
||||
generate_badge 11
|
||||
generate_icons 16
|
||||
generate_icons 20
|
||||
# The Tanmatsu chat composer's quick-reply and send icons, sized to match its 24 px tab bar.
|
||||
generate_icons 24 "defined(HAS_TANMATSU) || defined(DOC_CAPTURE)"
|
||||
python3 "$lucide_py" header "$lucide_cp" > "$stage/src/ui-touch/ui_icons.h"
|
||||
generate_fallback_icons person_font 16 person
|
||||
generate_fallback_icons person_font14 14 person
|
||||
# The Tanmatsu tab bar's Contacts icon, beside the 24 px Montserrat LV_SYMBOLs.
|
||||
generate_fallback_icons person_font24 24 person "$ui_big"
|
||||
generate_fallback_icons zoom_font 16 zoom
|
||||
generate_fallback_icons sleepicons_font 16 sleep
|
||||
generate_fallback_icons cc_icons_16 16 cc
|
||||
@@ -528,9 +534,11 @@ files=(
|
||||
src/ui-touch/ui_badge_11.c
|
||||
src/ui-touch/ui_icons_16.c
|
||||
src/ui-touch/ui_icons_20.c
|
||||
src/ui-touch/ui_icons_24.c
|
||||
src/ui-touch/ui_icons.h
|
||||
src/ui-touch/person_font.c
|
||||
src/ui-touch/person_font14.c
|
||||
src/ui-touch/person_font24.c
|
||||
src/ui-touch/zoom_font.c
|
||||
src/ui-touch/sleepicons_font.c
|
||||
src/ui-touch/cc_icons_16.c
|
||||
|
||||
@@ -183,6 +183,7 @@ RaState* s_ra = nullptr;
|
||||
|
||||
lv_obj_t* s_ra_root = nullptr; // the app page (lv_layer_top, under the bar)
|
||||
lv_obj_t* s_ra_page = nullptr; // the scrolling content of the current view
|
||||
lv_obj_t* s_ra_col[2] = {nullptr, nullptr}; // two-column landscape: the page's columns
|
||||
lv_obj_t* s_ra_edit_root = nullptr; // the edit sheet (popup)
|
||||
lv_obj_t* s_ra_edit_ta = nullptr;
|
||||
lv_obj_t* s_ra_edit_choice = nullptr;
|
||||
@@ -585,8 +586,15 @@ lv_coord_t raColW() {
|
||||
return raTwoCol() ? (sw - 34) / 2 : sw - 22;
|
||||
}
|
||||
// A card under a section name, s_settings_content_w set for the kit's rows.
|
||||
// In two columns each card goes under the shorter column (masonry), so a tall card
|
||||
// beside a short one leaves no hole the height of the tall one.
|
||||
lv_obj_t* raCardParent() {
|
||||
if (!s_ra_col[0] || !s_ra_col[1]) return s_ra_page;
|
||||
lv_obj_update_layout(s_ra_page);
|
||||
return lv_obj_get_height(s_ra_col[1]) < lv_obj_get_height(s_ra_col[0]) ? s_ra_col[1] : s_ra_col[0];
|
||||
}
|
||||
lv_obj_t* raCard(const char* title_tr) {
|
||||
lv_obj_t* c = settingsCardIn(s_ra_page, title_tr ? title_tr : "");
|
||||
lv_obj_t* c = settingsCardIn(raCardParent(), title_tr ? title_tr : "");
|
||||
lv_obj_t* wrap = lv_obj_get_parent(lv_obj_get_parent(c));
|
||||
const lv_coord_t w = raColW();
|
||||
lv_obj_set_width(wrap, w);
|
||||
@@ -630,6 +638,7 @@ void raNewPage() {
|
||||
lv_obj_del_async(s_ra_page);
|
||||
s_ra_page = nullptr;
|
||||
}
|
||||
s_ra_col[0] = s_ra_col[1] = nullptr;
|
||||
const lv_coord_t sw = lv_disp_get_hor_res(nullptr);
|
||||
s_ra_page = lv_obj_create(s_ra_root);
|
||||
lv_obj_remove_style_all(s_ra_page);
|
||||
@@ -641,9 +650,30 @@ void raNewPage() {
|
||||
lv_obj_set_style_pad_bottom(s_ra_page, 12, LV_PART_MAIN);
|
||||
lv_obj_set_style_pad_left(s_ra_page, 8, LV_PART_MAIN);
|
||||
lv_obj_set_style_pad_column(s_ra_page, 10, LV_PART_MAIN);
|
||||
lv_obj_set_flex_flow(s_ra_page, raTwoCol() ? LV_FLEX_FLOW_ROW_WRAP : LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_flex_flow(s_ra_page, raTwoCol() ? LV_FLEX_FLOW_ROW : LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_set_scroll_dir(s_ra_page, LV_DIR_VER);
|
||||
lv_obj_set_scrollbar_mode(s_ra_page, LV_SCROLLBAR_MODE_AUTO);
|
||||
if (raTwoCol()) {
|
||||
lv_obj_set_flex_align(s_ra_page, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
for (auto& col : s_ra_col) {
|
||||
col = lv_obj_create(s_ra_page);
|
||||
lv_obj_remove_style_all(col);
|
||||
lv_obj_set_size(col, raColW(), LV_SIZE_CONTENT);
|
||||
lv_obj_set_flex_flow(col, LV_FLEX_FLOW_COLUMN);
|
||||
lv_obj_clear_flag(col, LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_add_flag(col, LV_OBJ_FLAG_EVENT_BUBBLE);
|
||||
}
|
||||
}
|
||||
}
|
||||
// After a view is built: a view of one column's worth of cards sits centred, not
|
||||
// against the left edge with the right half empty.
|
||||
void raFinishPage() {
|
||||
if (!s_ra_col[0] || !s_ra_col[1]) return;
|
||||
if (lv_obj_get_child_cnt(s_ra_col[1]) == 0) {
|
||||
lv_obj_add_flag(s_ra_col[1], LV_OBJ_FLAG_HIDDEN);
|
||||
lv_obj_set_style_pad_left(s_ra_page, 0, LV_PART_MAIN);
|
||||
lv_obj_set_flex_align(s_ra_page, LV_FLEX_ALIGN_CENTER, LV_FLEX_ALIGN_START, LV_FLEX_ALIGN_START);
|
||||
}
|
||||
}
|
||||
|
||||
// ---- edit sheet -------------------------------------------------------------------
|
||||
@@ -1458,6 +1488,7 @@ void raBuildView(uint8_t v) {
|
||||
case RA_V_ACTIONS: raBuildActions(); break;
|
||||
default: break;
|
||||
}
|
||||
raFinishPage();
|
||||
if (g_statusbar.root) lv_obj_move_foreground(g_statusbar.root);
|
||||
lv_obj_scroll_to_y(s_ra_page, 0, LV_ANIM_OFF);
|
||||
}
|
||||
|
||||
+83
-39
@@ -1087,6 +1087,9 @@ extern "C" const lv_font_t star_font_14;
|
||||
// and the Chats list (person = DM, group = channel).
|
||||
extern "C" const lv_font_t person_font; // 16 px — for g_font_16 contexts
|
||||
extern "C" const lv_font_t person_font14; // 14 px — for g_font_14 (chat list rows)
|
||||
#if defined(HAS_TANMATSU)
|
||||
extern "C" const lv_font_t person_font24; // 24 px — the Tanmatsu tab bar's Contacts icon
|
||||
#endif
|
||||
#define TOUCH_SYM_PERSON "\xEF\x80\x87" /* U+F007 user */
|
||||
#define TOUCH_SYM_ANTENNA "\xEF\x94\x99" /* U+F519 tower-broadcast */
|
||||
#define TOUCH_SYM_GROUP "\xEF\x83\x80" /* U+F0C0 users (group) */
|
||||
@@ -1160,6 +1163,9 @@ extern "C" const lv_font_t ui_semibold_16;
|
||||
extern "C" const lv_font_t ui_badge_11; // count pills: digits, + and ! in Bold
|
||||
extern "C" const lv_font_t ui_icons_16; // app and chrome icons (UI_ICON_* in ui_icons.h)
|
||||
extern "C" const lv_font_t ui_icons_20; // launcher tiles
|
||||
#if defined(HAS_TANMATSU)
|
||||
extern "C" const lv_font_t ui_icons_24; // chat composer quick-reply and send icons
|
||||
#endif
|
||||
extern "C" const lv_font_t clock_font_48; // Montserrat Light digits and colon: lock screen clock
|
||||
extern "C" const lv_font_t clock_font_40; // the same face at the screensaver's size
|
||||
#if defined(HAS_TANMATSU)
|
||||
@@ -3397,7 +3403,7 @@ constexpr int CHAT_KB_H = 130; // on-screen keyboard (portrait)
|
||||
// 320×180 landscape).
|
||||
#if CAP_LARGE_SCREEN
|
||||
constexpr int TABBAR_BOTTOM_H = 46; // taller on the big 800×480 panel — room for the coloured F-key shapes
|
||||
constexpr int TABBAR_RAIL_W = 56; // Condense Nav rail: fits the 34-px F-key shapes with a margin
|
||||
constexpr int TABBAR_RAIL_W = 56; // Condense Nav rail: fits an icon plus its small F-key shape with a margin
|
||||
#elif defined(HAS_THINKNODE_M9)
|
||||
// No tab bar on this board: it is tap-only chrome (navMaybeRebuild deliberately
|
||||
// never adds it to the focus group), and the M9 has no touch — the dedicated
|
||||
@@ -3459,7 +3465,7 @@ static inline lv_coord_t chatComposerChipSz() {
|
||||
static inline lv_coord_t chatComposerSendSz() {
|
||||
#if CAP_ROUND_CORNERS
|
||||
return CHAT_COMP_BTN_P4;
|
||||
#elif defined(TLORA_PAGER) || defined(HAS_CROWPANEL_50)
|
||||
#elif defined(TLORA_PAGER) || defined(HAS_CROWPANEL_50) || defined(HAS_TANMATSU)
|
||||
return chatComposerChipSz();
|
||||
#else
|
||||
return 34;
|
||||
@@ -3530,6 +3536,15 @@ static lv_coord_t chatComposerSlimRowH(lv_coord_t ta_h) {
|
||||
return (ta_h > band ? ta_h : band) + chatComposerChromeH();
|
||||
#endif
|
||||
}
|
||||
// Tanmatsu: the QR and emoji buttons each carry a small F-key shape just to their right
|
||||
// (chatAddFkeyHint); the text box gives up this much room per button for it.
|
||||
#if defined(HAS_TANMATSU)
|
||||
static constexpr lv_coord_t CHAT_FKEY_HINT_SZ = 14;
|
||||
static constexpr lv_coord_t CHAT_FKEY_HINT_GAP = 4;
|
||||
static constexpr lv_coord_t CHAT_FKEY_HINT_W = CHAT_FKEY_HINT_SZ + CHAT_FKEY_HINT_GAP;
|
||||
#else
|
||||
static constexpr lv_coord_t CHAT_FKEY_HINT_W = 0;
|
||||
#endif
|
||||
static inline lv_coord_t chatComposerTaW(bool channel_mode) {
|
||||
const lv_coord_t chip = chatComposerChipSz();
|
||||
// Two-row: the chips are on the row above, so the text box only shares its row with Send.
|
||||
@@ -3537,7 +3552,7 @@ static inline lv_coord_t chatComposerTaW(bool channel_mode) {
|
||||
lv_coord_t width = chatScreenW() - (2 * chip + 12) - chatComposerSendSz() - 14
|
||||
- chatComposerSendInset() - chatComposerLeftInset();
|
||||
if (chatHasSymbolChip(channel_mode)) width -= chip + 6;
|
||||
return width;
|
||||
return width - 2 * CHAT_FKEY_HINT_W;
|
||||
}
|
||||
// Most boards use a DOUBLE-height status bar in a chat (thread name on the lower
|
||||
// row + a centred cog). The round panel grows its one-row bar to SB_CHAT_H for the
|
||||
@@ -8858,15 +8873,18 @@ static void buildEpaperScrollControls() {
|
||||
}
|
||||
#endif
|
||||
|
||||
// Re-skin the bottom tab bar so each tab is its physical F-key's coloured OUTLINE shape with the
|
||||
// page icon inside, same colour: △ Messages · □ Contacts · ○ Home · ♣ Map · ◇ Settings.
|
||||
// Re-skin the bottom tab bar so each tab shows its page icon at normal size with a small coloured
|
||||
// OUTLINE of its physical F-key beside it: △ Messages · □ Contacts · ○ Home · ♣ Map · ◇ Settings.
|
||||
#if defined(HAS_TANMATSU)
|
||||
static lv_obj_t* s_tabhint_cv[5] = { nullptr };
|
||||
static lv_obj_t* s_tabhint_ic[5] = { nullptr };
|
||||
#endif
|
||||
|
||||
// All tabs stay full-bright; the active page is shown only by its cell backing (set below). Kept as
|
||||
// a hook in case we want a per-tab active treatment later.
|
||||
static void navUpdateTabHilite(int) {}
|
||||
|
||||
#if defined(HAS_TANMATSU) // its fonts (person_font24) are Tanmatsu-only
|
||||
static void navBuildTabKeyHints() {
|
||||
static bool built = false;
|
||||
if (built || !g_lv.tabview) return;
|
||||
@@ -8883,16 +8901,26 @@ static void navBuildTabKeyHints() {
|
||||
lv_obj_set_style_bg_opa(bar, LV_OPA_COVER, LV_PART_ITEMS | LV_STATE_CHECKED);
|
||||
lv_obj_set_style_radius(bar, 8, LV_PART_ITEMS | LV_STATE_CHECKED);
|
||||
|
||||
const int SZ = 34;
|
||||
const int SZ = 14; // small key shape beside the icon
|
||||
const int GAP = 6; // between the icon and its shape
|
||||
const lv_coord_t cell = lv_disp_get_hor_res(nullptr) / 5;
|
||||
const uint32_t cols[5] = { 0xF5A623, 0xFFD400, 0x2ECC40, 0x2E9BFF, 0xC724B1 };
|
||||
const char* icons[5] = { LV_SYMBOL_ENVELOPE, TOUCH_SYM_PERSON, LV_SYMBOL_HOME, LV_SYMBOL_GPS, LV_SYMBOL_SETTINGS };
|
||||
// 24 px icons (1.5x the old 16 px; fixed, never UI-size scaled). montserrat_24 carries the
|
||||
// Lucide LV_SYMBOLs; the person glyph is chained behind it so all five share one line box.
|
||||
static lv_font_t s_tab_icon_font, s_tab_person24;
|
||||
s_tab_person24 = person_font24;
|
||||
s_tab_person24.fallback = nullptr;
|
||||
s_tab_icon_font = lv_font_montserrat_24;
|
||||
s_tab_icon_font.fallback = &s_tab_person24;
|
||||
const lv_font_t* icon_font = &s_tab_icon_font;
|
||||
const lv_coord_t icon_h = lv_font_get_line_height(icon_font);
|
||||
const char* icons[5] = { LV_SYMBOL_ENVELOPE, TOUCH_SYM_PERSON, LV_SYMBOL_HOME, LV_SYMBOL_GPS, LV_SYMBOL_SETTINGS };
|
||||
for (int i = 0; i < 5; i++) {
|
||||
lv_color_t col = lv_color_hex(s_theme_high_contrast ? COLOR_TEXT : cols[i]);
|
||||
lv_obj_t* cv = lv_canvas_create(bar);
|
||||
lv_obj_clear_flag(cv, LV_OBJ_FLAG_CLICKABLE);
|
||||
uint8_t* buf = (uint8_t*)heap_caps_malloc(LV_CANVAS_BUF_SIZE_TRUE_COLOR_ALPHA(34, 34), MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||
if (!buf) buf = (uint8_t*)malloc(LV_CANVAS_BUF_SIZE_TRUE_COLOR_ALPHA(34, 34));
|
||||
uint8_t* buf = (uint8_t*)heap_caps_malloc(LV_CANVAS_BUF_SIZE_TRUE_COLOR_ALPHA(SZ, SZ), MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
|
||||
if (!buf) buf = (uint8_t*)malloc(LV_CANVAS_BUF_SIZE_TRUE_COLOR_ALPHA(SZ, SZ));
|
||||
lv_canvas_set_buffer(cv, buf, SZ, SZ, LV_IMG_CF_TRUE_COLOR_ALPHA);
|
||||
lv_canvas_fill_bg(cv, lv_color_black(), LV_OPA_TRANSP);
|
||||
lv_draw_line_dsc_t ld; lv_draw_line_dsc_init(&ld);
|
||||
@@ -8903,34 +8931,39 @@ static void navBuildTabKeyHints() {
|
||||
case 0: { lv_point_t p[4] = {{SZ/2,1},{1,SZ-2},{SZ-2,SZ-2},{SZ/2,1}}; lv_canvas_draw_line(cv, p, 4, &ld); } break; // △
|
||||
case 1: rd.radius = 4; lv_canvas_draw_rect(cv, 1, 1, SZ-2, SZ-2, &rd); break; // □
|
||||
case 2: rd.radius = LV_RADIUS_CIRCLE; lv_canvas_draw_rect(cv, 1, 1, SZ-2, SZ-2, &rd); break; // ○
|
||||
case 3: { rd.radius = LV_RADIUS_CIRCLE; const int r = 18; // ♣ three lobes
|
||||
case 3: { rd.radius = LV_RADIUS_CIRCLE; const int r = SZ * 4 / 7; // ♣ three lobes
|
||||
lv_canvas_draw_rect(cv, (SZ-r)/2, 0, r, r, &rd);
|
||||
lv_canvas_draw_rect(cv, 0, SZ-r, r, r, &rd);
|
||||
lv_canvas_draw_rect(cv, SZ-r, SZ-r, r, r, &rd); } break;
|
||||
default: { lv_point_t p[5] = {{SZ/2,1},{SZ-2,SZ/2},{SZ/2,SZ-2},{1,SZ/2},{SZ/2,1}}; lv_canvas_draw_line(cv, p, 5, &ld); } break; // ◇
|
||||
}
|
||||
lv_coord_t rx, ry;
|
||||
if (s_nav_rail && tabBarChildPosForCell(i, SZ, SZ, &rx, &ry))
|
||||
lv_obj_align(cv, LV_ALIGN_TOP_LEFT, rx, ry); // Condense Nav rail: stacked down the right edge
|
||||
else
|
||||
lv_obj_align(cv, LV_ALIGN_LEFT_MID, i * cell + (cell - SZ) / 2, 0);
|
||||
s_tabhint_cv[i] = cv;
|
||||
|
||||
lv_obj_t* ic = lv_label_create(bar);
|
||||
lv_label_set_text(ic, icons[i]);
|
||||
lv_obj_set_style_text_color(ic, col, LV_PART_MAIN);
|
||||
#if CAP_LARGE_SCREEN
|
||||
lv_obj_set_style_text_font(ic, &g_font_tab, LV_PART_MAIN); // fixed 16 px — tab bar never scales
|
||||
#else
|
||||
lv_obj_set_style_text_font(ic, &g_font_16, LV_PART_MAIN);
|
||||
#endif
|
||||
lv_obj_set_style_text_font(ic, icon_font, LV_PART_MAIN);
|
||||
lv_obj_clear_flag(ic, LV_OBJ_FLAG_CLICKABLE);
|
||||
lv_obj_align_to(ic, cv, LV_ALIGN_CENTER, 0, (i == 0) ? 5 : 0); // nudge the icon into the triangle's body
|
||||
s_tabhint_ic[i] = ic;
|
||||
|
||||
// Lay the icon and its shape out as one centred group: [icon] gap [shape].
|
||||
const lv_coord_t icon_w = lv_txt_get_width(icons[i], strlen(icons[i]), icon_font, 0, LV_TEXT_FLAG_NONE);
|
||||
const lv_coord_t grp_w = icon_w + GAP + SZ;
|
||||
const lv_coord_t grp_h = LV_MAX(icon_h, (lv_coord_t)SZ);
|
||||
lv_coord_t rx, ry;
|
||||
if (s_nav_rail && tabBarChildPosForCell(i, grp_w, grp_h, &rx, &ry)) { // Condense Nav rail: stacked down the right edge
|
||||
lv_obj_align(ic, LV_ALIGN_TOP_LEFT, rx, ry + (grp_h - icon_h) / 2);
|
||||
lv_obj_align(cv, LV_ALIGN_TOP_LEFT, rx + icon_w + GAP, ry + (grp_h - SZ) / 2);
|
||||
} else {
|
||||
const lv_coord_t gx = i * cell + (cell - grp_w) / 2;
|
||||
lv_obj_align(ic, LV_ALIGN_LEFT_MID, gx, 0);
|
||||
lv_obj_align(cv, LV_ALIGN_LEFT_MID, gx + icon_w + GAP, 0);
|
||||
}
|
||||
}
|
||||
navUpdateTabHilite(getActiveTab());
|
||||
}
|
||||
#endif // HAS_TANMATSU
|
||||
#endif // HAS_TANMATSU
|
||||
#endif // CAP_KEYPAD_NAV
|
||||
|
||||
// Touch-only boards (Heltec V4) compile out the keypad/trackball focus-group nav
|
||||
// above, so navMarkDirty() has no group to flag dirty. Provide a no-op fallback
|
||||
@@ -11175,7 +11208,7 @@ static void chatComposerAlignSlim(LvChatPanel* p) {
|
||||
lift(p->composer_ta, s_comp_ta_h);
|
||||
lift(p->qr_btn, chatComposerChipSz());
|
||||
lift(p->emoji_btn, chatComposerChipSz());
|
||||
#if defined(HAS_CROWPANEL_50)
|
||||
#if defined(HAS_CROWPANEL_50) || defined(HAS_TANMATSU)
|
||||
lift(p->send_btn, chatComposerSendSz());
|
||||
#else
|
||||
lift(p->send_btn, 30); // a 30-px circle in a send_sz-wide slot (makeChatDetail)
|
||||
@@ -44113,6 +44146,21 @@ static void styleChipAsFkey(lv_obj_t* btn, lv_obj_t* icon, int shape, uint32_t r
|
||||
if (tint_icon) lv_obj_set_style_text_color(icon, lv_color_hex(rgb), LV_PART_MAIN);
|
||||
}
|
||||
}
|
||||
// Composer chips: a small F-key shape just right of the button, vertically centred on it,
|
||||
// instead of a big shape drawn behind the icon. It is the button's child with overflow
|
||||
// visible, so it follows the button wherever the composer lifts or moves it.
|
||||
static void chatAddFkeyHint(lv_obj_t* btn, lv_obj_t* icon, int shape, uint32_t rgb, bool tint_icon) {
|
||||
if (!btn) return;
|
||||
lv_obj_set_style_border_width(btn, 0, LV_PART_MAIN);
|
||||
lv_obj_set_style_shadow_width(btn, 0, LV_PART_MAIN);
|
||||
lv_obj_clear_flag(btn, LV_OBJ_FLAG_SCROLLABLE);
|
||||
lv_obj_add_flag(btn, LV_OBJ_FLAG_OVERFLOW_VISIBLE);
|
||||
lv_obj_t* cv = makeFkeyShape(btn, shape, rgb, CHAT_FKEY_HINT_SZ);
|
||||
// RIGHT_MID aligns to the content box; add the right pad to reach the button's edge.
|
||||
const lv_coord_t pr = lv_obj_get_style_pad_right(btn, LV_PART_MAIN);
|
||||
lv_obj_align(cv, LV_ALIGN_RIGHT_MID, pr + CHAT_FKEY_HINT_W, 0);
|
||||
if (icon && tint_icon) lv_obj_set_style_text_color(icon, lv_color_hex(rgb), LV_PART_MAIN);
|
||||
}
|
||||
#endif // HAS_TANMATSU
|
||||
|
||||
// ----- Chat detail (full-screen overlay on lv_scr_act) -------
|
||||
@@ -44287,10 +44335,11 @@ static void makeChatDetail(LvChatPanel& p) {
|
||||
const bool has_symbol_chip = chatHasSymbolChip(p.channel_mode);
|
||||
const lv_coord_t send_sz = chatComposerSendSz();
|
||||
const lv_coord_t comp_ta_w = chatComposerTaW(p.channel_mode);
|
||||
const lv_coord_t comp_ta_x = chip_sz + chip_gap;
|
||||
// CHAT_FKEY_HINT_W (Tanmatsu only, else 0) leaves room right of QR and emoji for their F-key shapes.
|
||||
const lv_coord_t comp_ta_x = chip_sz + CHAT_FKEY_HINT_W + chip_gap;
|
||||
// Right-edge offsets: the chips stack leftward from Send's slot, # nearest it.
|
||||
const lv_coord_t symbol_rx = chatComposerSendInset() + send_sz + chip_gap;
|
||||
const lv_coord_t emoji_rx = has_symbol_chip ? symbol_rx + chip_sz + chip_gap : symbol_rx;
|
||||
const lv_coord_t emoji_rx = (has_symbol_chip ? symbol_rx + chip_sz + chip_gap : symbol_rx) + CHAT_FKEY_HINT_W;
|
||||
|
||||
// Macro picker button: a compact chip taps to a popup grid of user-
|
||||
// defined quick-reply presets. Saves typing for stock phrases ("ok",
|
||||
@@ -44317,19 +44366,15 @@ static void makeChatDetail(LvChatPanel& p) {
|
||||
lv_label_set_text(ql, UI_ICON_MESSAGE_SQUARE_TEXT);
|
||||
#if defined(HAS_CROWPANEL_50)
|
||||
lv_obj_set_style_text_font(ql, &ui_icons_20, LV_PART_MAIN);
|
||||
#elif defined(HAS_TANMATSU)
|
||||
lv_obj_set_style_text_font(ql, &ui_icons_24, LV_PART_MAIN);
|
||||
#else
|
||||
lv_obj_set_style_text_font(ql, &g_font_16, LV_PART_MAIN);
|
||||
#endif
|
||||
lv_obj_center(ql);
|
||||
#if defined(HAS_TANMATSU)
|
||||
styleChipAsFkey(qr_btn, ql, 0, 0xF5A623, chip_sz, true); // orange △ — quick replies (F2)
|
||||
// styleChipAsFkey clears the bg to draw the shape — restore the glass backing behind it.
|
||||
lv_obj_set_style_bg_color(qr_btn, lv_color_hex(themeRole(0x000000, COLOR_PANEL)), LV_PART_MAIN);
|
||||
chatAddFkeyHint(qr_btn, ql, 0, 0xF5A623, true); // orange △ — quick replies (F2)
|
||||
lv_obj_set_style_bg_opa(qr_btn, LV_OPA_50, LV_PART_MAIN);
|
||||
lv_obj_set_style_radius(qr_btn, chip_sz / 2, LV_PART_MAIN);
|
||||
// ~40% smaller list glyph (fixed size, not the UI-scaled g_font_14) so it sits neatly in
|
||||
// the narrow lower body of the △ instead of overflowing it.
|
||||
lv_obj_set_style_text_font(ql, &lv_font_montserrat_14, LV_PART_MAIN);
|
||||
#endif
|
||||
|
||||
// Emoji / special-character picker button (smiley). Opens the insert grid.
|
||||
@@ -44360,15 +44405,12 @@ static void makeChatDetail(LvChatPanel& p) {
|
||||
#endif
|
||||
lv_obj_center(el);
|
||||
#if defined(HAS_TANMATSU)
|
||||
styleChipAsFkey(p.emoji_btn, el, 1, 0xFFD400, chip_sz, false); // yellow □ — emoji picker (F3); keep the colour glyph
|
||||
// styleChipAsFkey clears the bg to draw the shape — restore the glass backing behind it.
|
||||
lv_obj_set_style_bg_color(p.emoji_btn, lv_color_hex(themeRole(0x000000, COLOR_PANEL)), LV_PART_MAIN);
|
||||
chatAddFkeyHint(p.emoji_btn, el, 1, 0xFFD400, false); // yellow □ — emoji picker (F3); keep the colour glyph
|
||||
lv_obj_set_style_bg_opa(p.emoji_btn, LV_OPA_50, LV_PART_MAIN);
|
||||
lv_obj_set_style_radius(p.emoji_btn, chip_sz / 2, LV_PART_MAIN);
|
||||
#if LV_USE_IMGFONT
|
||||
// The colour emoji is a fixed ~16-px baked image (it doesn't scale with the font), so it
|
||||
// looks tiny in the big □. Hide the label glyph and draw the same emoji as a 2x-zoomed
|
||||
// image so it fills the shape.
|
||||
// looks tiny in the big chip. Hide the label glyph and draw the same emoji as a 2x-zoomed
|
||||
// image so it fills the button.
|
||||
if (const lv_img_dsc_t* sm = emojiLookupAny(0x1F60A)) { // 😊
|
||||
lv_obj_add_flag(el, LV_OBJ_FLAG_HIDDEN);
|
||||
lv_obj_t* eimg = lv_img_create(p.emoji_btn);
|
||||
@@ -44497,7 +44539,7 @@ static void makeChatDetail(LvChatPanel& p) {
|
||||
|
||||
lv_obj_t* send = lv_btn_create(p.composer_row);
|
||||
p.send_btn = send;
|
||||
#if defined(TLORA_PAGER) || CAP_ROUND_CORNERS || defined(HAS_CROWPANEL_50)
|
||||
#if defined(TLORA_PAGER) || CAP_ROUND_CORNERS || defined(HAS_CROWPANEL_50) || defined(HAS_TANMATSU)
|
||||
lv_obj_set_size(send, send_sz, send_sz);
|
||||
#else
|
||||
lv_obj_set_size(send, 30, 30); // a circle; the slot is send_sz wide
|
||||
@@ -44510,6 +44552,8 @@ static void makeChatDetail(LvChatPanel& p) {
|
||||
lv_label_set_text(sl, UI_ICON_ARROW_UP);
|
||||
#if defined(HAS_CROWPANEL_50)
|
||||
lv_obj_set_style_text_font(sl, &ui_icons_20, LV_PART_MAIN);
|
||||
#elif defined(HAS_TANMATSU)
|
||||
lv_obj_set_style_text_font(sl, &ui_icons_24, LV_PART_MAIN);
|
||||
#else
|
||||
lv_obj_set_style_text_font(sl, &g_font_16, LV_PART_MAIN);
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
#if defined(HAS_TANMATSU) || defined(HAS_TDISPLAY_P4) || defined(HAS_CROWPANEL_P4_101) || defined(HAS_CROWPANEL_50) || defined(HELTEC_LORA_V4_R8) || defined(TLORA_PAGER) || defined(HAS_THINKNODE_M9) || defined(HAS_TDECK_GT911) || defined(HAS_TDECK_PRO) || defined(HAS_SENSECAP_INDICATOR) || defined(DOC_CAPTURE) || defined(WADA_WEB)
|
||||
|
||||
/*******************************************************************************
|
||||
* Size: 24 px
|
||||
* Bpp: 4
|
||||
* Generated by scripts/build/gen-touch-fonts.sh with lv_font_conv 1.5.3
|
||||
* Sources: Lucide 1.52.0 (person icons)
|
||||
******************************************************************************/
|
||||
|
||||
#if 1
|
||||
#include "lvgl.h"
|
||||
#else
|
||||
#include "lvgl/lvgl.h"
|
||||
#endif
|
||||
|
||||
#ifndef PERSON_FONT24
|
||||
#define PERSON_FONT24 1
|
||||
#endif
|
||||
|
||||
#if PERSON_FONT24
|
||||
|
||||
/*-----------------
|
||||
* BITMAPS
|
||||
*----------------*/
|
||||
|
||||
/*Store the image of the glyphs*/
|
||||
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
|
||||
/* U+F007 "" */
|
||||
0x0, 0x0, 0x4, 0xbe, 0xeb, 0x40, 0x0, 0x0,
|
||||
0x0, 0x0, 0x8f, 0xff, 0xff, 0xf7, 0x0, 0x0,
|
||||
0x0, 0x4, 0xff, 0x71, 0x17, 0xff, 0x40, 0x0,
|
||||
0x0, 0xb, 0xf7, 0x0, 0x0, 0x7f, 0xb0, 0x0,
|
||||
0x0, 0xf, 0xf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 0x0, 0xbf, 0x70, 0x6f, 0xa0,
|
||||
0x6, 0xfa, 0x0, 0xee, 0x0, 0x9f, 0xf9, 0x0,
|
||||
0xee, 0x10, 0xbf, 0x50, 0x1, 0xff, 0x30, 0x11,
|
||||
0x0, 0xef, 0xff, 0x0, 0x11, 0x4, 0xfe, 0x0,
|
||||
0x0, 0x8f, 0xd0, 0x0, 0x5, 0xfc, 0xcf, 0x50,
|
||||
0x0, 0x1d, 0xf7, 0x0, 0x0, 0xd, 0xfa, 0x0,
|
||||
0xb, 0xf6, 0x6f, 0xb0, 0x0, 0xbf, 0xc0, 0x0,
|
||||
0x0, 0x2, 0xeb, 0x0, 0x1f, 0xf1, 0x1f, 0xf1,
|
||||
0x0, 0xad, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x6f, 0xff, 0xff, 0xf6, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0xcf, 0xff, 0xff, 0xfc,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2,
|
||||
0xff, 0x0, 0x0, 0xff, 0x20, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x8, 0xf9, 0x0, 0x0, 0x9f,
|
||||
0x80, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xd,
|
||||
0xf4, 0x0, 0x0, 0x4f, 0xd0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0xc, 0xb0, 0x0, 0x0, 0xc,
|
||||
0xb0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
|
||||
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
|
||||
};
|
||||
|
||||
|
||||
/*---------------------
|
||||
* GLYPH DESCRIPTION
|
||||
*--------------------*/
|
||||
|
||||
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
|
||||
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
|
||||
{.bitmap_index = 0, .adv_w = 384, .box_w = 16, .box_h = 21, .ofs_x = 4, .ofs_y = -2},
|
||||
{.bitmap_index = 168, .adv_w = 384, .box_w = 23, .box_h = 21, .ofs_x = 1, .ofs_y = -2},
|
||||
{.bitmap_index = 410, .adv_w = 384, .box_w = 24, .box_h = 24, .ofs_x = 0, .ofs_y = -4}
|
||||
};
|
||||
|
||||
/*---------------------
|
||||
* CHARACTER MAPPING
|
||||
*--------------------*/
|
||||
|
||||
static const uint16_t unicode_list_0[] = {
|
||||
0x0, 0xb9, 0x512
|
||||
};
|
||||
|
||||
/*Collect the unicode lists and glyph_id offsets*/
|
||||
static const lv_font_fmt_txt_cmap_t cmaps[] =
|
||||
{
|
||||
{
|
||||
.range_start = 61447, .range_length = 1299, .glyph_id_start = 1,
|
||||
.unicode_list = unicode_list_0, .glyph_id_ofs_list = NULL, .list_length = 3, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*--------------------
|
||||
* ALL CUSTOM DATA
|
||||
*--------------------*/
|
||||
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
/*Store all the custom data of the font*/
|
||||
static lv_font_fmt_txt_glyph_cache_t cache;
|
||||
#endif
|
||||
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
static const lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#else
|
||||
static lv_font_fmt_txt_dsc_t font_dsc = {
|
||||
#endif
|
||||
.glyph_bitmap = glyph_bitmap,
|
||||
.glyph_dsc = glyph_dsc,
|
||||
.cmaps = cmaps,
|
||||
.kern_dsc = NULL,
|
||||
.kern_scale = 0,
|
||||
.cmap_num = 1,
|
||||
.bpp = 4,
|
||||
.kern_classes = 0,
|
||||
.bitmap_format = 0,
|
||||
#if LVGL_VERSION_MAJOR == 8
|
||||
.cache = &cache
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*-----------------
|
||||
* PUBLIC FONT
|
||||
*----------------*/
|
||||
|
||||
/*Initialize a public general font descriptor*/
|
||||
#if LVGL_VERSION_MAJOR >= 8
|
||||
const lv_font_t person_font24 = {
|
||||
#else
|
||||
lv_font_t person_font24 = {
|
||||
#endif
|
||||
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
|
||||
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
|
||||
.line_height = 17, /*The maximum line height required by the font*/
|
||||
.base_line = 0, /*Baseline measured from the bottom of the line*/
|
||||
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
|
||||
.subpx = LV_FONT_SUBPX_NONE,
|
||||
#endif
|
||||
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
|
||||
.underline_position = 0,
|
||||
.underline_thickness = 0,
|
||||
#endif
|
||||
.dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
|
||||
#if LV_VERSION_CHECK(8, 2, 0) || LVGL_VERSION_MAJOR >= 9
|
||||
.fallback = NULL,
|
||||
#endif
|
||||
.user_data = NULL,
|
||||
};
|
||||
|
||||
|
||||
|
||||
#endif /*#if PERSON_FONT24*/
|
||||
|
||||
|
||||
#endif /* defined(HAS_TANMATSU) || defined(HAS_TDISPLAY_P4) || defined(HAS_CROWPANEL_P4_101) || defined(HAS_CROWPANEL_50) || defined(HELTEC_LORA_V4_R8) || defined(TLORA_PAGER) || defined(HAS_THINKNODE_M9) || defined(HAS_TDECK_GT911) || defined(HAS_TDECK_PRO) || defined(HAS_SENSECAP_INDICATOR) || defined(DOC_CAPTURE) || defined(WADA_WEB) */
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user