From 7c7a8602c473bc160506e064097bd9ecc204425b Mon Sep 17 00:00:00 2001 From: Riku Isokoski Date: Wed, 22 Feb 2023 22:05:37 +0200 Subject: screens: Remove displayapp parameter from screen The DisplayApp class isn't used in the Screen base class and most screens, so requiring it is pointless. In this commit, DisplayApp pointers were added to screens which use it and the explicit Screen constructor was removed in those screens. --- src/displayapp/screens/Weather.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/displayapp/screens/Weather.cpp') diff --git a/src/displayapp/screens/Weather.cpp b/src/displayapp/screens/Weather.cpp index ff067db8..4921174c 100644 --- a/src/displayapp/screens/Weather.cpp +++ b/src/displayapp/screens/Weather.cpp @@ -26,7 +26,7 @@ using namespace Pinetime::Applications::Screens; Weather::Weather(Pinetime::Applications::DisplayApp* app, Pinetime::Controllers::WeatherService& weather) - : Screen(app), + : app {app}, weatherService(weather), screens {app, 0, @@ -97,7 +97,7 @@ std::unique_ptr Weather::CreateScreenTemperature() { } lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0); - return std::unique_ptr(new Screens::Label(0, 5, app, label)); + return std::unique_ptr(new Screens::Label(0, 5, label)); } std::unique_ptr Weather::CreateScreenAir() { @@ -130,7 +130,7 @@ std::unique_ptr Weather::CreateScreenAir() { } lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0); - return std::unique_ptr(new Screens::Label(0, 5, app, label)); + return std::unique_ptr(new Screens::Label(0, 5, label)); } std::unique_ptr Weather::CreateScreenClouds() { @@ -159,7 +159,7 @@ std::unique_ptr Weather::CreateScreenClouds() { } lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0); - return std::unique_ptr(new Screens::Label(0, 5, app, label)); + return std::unique_ptr(new Screens::Label(0, 5, label)); } std::unique_ptr Weather::CreateScreenPrecipitation() { @@ -188,7 +188,7 @@ std::unique_ptr Weather::CreateScreenPrecipitation() { } lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0); - return std::unique_ptr(new Screens::Label(0, 5, app, label)); + return std::unique_ptr(new Screens::Label(0, 5, label)); } std::unique_ptr Weather::CreateScreenHumidity() { @@ -217,5 +217,5 @@ std::unique_ptr Weather::CreateScreenHumidity() { } lv_label_set_align(label, LV_LABEL_ALIGN_CENTER); lv_obj_align(label, lv_scr_act(), LV_ALIGN_CENTER, 0, 0); - return std::unique_ptr(new Screens::Label(0, 5, app, label)); + return std::unique_ptr(new Screens::Label(0, 5, label)); } -- cgit v1.2.3-70-g09d2