mirror of
https://github.com/vicliu624/trail-mate.git
synced 2026-10-22 21:22:14 +00:00
Add T-Deck Pro board bring-up and sync pending UI fixes
This commit is contained in:
1 parent
f6a70d0860
commit
e2a586bc1d
19 files changed
+1560
-59
No files matched your search
@@ -179,13 +179,16 @@ void refresh_recent_widget()
|
||||
std::snprintf(footer, sizeof(footer), "%u threads active", static_cast<unsigned>(total));
|
||||
set_label_text_if_changed(recent.footer_label, footer);
|
||||
|
||||
// Keep the footer accent subtle; continuously animating it forces a redraw
|
||||
// every dashboard tick even when no conversation state changed.
|
||||
const lv_coord_t track_w = lv_obj_get_width(recent.scan_track);
|
||||
const lv_coord_t runner_w = lv_obj_get_width(recent.scan_runner);
|
||||
const lv_coord_t travel = track_w - runner_w;
|
||||
const lv_coord_t x = travel > 0
|
||||
? static_cast<lv_coord_t>(((dashboard_state().tick % 2U) == 0U) ? (travel / 3) : ((travel * 2) / 3))
|
||||
: 0;
|
||||
lv_obj_set_x(recent.scan_runner, x);
|
||||
const lv_coord_t x = travel > 0 ? travel / 2 : 0;
|
||||
if (lv_obj_get_x(recent.scan_runner) != x)
|
||||
{
|
||||
lv_obj_set_x(recent.scan_runner, x);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace ui::menu::dashboard
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
namespace ui::menu::dashboard
|
||||
{
|
||||
@@ -98,7 +99,8 @@ DashboardCardChrome create_card_chrome(lv_obj_t* parent,
|
||||
chrome.body = lv_obj_create(chrome.card);
|
||||
lv_obj_set_size(chrome.body, LV_PCT(100), card_h - kHeaderH - kFooterH);
|
||||
lv_obj_align_to(chrome.body, chrome.header, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
|
||||
lv_obj_set_style_bg_opa(chrome.body, LV_OPA_TRANSP, 0);
|
||||
lv_obj_set_style_bg_color(chrome.body, color_panel_bg(), 0);
|
||||
lv_obj_set_style_bg_opa(chrome.body, LV_OPA_COVER, 0);
|
||||
lv_obj_set_style_border_width(chrome.body, 0, 0);
|
||||
lv_obj_set_style_pad_left(chrome.body, 10, 0);
|
||||
lv_obj_set_style_pad_right(chrome.body, 10, 0);
|
||||
@@ -110,7 +112,7 @@ DashboardCardChrome create_card_chrome(lv_obj_t* parent,
|
||||
lv_obj_set_size(chrome.footer, LV_PCT(100), kFooterH);
|
||||
lv_obj_align(chrome.footer, LV_ALIGN_BOTTOM_MID, 0, 0);
|
||||
lv_obj_set_style_bg_color(chrome.footer, color_soft_amber(), 0);
|
||||
lv_obj_set_style_bg_opa(chrome.footer, LV_OPA_50, 0);
|
||||
lv_obj_set_style_bg_opa(chrome.footer, LV_OPA_COVER, 0);
|
||||
lv_obj_set_style_border_width(chrome.footer, 0, 0);
|
||||
lv_obj_set_style_radius(chrome.footer, 18, 0);
|
||||
lv_obj_set_style_pad_left(chrome.footer, 10, 0);
|
||||
@@ -128,10 +130,23 @@ void set_status_chip(DashboardCardChrome& chrome, const char* text, lv_color_t b
|
||||
{
|
||||
return;
|
||||
}
|
||||
lv_obj_set_style_bg_color(chrome.status_chip, bg, 0);
|
||||
lv_obj_set_style_bg_opa(chrome.status_chip, LV_OPA_COVER, 0);
|
||||
lv_obj_set_style_text_color(chrome.status_label, fg, 0);
|
||||
lv_label_set_text(chrome.status_label, text);
|
||||
if (lv_color_to_int(lv_obj_get_style_bg_color(chrome.status_chip, LV_PART_MAIN)) != lv_color_to_int(bg))
|
||||
{
|
||||
lv_obj_set_style_bg_color(chrome.status_chip, bg, 0);
|
||||
}
|
||||
if (lv_obj_get_style_bg_opa(chrome.status_chip, LV_PART_MAIN) != LV_OPA_COVER)
|
||||
{
|
||||
lv_obj_set_style_bg_opa(chrome.status_chip, LV_OPA_COVER, 0);
|
||||
}
|
||||
if (lv_color_to_int(lv_obj_get_style_text_color(chrome.status_label, LV_PART_MAIN)) != lv_color_to_int(fg))
|
||||
{
|
||||
lv_obj_set_style_text_color(chrome.status_label, fg, 0);
|
||||
}
|
||||
const char* current = lv_label_get_text(chrome.status_label);
|
||||
if (text != nullptr && (current == nullptr || std::strcmp(current, text) != 0))
|
||||
{
|
||||
lv_label_set_text(chrome.status_label, text);
|
||||
}
|
||||
}
|
||||
|
||||
void style_stat_tile(lv_obj_t* tile, lv_color_t bg)
|
||||
|
||||
@@ -10,13 +10,17 @@
|
||||
#include "ui/menu/dashboard/dashboard_state.h"
|
||||
#include "ui/menu/dashboard/dashboard_widgets.h"
|
||||
#include "ui/menu/menu_profile.h"
|
||||
#include "ui/ui_theme.h"
|
||||
|
||||
namespace ui::menu::dashboard
|
||||
{
|
||||
namespace
|
||||
{
|
||||
|
||||
constexpr uint32_t kDashboardTimerMs = 220;
|
||||
// Tab5's 720x1280 menu can starve the LVGL task if we keep animating the
|
||||
// dashboard aggressively while the menu grid is also visible. A slower cadence
|
||||
// keeps the dashboard useful without continuously forcing large redraws.
|
||||
constexpr uint32_t kDashboardTimerMs = 1000;
|
||||
|
||||
bool is_tab5_profile()
|
||||
{
|
||||
@@ -34,7 +38,6 @@ void refresh_dashboard(lv_timer_t* timer)
|
||||
|
||||
++dashboard.tick;
|
||||
|
||||
// Keep motion responsive, but avoid repainting the whole dashboard too aggressively.
|
||||
refresh_compass_widget();
|
||||
|
||||
if ((dashboard.tick % 2U) == 1U)
|
||||
@@ -68,7 +71,8 @@ void init(lv_obj_t* menu_panel, lv_obj_t* grid_panel, const ui::menu_layout::Ini
|
||||
|
||||
dashboard.dock_right = right_gap >= 240;
|
||||
dashboard.panel = lv_obj_create(menu_panel);
|
||||
lv_obj_set_style_bg_opa(dashboard.panel, LV_OPA_TRANSP, 0);
|
||||
lv_obj_set_style_bg_color(dashboard.panel, ui::theme::page_bg(), 0);
|
||||
lv_obj_set_style_bg_opa(dashboard.panel, LV_OPA_COVER, 0);
|
||||
lv_obj_set_style_border_width(dashboard.panel, 0, 0);
|
||||
lv_obj_set_style_pad_all(dashboard.panel, 0, 0);
|
||||
lv_obj_set_style_pad_row(dashboard.panel, 12, 0);
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace ui::menu_profile
|
||||
namespace
|
||||
{
|
||||
|
||||
#if !defined(TRAIL_MATE_ESP_BOARD_TAB5) && !defined(ARDUINO_T_LORA_PAGER) && !defined(ARDUINO_T_DECK)
|
||||
#if !defined(TRAIL_MATE_ESP_BOARD_TAB5) && !defined(ARDUINO_T_LORA_PAGER) && !defined(ARDUINO_T_DECK) && !defined(ARDUINO_T_DECK_PRO)
|
||||
lv_coord_t display_width()
|
||||
{
|
||||
lv_coord_t width = lv_display_get_physical_horizontal_resolution(nullptr);
|
||||
@@ -206,7 +206,7 @@ const MenuLayoutProfile& current()
|
||||
return make_tab5_profile();
|
||||
#elif defined(ARDUINO_T_LORA_PAGER)
|
||||
return make_pager_profile();
|
||||
#elif defined(ARDUINO_T_DECK)
|
||||
#elif defined(ARDUINO_T_DECK) || defined(ARDUINO_T_DECK_PRO)
|
||||
return make_tdeck_profile();
|
||||
#else
|
||||
return make_default_profile(display_width(), display_height());
|
||||
|
||||
@@ -163,7 +163,7 @@ const PageLayoutProfile& current()
|
||||
return make_tab5_profile();
|
||||
#elif defined(ARDUINO_T_LORA_PAGER)
|
||||
return make_pager_profile();
|
||||
#elif defined(ARDUINO_T_DECK)
|
||||
#elif defined(ARDUINO_T_DECK) || defined(ARDUINO_T_DECK_PRO)
|
||||
return make_tdeck_profile();
|
||||
#else
|
||||
lv_coord_t width = lv_display_get_physical_horizontal_resolution(nullptr);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "team/protocol/team_location_marker.h"
|
||||
#include "team/usecase/team_controller.h"
|
||||
#include "ui/page/page_profile.h"
|
||||
#include "ui/assets/fonts/fonts.h"
|
||||
#include "ui/screens/team/team_ui_store.h"
|
||||
#include "ui/ui_common.h"
|
||||
#include "ui/widgets/system_notification.h"
|
||||
@@ -1516,7 +1517,11 @@ void UiController::openKeyVerificationInfoModal(chat::NodeId node_id, uint32_t n
|
||||
lv_obj_align(title, LV_ALIGN_TOP_MID, 0, 0);
|
||||
|
||||
char num_buf[24] = {};
|
||||
std::snprintf(num_buf, sizeof(num_buf), "%03u %03u", number / 1000U, number % 1000U);
|
||||
std::snprintf(num_buf,
|
||||
sizeof(num_buf),
|
||||
"%03u %03u",
|
||||
static_cast<unsigned>(number / 1000U),
|
||||
static_cast<unsigned>(number % 1000U));
|
||||
key_verify_desc_ = lv_label_create(key_verify_panel_);
|
||||
std::string desc = resolve_contact_name(node_id) + "\nShare this number:\n";
|
||||
desc += num_buf;
|
||||
|
||||
Reference in new issue
Block a user