Ken Van Hoeylandt 24ef79070a
App UX/UI updates and more (#678)
- Refactored many apps' UI/UX
- Improve material themes
- Fix for Tab5 flickering on v1
- Extend dts parser for i2c address/reg support in code
- Fix for I2C Scanner glitch where it would show devices that aren't connected
- Add name labels to I2C Scanner's scanned devices
2026-10-08 22:02:18 +02:00

42 lines
1.0 KiB
C++

#pragma once
#include "./Bindings.h"
#include "./State.h"
#include <cstdint>
#include <lvgl.h>
namespace tt::app::btmanage {
class View final {
Bindings* bindings;
State* state;
// Passed through to onBtToggled/onScanToggled/onPairPeer via lv_obj user_data - see
// Bindings.h. Set in init(), before any callback can fire.
void* context = nullptr;
lv_obj_t* root = nullptr;
lv_obj_t* enable_switch = nullptr;
lv_obj_t* enable_on_boot_switch = nullptr;
lv_obj_t* scanning_spinner = nullptr;
lv_obj_t* peers_list = nullptr;
void updateBtToggle();
void updateEnableOnBootToggle();
void updateScanning();
void updatePeerList();
void createPeerListItem(lv_obj_t* list, const bluetooth::PeerRecord& record, bool isPaired, size_t index);
static void onConnect(lv_event_t* event);
public:
View(Bindings* bindings, State* state) : bindings(bindings), state(state) {}
void init(void* context, lv_obj_t* parent);
void update();
};
} // namespace tt::app::btmanage