Skip to content

Commit

Permalink
Clean up the menus on the M5Stack (#25886)
Browse files Browse the repository at this point in the history
* 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).

* Restyle
  • Loading branch information
mlepage-google authored and pull[bot] committed Jun 28, 2023
1 parent ac6b43d commit 8053276
Showing 1 changed file with 4 additions and 26 deletions.
30 changes: 4 additions & 26 deletions examples/all-clusters-app/esp32/main/DeviceWithDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,18 +545,6 @@ class SetupListModel : public TouchesMatterStackModel
private:
std::vector<std::string> 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()
{
Expand Down Expand Up @@ -729,20 +717,10 @@ esp_err_t InitM5Stack(std::string qrCodeText)
ESP_LOGI(TAG, "Opening Setup list");
ScreenManager::PushScreen(chip::Platform::New<ListScreen>(chip::Platform::New<SetupListModel>()));
})
->Item("Status",
[=]() {
ESP_LOGI(TAG, "Opening Status screen");
ScreenManager::PushScreen(chip::Platform::New<StatusScreen>());
})
->Item("Custom",
[]() {
ESP_LOGI(TAG, "Opening custom screen");
ScreenManager::PushScreen(chip::Platform::New<CustomScreen>());
})
->Item("More")
->Item("Items")
->Item("For")
->Item("Demo")));
->Item("Status", [=]() {
ESP_LOGI(TAG, "Opening Status screen");
ScreenManager::PushScreen(chip::Platform::New<StatusScreen>());
})));
return ESP_OK;
}
#endif
Expand Down

0 comments on commit 8053276

Please sign in to comment.