From 9afc23cba9bcf938d8c49d6e15e7662ee8e6385d Mon Sep 17 00:00:00 2001 From: Heiko Stuebner Date: Sat, 24 May 2025 23:42:23 +0200 Subject: navigation: fix greying out the app icon if not enabled Commit 0aead42fdf51 ("navigation: Add is available (#1847)") added the ability to draw the app icon in grey and in a disabled state when some prerequisits were not met. Only the Navigation app was using this mechanism due to its icons being stored in the external memory and possibly missing. Commit 63e0c4f4efb0 ("Application selection at build time") broke this by always setting the state as true: for (const auto& userApp : userApps) { apps[i++] = Screens::Tile::Applications {userApp.icon, userApp.app, true}; } Fix this by creating an isAvailable() strcuture in the app classes, similar to how the Watchfaces handle the same problem of checking availability. --- src/displayapp/screens/Steps.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/displayapp/screens/Steps.h') diff --git a/src/displayapp/screens/Steps.h b/src/displayapp/screens/Steps.h index 6443582f..1a4fe647 100644 --- a/src/displayapp/screens/Steps.h +++ b/src/displayapp/screens/Steps.h @@ -51,6 +51,10 @@ namespace Pinetime { static Screens::Screen* Create(AppControllers& controllers) { return new Screens::Steps(controllers.motionController, controllers.settingsController); }; + + static bool IsAvailable(Pinetime::Controllers::FS& /*filesystem*/) { + return true; + }; }; } } -- cgit v1.2.3-70-g09d2