fae8d8f23c
* Gui: code input module * Gui: fix size to fit frame * Desktop: PIN config and lock option * Gui: code input: cleanup, offset input fields if no header present * Desktop: move code unlock to desktop_locked scene * Desktop: fix unlock with back key * Desktop: bump settings version * Desktop: correct scene usage. Co-authored-by: あく <alleteam@gmail.com>
44 lines
1.1 KiB
C
44 lines
1.1 KiB
C
#pragma once
|
|
|
|
#include <gui/gui_i.h>
|
|
#include <gui/view.h>
|
|
#include <gui/canvas.h>
|
|
#include <gui/elements.h>
|
|
#include <furi.h>
|
|
|
|
#define HINT_TIMEOUT 2
|
|
|
|
typedef enum {
|
|
DesktopLockMenuEventLock,
|
|
DesktopLockMenuEventUnlock,
|
|
DesktopLockMenuEventPinLock,
|
|
DesktopLockMenuEventExit,
|
|
} DesktopLockMenuEvent;
|
|
|
|
typedef struct DesktopLockMenuView DesktopLockMenuView;
|
|
|
|
typedef void (*DesktopLockMenuViewCallback)(DesktopLockMenuEvent event, void* context);
|
|
|
|
struct DesktopLockMenuView {
|
|
View* view;
|
|
DesktopLockMenuViewCallback callback;
|
|
void* context;
|
|
};
|
|
|
|
typedef struct {
|
|
uint8_t idx;
|
|
uint8_t hint_timeout;
|
|
bool pin_set;
|
|
} DesktopLockMenuViewModel;
|
|
|
|
void desktop_lock_menu_set_callback(
|
|
DesktopLockMenuView* lock_menu,
|
|
DesktopLockMenuViewCallback callback,
|
|
void* context);
|
|
|
|
View* desktop_lock_menu_get_view(DesktopLockMenuView* lock_menu);
|
|
void desktop_lock_menu_pin_set(DesktopLockMenuView* lock_menu, bool pin_is_set);
|
|
void desktop_lock_menu_reset_idx(DesktopLockMenuView* lock_menu);
|
|
DesktopLockMenuView* desktop_lock_menu_alloc();
|
|
void desktop_lock_menu_free(DesktopLockMenuView* lock_menu);
|