Files
ink-board/main/ui/apps/iotdis/ui/settings.h
GW_MC e467951b8c feat: Implement Discord app UI and settings management
- Added MainUI class for displaying voice state, status icon, and buttons.
- Introduced MainUIHandler to manage UI interactions and bridge communication.
- Created SettingsUI for displaying QR code and configuration instructions.
- Implemented SettingsUIHandler to manage settings and web server interactions.
- Developed WebHandler for handling HTTP requests for settings configuration.
- Updated AppRegistry to initialize with the new Discord app descriptor.
- Enhanced InteractionHandler to support keyboard interactions across app switches.
- Updated UIHandler to manage app switching and rendering of app icons.
- Enabled QR code support in LVGL configuration.
2026-02-02 20:47:27 +08:00

42 lines
952 B
C++

#pragma once
#include "lvgl.h"
#include "esp_err.h"
#include <string>
// Forward declaration
class InteractionHandler;
/**
* @brief Settings UI for Discord app
*
* Displays a QR code that links to a web-based configuration interface
*/
class SettingsUI {
public:
SettingsUI() = default;
~SettingsUI();
esp_err_t init(lv_obj_t* parent, InteractionHandler* interaction_handler);
esp_err_t deinit(void);
/**
* @brief Set the configuration URL to display in QR code
* @param url Full URL including IP, port, and auth key
*/
void set_config_url(const std::string& url);
/**
* @brief Update status message below QR code
* @param message Status message to display
*/
void set_status_message(const std::string& message);
private:
void create_ui_(lv_obj_t* parent, InteractionHandler* interaction_handler);
lv_obj_t* container_ = nullptr;
lv_obj_t* qr_code_ = nullptr;
lv_obj_t* status_label_ = nullptr;
};