From 0c81357b4d30b36469021f77bb1b858cd268a56e Mon Sep 17 00:00:00 2001 From: Marc Lepage Date: Wed, 29 Mar 2023 16:55:14 -0400 Subject: [PATCH 1/2] Clean up the menus on the M5Stack No longer need screen to demonstrate custom drawing (QR Code screen does this) or non-functional menu items to demonstrate menu scrolling (other menus are now long enough to scroll). --- .../esp32/main/DeviceWithDisplay.cpp | 23 +------------------ 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp index 0694c091cb3787..958d5f7ba755d7 100644 --- a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp @@ -545,18 +545,6 @@ class SetupListModel : public TouchesMatterStackModel private: std::vector options; }; -class CustomScreen : public Screen -{ -public: - virtual void Display() - { - TFT_drawCircle(0.3 * DisplayWidth, 0.3 * DisplayHeight, 8, TFT_BLUE); - TFT_drawCircle(0.7 * DisplayWidth, 0.3 * DisplayHeight, 8, TFT_BLUE); - TFT_drawLine(0.2 * DisplayWidth, 0.6 * DisplayHeight, 0.3 * DisplayWidth, 0.7 * DisplayHeight, TFT_BLUE); - TFT_drawLine(0.3 * DisplayWidth, 0.7 * DisplayHeight, 0.7 * DisplayWidth, 0.7 * DisplayHeight, TFT_BLUE); - TFT_drawLine(0.7 * DisplayWidth, 0.7 * DisplayHeight, 0.8 * DisplayWidth, 0.6 * DisplayHeight, TFT_BLUE); - } -}; void SetupPretendDevices() { @@ -733,16 +721,7 @@ esp_err_t InitM5Stack(std::string qrCodeText) [=]() { ESP_LOGI(TAG, "Opening Status screen"); ScreenManager::PushScreen(chip::Platform::New()); - }) - ->Item("Custom", - []() { - ESP_LOGI(TAG, "Opening custom screen"); - ScreenManager::PushScreen(chip::Platform::New()); - }) - ->Item("More") - ->Item("Items") - ->Item("For") - ->Item("Demo"))); + }))); return ESP_OK; } #endif From eda54b65621acf78e58efe72f39d2feadd336619 Mon Sep 17 00:00:00 2001 From: Marc Lepage Date: Wed, 29 Mar 2023 17:16:41 -0400 Subject: [PATCH 2/2] Restyle --- .../all-clusters-app/esp32/main/DeviceWithDisplay.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp index 958d5f7ba755d7..cf5a5aa1cb1980 100644 --- a/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp +++ b/examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp @@ -717,11 +717,10 @@ esp_err_t InitM5Stack(std::string qrCodeText) ESP_LOGI(TAG, "Opening Setup list"); ScreenManager::PushScreen(chip::Platform::New(chip::Platform::New())); }) - ->Item("Status", - [=]() { - ESP_LOGI(TAG, "Opening Status screen"); - ScreenManager::PushScreen(chip::Platform::New()); - }))); + ->Item("Status", [=]() { + ESP_LOGI(TAG, "Opening Status screen"); + ScreenManager::PushScreen(chip::Platform::New()); + }))); return ESP_OK; } #endif