Compare commits
1 commit
Author | SHA1 | Date | |
---|---|---|---|
1bbd5c2db8 |
4 changed files with 83 additions and 4 deletions
61
project/ui/scenes/about.c
Normal file
61
project/ui/scenes/about.c
Normal file
|
@ -0,0 +1,61 @@
|
|||
// 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;
|
||||
}
|
14
project/ui/scenes/about.h
Normal file
14
project/ui/scenes/about.h
Normal file
|
@ -0,0 +1,14 @@
|
|||
// Define once
|
||||
#ifndef H_S_ABOUT
|
||||
#define H_S_ABOUT
|
||||
|
||||
// Libraries
|
||||
#include "../app.h"
|
||||
|
||||
// Functions
|
||||
void FP_Scene_Callback_About(void* context, uint32_t index);
|
||||
void FP_Scene_Enter_About(void* context);
|
||||
void FP_Scene_Exit_About(void* context);
|
||||
bool FP_Scene_Event_About(void* context, SceneManagerEvent event);
|
||||
|
||||
#endif
|
|
@ -40,7 +40,7 @@ void FP_Scene_Exit_Cred(void* context) {
|
|||
FP_App* app = context;
|
||||
|
||||
// Reset menu
|
||||
dialog_ex_reset(app->dialog);
|
||||
text_box_reset(app->dialog);
|
||||
}
|
||||
bool FP_Scene_Event_Cred(void* context, SceneManagerEvent event) {
|
||||
// Setting context
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "scenes/send.h"
|
||||
#include "scenes/create.h"
|
||||
#include "scenes/type.h"
|
||||
#include "scenes/about.h"
|
||||
|
||||
// Handlers
|
||||
void (*const FP_Scene_Enter_Handlers[])(void*) = {
|
||||
|
@ -20,7 +21,8 @@ void (*const FP_Scene_Enter_Handlers[])(void*) = {
|
|||
FP_Scene_Enter_Cred,
|
||||
FP_Scene_Enter_Send,
|
||||
FP_Scene_Enter_Create,
|
||||
FP_Scene_Enter_Type
|
||||
FP_Scene_Enter_Type,
|
||||
FP_Scene_Enter_About
|
||||
};
|
||||
bool (*const FP_Scene_Event_Handlers[])(void*, SceneManagerEvent) = {
|
||||
FP_Scene_Event_Auth,
|
||||
|
@ -30,7 +32,8 @@ bool (*const FP_Scene_Event_Handlers[])(void*, SceneManagerEvent) = {
|
|||
FP_Scene_Event_Cred,
|
||||
FP_Scene_Event_Send,
|
||||
FP_Scene_Event_Create,
|
||||
FP_Scene_Event_Type
|
||||
FP_Scene_Event_Type,
|
||||
FP_Scene_Event_About
|
||||
};
|
||||
void (*const FP_Scene_Exit_Handlers[])(void*) = {
|
||||
FP_Scene_Exit_Auth,
|
||||
|
@ -40,7 +43,8 @@ void (*const FP_Scene_Exit_Handlers[])(void*) = {
|
|||
FP_Scene_Exit_Cred,
|
||||
FP_Scene_Exit_Send,
|
||||
FP_Scene_Exit_Create,
|
||||
FP_Scene_Exit_Type
|
||||
FP_Scene_Exit_Type,
|
||||
FP_Scene_Exit_About
|
||||
};
|
||||
|
||||
// Main Handler
|
||||
|
|
Loading…
Reference in a new issue