Rename icons, fix T-Lora Pager config and more (#502)
* **New Features** * Added NFC chip-select to SD card hardware configuration. * **Refactor** * Consolidated and renamed icon resources; apps and status-bar now reference unified icon headers and new icon constants. * Renamed LVGL lock API (timed → lvgl_try_lock) and updated callers. * **Documentation** * Updated module README and license files; added Apache-2.0 license document.
This commit is contained in:
committed by
GitHub
parent
72b55b221e
commit
3a24d058c9
@@ -10,7 +10,7 @@
|
||||
#include "tactility/drivers/uart_controller.h"
|
||||
#include <cstring>
|
||||
#include <lvgl.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
namespace tt::app::addgps {
|
||||
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "AddGps",
|
||||
.appName = "Add GPS",
|
||||
.appIcon = LVGL_SYMBOL_NAVIGATION,
|
||||
.appIcon = LVGL_ICON_SHARED_NAVIGATION,
|
||||
.appCategory = Category::System,
|
||||
.appFlags = AppManifest::Flags::Hidden,
|
||||
.createApp = create<AddGpsApp>
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
#include <algorithm>
|
||||
#include <format>
|
||||
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "AppHub",
|
||||
.appName = "App Hub",
|
||||
.appIcon = LVGL_SYMBOL_HUB,
|
||||
.appIcon = LVGL_ICON_SHARED_HUB,
|
||||
.appCategory = Category::System,
|
||||
.createApp = create<AppHubApp>,
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include <tactility/lvgl_fonts.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
namespace tt::app::applist {
|
||||
|
||||
@@ -18,7 +18,7 @@ class AppListApp final : public App {
|
||||
}
|
||||
|
||||
static void createAppWidget(const std::shared_ptr<AppManifest>& manifest, lv_obj_t* list) {
|
||||
const void* icon = !manifest->appIcon.empty() ? manifest->appIcon.c_str() : LVGL_SYMBOL_TOOLBAR;
|
||||
const void* icon = !manifest->appIcon.empty() ? manifest->appIcon.c_str() : LVGL_ICON_SHARED_TOOLBAR;
|
||||
lv_obj_t* btn = lv_list_add_button(list, icon, manifest->appName.c_str());
|
||||
lv_obj_t* image = lv_obj_get_child(btn, 0);
|
||||
lv_obj_set_style_text_font(image, lvgl_get_shared_icon_font(), LV_PART_MAIN);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <tactility/lvgl_fonts.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#include <Tactility/app/AppRegistration.h>
|
||||
#include <Tactility/app/appdetails/AppDetails.h>
|
||||
@@ -19,7 +19,7 @@ class AppSettingsApp final : public App {
|
||||
}
|
||||
|
||||
static void createAppWidget(const std::shared_ptr<AppManifest>& manifest, lv_obj_t* list) {
|
||||
const void* icon = !manifest->appIcon.empty() ? manifest->appIcon.c_str() : LVGL_SYMBOL_TOOLBAR;
|
||||
const void* icon = !manifest->appIcon.empty() ? manifest->appIcon.c_str() : LVGL_ICON_SHARED_TOOLBAR;
|
||||
lv_obj_t* btn = lv_list_add_button(list, icon, manifest->appName.c_str());
|
||||
lv_obj_t* image = lv_obj_get_child(btn, 0);
|
||||
lv_obj_set_style_text_font(image, lvgl_get_shared_icon_font(), LV_PART_MAIN);
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "AppSettings",
|
||||
.appName = "Apps",
|
||||
.appIcon = LVGL_SYMBOL_APPS,
|
||||
.appIcon = LVGL_ICON_SHARED_APPS,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<AppSettingsApp>,
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
#include <cstdlib>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
#include <vector>
|
||||
|
||||
namespace tt::app::chat {
|
||||
@@ -181,7 +181,7 @@ void ChatApp::switchChannel(const std::string& chatChannel) {
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "Chat",
|
||||
.appName = "Chat",
|
||||
.appIcon = LVGL_SYMBOL_FORUM,
|
||||
.appIcon = LVGL_ICON_SHARED_FORUM,
|
||||
.createApp = create<ChatApp>
|
||||
};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <Tactility/service/loader/Loader.h>
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <lvgl.h>
|
||||
@@ -165,7 +165,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "Development",
|
||||
.appName = "Development",
|
||||
.appIcon = LVGL_SYMBOL_DEVICES,
|
||||
.appIcon = LVGL_ICON_SHARED_DEVICES,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<DevelopmentApp>
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <Tactility/Tactility.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#ifdef ESP_PLATFORM
|
||||
#include <Tactility/service/displayidle/DisplayIdleService.h>
|
||||
@@ -306,7 +306,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "Display",
|
||||
.appName = "Display",
|
||||
.appIcon = LVGL_SYMBOL_DISPLAY_SETTINGS,
|
||||
.appIcon = LVGL_ICON_SHARED_DISPLAY_SETTINGS,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<DisplayApp>
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <Tactility/service/gps/GpsState.h>
|
||||
#include <Tactility/service/loader/Loader.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#include <cstring>
|
||||
#include <format>
|
||||
@@ -455,7 +455,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "GpsSettings",
|
||||
.appName = "GPS",
|
||||
.appIcon = LVGL_SYMBOL_NAVIGATION,
|
||||
.appIcon = LVGL_ICON_SHARED_NAVIGATION,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<GpsSettingsApp>
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
#include <format>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
namespace tt::app::i2cscanner {
|
||||
|
||||
@@ -411,7 +411,7 @@ void I2cScannerApp::onScanTimerFinished() {
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "I2cScanner",
|
||||
.appName = "I2C Scanner",
|
||||
.appIcon = LVGL_SYMBOL_SEARCH,
|
||||
.appIcon = LVGL_ICON_SHARED_SEARCH,
|
||||
.appCategory = Category::System,
|
||||
.createApp = create<I2cScannerApp>
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <Tactility/settings/KeyboardSettings.h>
|
||||
#include <Tactility/lvgl/Toolbar.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
@@ -183,7 +183,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "KeyboardSettings",
|
||||
.appName = "Keyboard",
|
||||
.appIcon = LVGL_SYMBOL_KEYBOARD_ALT,
|
||||
.appIcon = LVGL_ICON_SHARED_KEYBOARD_ALT,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<KeyboardSettingsApp>
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <lvgl.h>
|
||||
|
||||
#include <tactility/lvgl_fonts.h>
|
||||
#include <tactility/lvgl_symbols_launcher.h>
|
||||
#include <tactility/lvgl_icon_launcher.h>
|
||||
|
||||
namespace tt::app::launcher {
|
||||
|
||||
@@ -151,9 +151,9 @@ public:
|
||||
margin = std::min<int32_t>(available_height / 16, total_button_size / 2);
|
||||
}
|
||||
|
||||
createAppButton(buttons_wrapper, ui_density, LVGL_SYMBOL_APPS, "AppList", margin, is_landscape_display);
|
||||
createAppButton(buttons_wrapper, ui_density, LVGL_SYMBOL_FOLDER, "Files", margin, is_landscape_display);
|
||||
createAppButton(buttons_wrapper, ui_density, LVGL_SYMBOL_SETTINGS, "Settings", margin, is_landscape_display);
|
||||
createAppButton(buttons_wrapper, ui_density, LVGL_ICON_LAUNCHER_APPS, "AppList", margin, is_landscape_display);
|
||||
createAppButton(buttons_wrapper, ui_density, LVGL_ICON_LAUNCHER_FOLDER, "Files", margin, is_landscape_display);
|
||||
createAppButton(buttons_wrapper, ui_density, LVGL_ICON_LAUNCHER_SETTINGS, "Settings", margin, is_landscape_display);
|
||||
|
||||
if (shouldShowPowerButton()) {
|
||||
auto* power_button = lv_btn_create(parent);
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <Tactility/settings/Language.h>
|
||||
#include <Tactility/settings/SystemSettings.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <map>
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "LocaleSettings",
|
||||
.appName = "Region & Language",
|
||||
.appIcon = LVGL_SYMBOL_LANGUAGE,
|
||||
.appIcon = LVGL_ICON_SHARED_LANGUAGE,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<LocaleSettingsApp>
|
||||
};
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <Tactility/file/File.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
namespace tt::app::notes {
|
||||
|
||||
@@ -209,7 +209,7 @@ class NotesApp final : public App {
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "Notes",
|
||||
.appName = "Notes",
|
||||
.appIcon = LVGL_SYMBOL_EDIT_NOTE,
|
||||
.appIcon = LVGL_ICON_SHARED_EDIT_NOTE,
|
||||
.createApp = create<NotesApp>
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <Tactility/Timer.h>
|
||||
|
||||
#include <tactility/hal/Device.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "Power",
|
||||
.appName = "Power",
|
||||
.appIcon = LVGL_SYMBOL_ELECTRIC_BOLT,
|
||||
.appIcon = LVGL_ICON_SHARED_ELECTRIC_BOLT,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<PowerApp>
|
||||
};
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#include <Tactility/service/screenshot/Screenshot.h>
|
||||
#include <Tactility/Timer.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
namespace tt::app::screenshot {
|
||||
|
||||
@@ -285,7 +285,7 @@ void ScreenshotApp::onShow(AppContext& appContext, lv_obj_t* parent) {
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "Screenshot",
|
||||
.appName = "Screenshot",
|
||||
.appIcon = LVGL_SYMBOL_IMAGE,
|
||||
.appIcon = LVGL_ICON_SHARED_IMAGE,
|
||||
.appCategory = Category::System,
|
||||
.createApp = create<ScreenshotApp>
|
||||
};
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <Tactility/service/loader/Loader.h>
|
||||
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
#include <tactility/lvgl_fonts.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
@@ -20,7 +20,7 @@ static void onAppPressed(lv_event_t* e) {
|
||||
static void createWidget(const std::shared_ptr<AppManifest>& manifest, void* parent) {
|
||||
check(parent);
|
||||
auto* list = static_cast<lv_obj_t*>(parent);
|
||||
const void* icon = !manifest->appIcon.empty() ? manifest->appIcon.c_str() : LVGL_SYMBOL_TOOLBAR;
|
||||
const void* icon = !manifest->appIcon.empty() ? manifest->appIcon.c_str() : LVGL_ICON_SHARED_TOOLBAR;
|
||||
auto* btn = lv_list_add_button(list, icon, manifest->appName.c_str());
|
||||
lv_obj_t* image = lv_obj_get_child(btn, 0);
|
||||
lv_obj_set_style_text_font(image, lvgl_get_shared_icon_font(), LV_PART_MAIN);
|
||||
@@ -52,7 +52,7 @@ class SettingsApp final : public App {
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "Settings",
|
||||
.appName = "Settings",
|
||||
.appIcon = LVGL_SYMBOL_SETTINGS,
|
||||
.appIcon = LVGL_ICON_SHARED_SETTINGS,
|
||||
.appCategory = Category::System,
|
||||
.appFlags = AppManifest::Flags::Hidden,
|
||||
.createApp = create<SettingsApp>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <lvgl.h>
|
||||
#include <tactility/lvgl_fonts.h>
|
||||
#include <tactility/hal/Device.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
#include <utility>
|
||||
#include <cstring>
|
||||
|
||||
@@ -700,7 +700,7 @@ class SystemInfoApp final : public App {
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "SystemInfo",
|
||||
.appName = "System Info",
|
||||
.appIcon = LVGL_SYMBOL_AREA_CHART,
|
||||
.appIcon = LVGL_ICON_SHARED_AREA_CHART,
|
||||
.appCategory = Category::System,
|
||||
.createApp = create<SystemInfoApp>
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
namespace tt::app::timedatesettings {
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "TimeDateSettings",
|
||||
.appName = "Time & Date",
|
||||
.appIcon = LVGL_SYMBOL_CALENDAR_MONTH,
|
||||
.appIcon = LVGL_ICON_SHARED_CALENDAR_MONTH,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<TimeDateSettingsApp>
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <tactility/lvgl_fonts.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#include <Tactility/app/AppContext.h>
|
||||
#include <Tactility/app/AppManifest.h>
|
||||
@@ -205,7 +205,7 @@ public:
|
||||
lv_obj_set_style_image_recolor_opa(icon, 255, 0);
|
||||
lv_obj_set_style_image_recolor(icon, lv_theme_get_color_primary(parent), 0);
|
||||
lv_obj_set_style_text_font(icon, lvgl_get_shared_icon_font(), LV_STATE_DEFAULT);
|
||||
lv_image_set_src(icon, LVGL_SYMBOL_SEARCH);
|
||||
lv_image_set_src(icon, LVGL_ICON_SHARED_SEARCH);
|
||||
|
||||
auto* textarea = lv_textarea_create(search_wrapper);
|
||||
lv_textarea_set_placeholder_text(textarea, "e.g. Europe/Amsterdam");
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
// Forward declare driver functions
|
||||
namespace trackball {
|
||||
@@ -210,7 +210,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "TrackballSettings",
|
||||
.appName = "Trackball",
|
||||
.appIcon = LVGL_SYMBOL_CIRCLE,
|
||||
.appIcon = LVGL_ICON_SHARED_CIRCLE,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<TrackballSettingsApp>
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#define TAG "usb_settings"
|
||||
|
||||
@@ -62,7 +62,7 @@ class UsbSettingsApp : public App {
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "UsbSettings",
|
||||
.appName = "USB",
|
||||
.appIcon = LVGL_SYMBOL_USB,
|
||||
.appIcon = LVGL_ICON_SHARED_USB,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<UsbSettingsApp>
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <Tactility/Logger.h>
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
#include <esp_netif.h>
|
||||
#include <esp_wifi.h>
|
||||
@@ -418,7 +418,7 @@ public:
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "WebServerSettings",
|
||||
.appName = "Web Server",
|
||||
.appIcon = LVGL_SYMBOL_CLOUD,
|
||||
.appIcon = LVGL_ICON_SHARED_CLOUD,
|
||||
.appCategory = Category::System,
|
||||
.createApp = create<WebServerSettingsApp>
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
#include <Tactility/service/loader/Loader.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_shared.h>
|
||||
#include <tactility/lvgl_icon_shared.h>
|
||||
|
||||
namespace tt::app::wifimanage {
|
||||
|
||||
@@ -144,7 +144,7 @@ void WifiManage::onHide(AppContext& app) {
|
||||
extern const AppManifest manifest = {
|
||||
.appId = "WifiManage",
|
||||
.appName = "Wi-Fi",
|
||||
.appIcon = LVGL_SYMBOL_WIFI,
|
||||
.appIcon = LVGL_ICON_SHARED_WIFI,
|
||||
.appCategory = Category::Settings,
|
||||
.createApp = create<WifiManage>
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
namespace tt::lvgl {
|
||||
|
||||
bool lock(TickType_t timeout) {
|
||||
return lvgl_try_lock_timed(timeout);
|
||||
return lvgl_try_lock(timeout);
|
||||
}
|
||||
|
||||
void unlock() {
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
~LvglSync() override = default;
|
||||
|
||||
bool lock(TickType_t timeoutTicks) const override {
|
||||
return lvgl_try_lock_timed(timeoutTicks);
|
||||
return lvgl_try_lock(timeoutTicks);
|
||||
}
|
||||
|
||||
void unlock() const override {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <Tactility/service/ServiceManifest.h>
|
||||
#include <Tactility/service/memorychecker/MemoryCheckerService.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_statusbar.h>
|
||||
#include <tactility/lvgl_icon_statusbar.h>
|
||||
|
||||
namespace tt::service::memorychecker {
|
||||
|
||||
@@ -54,7 +54,7 @@ bool MemoryCheckerService::onStart(ServiceContext& service) {
|
||||
auto lock = mutex.asScopedLock();
|
||||
lock.lock();
|
||||
|
||||
statusbarIconId = lvgl::statusbar_icon_add(LVGL_SYMBOL_MEMORY, false);
|
||||
statusbarIconId = lvgl::statusbar_icon_add(LVGL_ICON_STATUSBAR_MEMORY, false);
|
||||
lvgl::statusbar_icon_set_visibility(statusbarIconId, false);
|
||||
|
||||
timer.setCallbackPriority(Thread::Priority::Lower);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#include <Tactility/service/gps/GpsService.h>
|
||||
#include <Tactility/service/wifi/Wifi.h>
|
||||
|
||||
#include <tactility/lvgl_symbols_statusbar.h>
|
||||
#include <tactility/lvgl_icon_statusbar.h>
|
||||
|
||||
namespace tt::service::statusbar {
|
||||
|
||||
@@ -25,15 +25,15 @@ extern const ServiceManifest manifest;
|
||||
|
||||
const char* getWifiStatusIconForRssi(int rssi) {
|
||||
if (rssi >= -60) {
|
||||
return LVGL_SYMBOL_SIGNAL_WIFI_4_BAR;
|
||||
return LVGL_ICON_STATUSBAR_SIGNAL_WIFI_4_BAR;
|
||||
} else if (rssi >= -70) {
|
||||
return LVGL_SYMBOL_NETWORK_WIFI_3_BAR;
|
||||
return LVGL_ICON_STATUSBAR_NETWORK_WIFI_3_BAR;
|
||||
} else if (rssi >= -80) {
|
||||
return LVGL_SYMBOL_NETWORK_WIFI_2_BAR;
|
||||
return LVGL_ICON_STATUSBAR_NETWORK_WIFI_2_BAR;
|
||||
} else if (rssi >= -90) {
|
||||
return LVGL_SYMBOL_NETWORK_WIFI_1_BAR;
|
||||
return LVGL_ICON_STATUSBAR_NETWORK_WIFI_1_BAR;
|
||||
} else {
|
||||
return LVGL_SYMBOL_SIGNAL_WIFI_BAD;
|
||||
return LVGL_ICON_STATUSBAR_SIGNAL_WIFI_BAD;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,10 +44,10 @@ static const char* getWifiStatusIcon(wifi::RadioState state) {
|
||||
case On:
|
||||
case OnPending:
|
||||
case ConnectionPending:
|
||||
return LVGL_SYMBOL_SIGNAL_WIFI_0_BAR;
|
||||
return LVGL_ICON_STATUSBAR_SIGNAL_WIFI_0_BAR;
|
||||
case OffPending:
|
||||
case Off:
|
||||
return LVGL_SYMBOL_SIGNAL_WIFI_OFF;
|
||||
return LVGL_ICON_STATUSBAR_SIGNAL_WIFI_OFF;
|
||||
case ConnectionActive:
|
||||
rssi = wifi::getRssi();
|
||||
return getWifiStatusIconForRssi(rssi);
|
||||
@@ -60,11 +60,11 @@ static const char* getSdCardStatusIcon(hal::sdcard::SdCardDevice::State state) {
|
||||
switch (state) {
|
||||
using enum hal::sdcard::SdCardDevice::State;
|
||||
case Mounted:
|
||||
return LVGL_SYMBOL_SD_CARD;
|
||||
return LVGL_ICON_STATUSBAR_SD_CARD;
|
||||
case Error:
|
||||
case Unmounted:
|
||||
case Timeout:
|
||||
return LVGL_SYMBOL_SD_CARD_ALERT;
|
||||
return LVGL_ICON_STATUSBAR_SD_CARD_ALERT;
|
||||
default:
|
||||
check(false, "Unhandled SdCard state");
|
||||
}
|
||||
@@ -93,19 +93,19 @@ static const char* getPowerStatusIcon() {
|
||||
uint8_t charge = charge_level.valueAsUint8;
|
||||
|
||||
if (charge >= 95) {
|
||||
return LVGL_SYMBOL_BATTERY_ANDROID_FRAME_FULL;
|
||||
return LVGL_ICON_STATUSBAR_BATTERY_ANDROID_FRAME_FULL;
|
||||
} else if (charge >= 80) {
|
||||
return LVGL_SYMBOL_BATTERY_ANDROID_FRAME_6;
|
||||
return LVGL_ICON_STATUSBAR_BATTERY_ANDROID_FRAME_6;
|
||||
} else if (charge >= 64) {
|
||||
return LVGL_SYMBOL_BATTERY_ANDROID_FRAME_5;
|
||||
return LVGL_ICON_STATUSBAR_BATTERY_ANDROID_FRAME_5;
|
||||
} else if (charge >= 48) {
|
||||
return LVGL_SYMBOL_BATTERY_ANDROID_FRAME_4;
|
||||
return LVGL_ICON_STATUSBAR_BATTERY_ANDROID_FRAME_4;
|
||||
} else if (charge >= 32) {
|
||||
return LVGL_SYMBOL_BATTERY_ANDROID_FRAME_3;
|
||||
return LVGL_ICON_STATUSBAR_BATTERY_ANDROID_FRAME_3;
|
||||
} else if (charge >= 16) {
|
||||
return LVGL_SYMBOL_BATTERY_ANDROID_FRAME_2;
|
||||
return LVGL_ICON_STATUSBAR_BATTERY_ANDROID_FRAME_2;
|
||||
} else {
|
||||
return LVGL_SYMBOL_BATTERY_ANDROID_FRAME_1;
|
||||
return LVGL_ICON_STATUSBAR_BATTERY_ANDROID_FRAME_1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class StatusbarService final : public Service {
|
||||
bool show_icon = (gps_state == gps::State::OnPending) || (gps_state == gps::State::On);
|
||||
if (gps_last_state != show_icon) {
|
||||
if (show_icon) {
|
||||
lvgl::statusbar_icon_set_image(gps_icon_id, LVGL_SYMBOL_LOCATION_ON);
|
||||
lvgl::statusbar_icon_set_image(gps_icon_id, LVGL_ICON_STATUSBAR_LOCATION_ON);
|
||||
lvgl::statusbar_icon_set_visibility(gps_icon_id, true);
|
||||
} else {
|
||||
lvgl::statusbar_icon_set_visibility(gps_icon_id, false);
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <lv_screenshot.h>
|
||||
#endif
|
||||
|
||||
#include <tactility/lvgl_symbols_statusbar.h>
|
||||
#include <tactility/lvgl_icon_statusbar.h>
|
||||
|
||||
#include <atomic>
|
||||
#include <cctype>
|
||||
@@ -522,7 +522,7 @@ bool WebServerService::startServer() {
|
||||
|
||||
// Show statusbar icon
|
||||
if (statusbarIconId >= 0) {
|
||||
lvgl::statusbar_icon_set_image(statusbarIconId, LVGL_SYMBOL_CLOUD);
|
||||
lvgl::statusbar_icon_set_image(statusbarIconId, LVGL_ICON_STATUSBAR_CLOUD);
|
||||
lvgl::statusbar_icon_set_visibility(statusbarIconId, true);
|
||||
LOGGER.info("WebServer statusbar icon shown ({} mode)",
|
||||
settings.wifiMode == settings::webserver::WiFiMode::AccessPoint ? "AP" : "Station");
|
||||
|
||||
Reference in New Issue
Block a user