diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 6188c11a..1f3d1691 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -530,7 +530,7 @@ void DisplayApp::LoadScreen(Apps app, DisplayApp::FullRefreshDirections directio currentScreen = std::make_unique(lvgl); break; case Apps::Bird: - currentScreen = std::make_unique(lvgl); + currentScreen = std::make_unique(); break; case Apps::Music: currentScreen = std::make_unique(systemTask->nimble().music()); diff --git a/src/displayapp/screens/Bird.cpp b/src/displayapp/screens/Bird.cpp index 49d714b4..d2d78fde 100644 --- a/src/displayapp/screens/Bird.cpp +++ b/src/displayapp/screens/Bird.cpp @@ -7,7 +7,7 @@ using namespace Pinetime::Applications::Screens; -Bird::Bird(Pinetime::Components::LittleVgl& lvgl) : lvgl {lvgl} { +Bird::Bird() { lv_obj_t* background = lv_obj_create(lv_scr_act(), nullptr); lv_obj_set_size(background, LV_HOR_RES, LV_VER_RES); @@ -110,9 +110,10 @@ void Bird::Refresh() { } void Bird::GameOver() { + is_stopped = true; lv_label_set_text_static(info, "Game Over"); lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); - is_stopped = true; + lv_obj_set_style_local_text_color(bird, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED); return; } @@ -122,6 +123,7 @@ bool Bird::OnTouchEvent(Pinetime::Applications::TouchEvents /*event*/) { pos = 120; lv_label_set_text_static(info, "Touch to Start"); lv_obj_align(info, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 40); + lv_obj_set_style_local_text_color(bird, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_YELLOW); return true; } // reset diff --git a/src/displayapp/screens/Bird.h b/src/displayapp/screens/Bird.h index 87b46ba5..f8a08a16 100644 --- a/src/displayapp/screens/Bird.h +++ b/src/displayapp/screens/Bird.h @@ -20,7 +20,7 @@ namespace Pinetime { class Bird : public Screen { public: - Bird(Pinetime::Components::LittleVgl& lvgl); + Bird(); ~Bird() override; void Refresh() override; @@ -31,7 +31,6 @@ namespace Pinetime { private: void GameOver(); void MovePipe(); - Pinetime::Components::LittleVgl& lvgl; bool is_stopped = true; bool is_ascending = false;