Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FL-2450] Desktop: use right button to open passport #1127

Merged
merged 2 commits into from
Apr 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion applications/desktop/animations/animation_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,9 @@ void animation_manager_new_idle_process(AnimationManager* animation_manager) {
}

/* 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);
bool consumed = true;

if(animation_manager->levelup_pending) {
animation_manager->levelup_pending = false;
Expand All @@ -181,7 +182,11 @@ void animation_manager_interact_process(AnimationManager* animation_manager) {
if(!blocked) {
animation_manager_start_new_idle(animation_manager);
}
} else {
consumed = false;
}

return consumed;
}

static void animation_manager_start_new_idle(AnimationManager* animation_manager) {
Expand Down
3 changes: 2 additions & 1 deletion applications/desktop/animations/animation_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,9 @@ void animation_manager_set_interact_callback(
* set_new_idle_callback's call.
*
* @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
*
Expand Down
8 changes: 6 additions & 2 deletions applications/desktop/scenes/desktop_scene_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
}
consumed = true;
break;

case DesktopAnimationEventCheckAnimation:
animation_manager_check_blocking_process(desktop->animation_manager);
consumed = true;
Expand All @@ -126,7 +125,12 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
consumed = true;
break;
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;
break;
case DesktopLockedEventUpdate:
Expand Down
2 changes: 1 addition & 1 deletion applications/desktop/views/desktop_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ typedef enum {
DesktopMainEventOpenFavorite,
DesktopMainEventOpenMenu,
DesktopMainEventOpenDebug,
DesktopMainEventRightShort,
DesktopMainEventOpenPassport, /**< Broken, don't use it */

DesktopLockedEventUnlocked,
DesktopLockedEventUpdate,
Expand Down
2 changes: 1 addition & 1 deletion applications/desktop/views/desktop_view_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bool desktop_main_input(InputEvent* event, void* context) {
} else if(event->key == InputKeyLeft) {
main_view->callback(DesktopMainEventOpenFavorite, main_view->context);
} else if(event->key == InputKeyRight) {
main_view->callback(DesktopMainEventRightShort, main_view->context);
main_view->callback(DesktopMainEventOpenPassport, main_view->context);
}
} else if(event->type == InputTypeLong) {
if(event->key == InputKeyDown) {
Expand Down