mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-11-27 06:50:21 +00:00
Desktop: use right button to open passport (#1127)
This commit is contained in:
parent
d993c1f98e
commit
703844dd69
5 changed files with 16 additions and 6 deletions
|
@ -161,8 +161,9 @@ void animation_manager_new_idle_process(AnimationManager* animation_manager) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reaction to animation_manager->interact_callback() */
|
/* reaction to animation_manager->interact_callback() */
|
||||||
void animation_manager_interact_process(AnimationManager* animation_manager) {
|
bool animation_manager_interact_process(AnimationManager* animation_manager) {
|
||||||
furi_assert(animation_manager);
|
furi_assert(animation_manager);
|
||||||
|
bool consumed = true;
|
||||||
|
|
||||||
if(animation_manager->levelup_pending) {
|
if(animation_manager->levelup_pending) {
|
||||||
animation_manager->levelup_pending = false;
|
animation_manager->levelup_pending = false;
|
||||||
|
@ -181,7 +182,11 @@ void animation_manager_interact_process(AnimationManager* animation_manager) {
|
||||||
if(!blocked) {
|
if(!blocked) {
|
||||||
animation_manager_start_new_idle(animation_manager);
|
animation_manager_start_new_idle(animation_manager);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
consumed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return consumed;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void animation_manager_start_new_idle(AnimationManager* animation_manager) {
|
static void animation_manager_start_new_idle(AnimationManager* animation_manager) {
|
||||||
|
|
|
@ -130,8 +130,9 @@ void animation_manager_set_interact_callback(
|
||||||
* set_new_idle_callback's call.
|
* set_new_idle_callback's call.
|
||||||
*
|
*
|
||||||
* @animation_manager instance
|
* @animation_manager instance
|
||||||
|
* @return true if event was consumed
|
||||||
*/
|
*/
|
||||||
void animation_manager_interact_process(AnimationManager* animation_manager);
|
bool animation_manager_interact_process(AnimationManager* animation_manager);
|
||||||
|
|
||||||
/** Check if animation loaded
|
/** Check if animation loaded
|
||||||
*
|
*
|
||||||
|
|
|
@ -116,7 +116,6 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
||||||
}
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DesktopAnimationEventCheckAnimation:
|
case DesktopAnimationEventCheckAnimation:
|
||||||
animation_manager_check_blocking_process(desktop->animation_manager);
|
animation_manager_check_blocking_process(desktop->animation_manager);
|
||||||
consumed = true;
|
consumed = true;
|
||||||
|
@ -126,7 +125,12 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
case DesktopAnimationEventInteractAnimation:
|
case DesktopAnimationEventInteractAnimation:
|
||||||
animation_manager_interact_process(desktop->animation_manager);
|
if(!animation_manager_interact_process(desktop->animation_manager)) {
|
||||||
|
LoaderStatus status = loader_start(desktop->loader, "Passport", NULL);
|
||||||
|
if(status != LoaderStatusOk) {
|
||||||
|
FURI_LOG_E(TAG, "loader_start failed: %d", status);
|
||||||
|
}
|
||||||
|
}
|
||||||
consumed = true;
|
consumed = true;
|
||||||
break;
|
break;
|
||||||
case DesktopLockedEventUpdate:
|
case DesktopLockedEventUpdate:
|
||||||
|
|
|
@ -6,7 +6,7 @@ typedef enum {
|
||||||
DesktopMainEventOpenFavorite,
|
DesktopMainEventOpenFavorite,
|
||||||
DesktopMainEventOpenMenu,
|
DesktopMainEventOpenMenu,
|
||||||
DesktopMainEventOpenDebug,
|
DesktopMainEventOpenDebug,
|
||||||
DesktopMainEventRightShort,
|
DesktopMainEventOpenPassport, /**< Broken, don't use it */
|
||||||
|
|
||||||
DesktopLockedEventUnlocked,
|
DesktopLockedEventUnlocked,
|
||||||
DesktopLockedEventUpdate,
|
DesktopLockedEventUpdate,
|
||||||
|
|
|
@ -46,7 +46,7 @@ bool desktop_main_input(InputEvent* event, void* context) {
|
||||||
} else if(event->key == InputKeyLeft) {
|
} else if(event->key == InputKeyLeft) {
|
||||||
main_view->callback(DesktopMainEventOpenFavorite, main_view->context);
|
main_view->callback(DesktopMainEventOpenFavorite, main_view->context);
|
||||||
} else if(event->key == InputKeyRight) {
|
} else if(event->key == InputKeyRight) {
|
||||||
main_view->callback(DesktopMainEventRightShort, main_view->context);
|
main_view->callback(DesktopMainEventOpenPassport, main_view->context);
|
||||||
}
|
}
|
||||||
} else if(event->type == InputTypeLong) {
|
} else if(event->type == InputTypeLong) {
|
||||||
if(event->key == InputKeyDown) {
|
if(event->key == InputKeyDown) {
|
||||||
|
|
Loading…
Reference in a new issue