navigation: Add is available (#1847)

Navigation app now needs 2 images to be loaded from the resources on the external filesystem. This PR adds an 'enabled' field to the Applications struct. This field is true for all applications expect for Navigation which calls Navigation::IsAvailable(). This methods returns true if the 2 files are available in the resources.

The application list disables the application (draws it in grey, disables the touch callback) if the enable flag is not set.
This commit is contained in:
JF
2023-09-02 19:43:39 +02:00
committed by GitHub
parent 44d1798f4f
commit 0aead42fdf
7 changed files with 41 additions and 19 deletions

View File

@@ -76,7 +76,7 @@ Tile::Tile(uint8_t screenID,
for (uint8_t i = 0; i < 6; i++) {
lv_btnmatrix_set_btn_ctrl(btnm1, i, LV_BTNMATRIX_CTRL_CLICK_TRIG);
if (applications[i].application == Apps::None) {
if (applications[i].application == Apps::None || !applications[i].enabled) {
lv_btnmatrix_set_btn_ctrl(btnm1, i, LV_BTNMATRIX_CTRL_DISABLED);
}
}