Tertiary favourite app

This commit is contained in:
MX
2023-03-18 01:16:34 +03:00
parent 9941457cdb
commit 3444c5245e
8 changed files with 84 additions and 52 deletions

View File

@@ -126,13 +126,11 @@ static bool bubble_animation_input_callback(InputEvent* event, void* context) {
bubble_animation_activate(animation_view, false);
}
if(event->key == InputKeyRight) {
if(event->key == InputKeyRight && event->type == InputTypeShort) {
/* Right button reserved for animation activation, so consume */
consumed = true;
if(event->type == InputTypeShort) {
if(animation_view->interact_callback) {
animation_view->interact_callback(animation_view->interact_callback_context);
}
if(animation_view->interact_callback) {
animation_view->interact_callback(animation_view->interact_callback_context);
}
}

View File

@@ -8,7 +8,7 @@
#include <toolbox/saved_struct.h>
#include <storage/storage.h>
#define DESKTOP_SETTINGS_VER (7)
#define DESKTOP_SETTINGS_VER (8)
#define DESKTOP_SETTINGS_PATH INT_PATH(DESKTOP_SETTINGS_FILE_NAME)
#define DESKTOP_SETTINGS_MAGIC (0x17)
@@ -58,6 +58,7 @@ typedef struct {
typedef struct {
FavoriteApp favorite_primary;
FavoriteApp favorite_secondary;
FavoriteApp favorite_tertiary;
PinCode pin_code;
uint8_t is_locked;
uint32_t auto_lock_delay_ms;

View File

@@ -170,6 +170,25 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
}
consumed = true;
break;
case DesktopMainEventOpenFavoriteTertiary:
DESKTOP_SETTINGS_LOAD(&desktop->settings);
if(desktop->settings.favorite_tertiary.is_external) {
LoaderStatus status = loader_start(
desktop->loader,
FAP_LOADER_APP_NAME,
desktop->settings.favorite_tertiary.name_or_path);
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
} else {
LoaderStatus status = loader_start(
desktop->loader, desktop->settings.favorite_tertiary.name_or_path, NULL);
if(status != LoaderStatusOk) {
FURI_LOG_E(TAG, "loader_start failed: %d", status);
}
}
consumed = true;
break;
case DesktopAnimationEventCheckAnimation:
animation_manager_check_blocking_process(desktop->animation_manager);
consumed = true;

View File

@@ -5,6 +5,7 @@ typedef enum {
DesktopMainEventOpenArchive,
DesktopMainEventOpenFavoritePrimary,
DesktopMainEventOpenFavoriteSecondary,
DesktopMainEventOpenFavoriteTertiary,
DesktopMainEventOpenMenu,
DesktopMainEventOpenDebug,
DesktopMainEventOpenPassport,

View File

@@ -67,6 +67,8 @@ bool desktop_main_input_callback(InputEvent* event, void* context) {
main_view->callback(DesktopMainEventOpenDebug, main_view->context);
} else if(event->key == InputKeyLeft) {
main_view->callback(DesktopMainEventOpenFavoriteSecondary, main_view->context);
} else if(event->key == InputKeyRight) {
main_view->callback(DesktopMainEventOpenFavoriteTertiary, main_view->context);
} else if(event->key == InputKeyUp) {
main_view->callback(DesktopMainEventLock, main_view->context);
} else if(event->key == InputKeyOk) {