FlippyPass/project/ui/scenes/about.c
2024-09-16 05:23:42 -04:00

61 lines
No EOL
1.4 KiB
C

// Header
#include "about.h"
// Functions
void FP_Scene_Callback_About(void* context, uint32_t index){
// Setting context
FP_App* app = context;
// Sending it to the scene manager
scene_manager_handle_custom_event(app->scene_manager, index);
}
void FP_Scene_Enter_About(void* context){
// Setting context
FP_App* app = context;
// Reset view
text_box_reset(app->textbox);
// Setting some content
text_box_set_text(
app->textbox,
"FlippyPass - A Password Manager for the Flipper-Zero\nA robust password manager for the Flipper Zero designed in C"
);
// Sending view to Flipper
view_dispatcher_switch_to_view(app->view_dispatcher, FP_View_TextBox);
}
void FP_Scene_Exit_About(void* context){
// Setting context
FP_App* app = context;
// Reset menu
text_box_reset(app->textbox);
}
bool FP_Scene_Event_About(void* context, SceneManagerEvent event){
// Setting context
FP_App* app = context;
bool consumed = false;
// Switching based on event
if (event.type == SceneManagerEventTypeCustom) {
// We consumed it
consumed = true;
// Debug log about what we pressed
FURI_LOG_D(TAG, "Pressed %li", event.event);
UNUSED(app);
// What to do?
switch (event.event) {
default:
break;
}
} else {
consumed = false;
}
// Return result
return consumed;
}