mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-12 20:28:36 -07:00
Merge branch 'ofw-dev' into dev
:(
This commit is contained in:
@@ -36,7 +36,6 @@ typedef enum {
|
||||
DesktopDebugEventExit,
|
||||
|
||||
DesktopLockMenuEventLock,
|
||||
DesktopLockMenuEventPinLock,
|
||||
DesktopLockMenuEventDummyModeOn,
|
||||
DesktopLockMenuEventDummyModeOff,
|
||||
DesktopLockMenuEventStealthModeOn,
|
||||
|
||||
@@ -23,14 +23,6 @@ void desktop_lock_menu_set_callback(
|
||||
lock_menu->context = context;
|
||||
}
|
||||
|
||||
void desktop_lock_menu_set_pin_state(DesktopLockMenuView* lock_menu, bool pin_is_set) {
|
||||
with_view_model(
|
||||
lock_menu->view,
|
||||
DesktopLockMenuViewModel * model,
|
||||
{ model->pin_is_set = pin_is_set; },
|
||||
true);
|
||||
}
|
||||
|
||||
void desktop_lock_menu_set_dummy_mode_state(DesktopLockMenuView* lock_menu, bool dummy_mode) {
|
||||
with_view_model(
|
||||
lock_menu->view,
|
||||
@@ -102,7 +94,6 @@ bool desktop_lock_menu_input_callback(InputEvent* event, void* context) {
|
||||
bool consumed = false;
|
||||
bool dummy_mode = false;
|
||||
bool stealth_mode = false;
|
||||
bool pin_is_set = false;
|
||||
bool update = false;
|
||||
|
||||
with_view_model(
|
||||
@@ -131,15 +122,12 @@ bool desktop_lock_menu_input_callback(InputEvent* event, void* context) {
|
||||
idx = model->idx;
|
||||
dummy_mode = model->dummy_mode;
|
||||
stealth_mode = model->stealth_mode;
|
||||
pin_is_set = model->pin_is_set;
|
||||
},
|
||||
update);
|
||||
|
||||
if(event->key == InputKeyOk) {
|
||||
if((idx == DesktopLockMenuIndexLock)) {
|
||||
if((pin_is_set) && (event->type == InputTypeLong)) {
|
||||
lock_menu->callback(DesktopLockMenuEventPinLock, lock_menu->context);
|
||||
} else if(event->type == InputTypeShort) {
|
||||
if(event->type == InputTypeShort) {
|
||||
lock_menu->callback(DesktopLockMenuEventLock, lock_menu->context);
|
||||
}
|
||||
} else if(idx == DesktopLockMenuIndexStealth) {
|
||||
|
||||
@@ -17,7 +17,6 @@ struct DesktopLockMenuView {
|
||||
|
||||
typedef struct {
|
||||
uint8_t idx;
|
||||
bool pin_is_set;
|
||||
bool dummy_mode;
|
||||
bool stealth_mode;
|
||||
} DesktopLockMenuViewModel;
|
||||
@@ -28,7 +27,6 @@ void desktop_lock_menu_set_callback(
|
||||
void* context);
|
||||
|
||||
View* desktop_lock_menu_get_view(DesktopLockMenuView* lock_menu);
|
||||
void desktop_lock_menu_set_pin_state(DesktopLockMenuView* lock_menu, bool pin_is_set);
|
||||
void desktop_lock_menu_set_dummy_mode_state(DesktopLockMenuView* lock_menu, bool dummy_mode);
|
||||
void desktop_lock_menu_set_stealth_mode_state(DesktopLockMenuView* lock_menu, bool stealth_mode);
|
||||
void desktop_lock_menu_set_idx(DesktopLockMenuView* lock_menu, uint8_t idx);
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
#include <furi.h>
|
||||
#include <furi_hal.h>
|
||||
#include <gui/elements.h>
|
||||
#include <gui/canvas.h>
|
||||
#include <toolbox/version.h>
|
||||
#include <assets_icons.h>
|
||||
#include <dolphin/helpers/dolphin_state.h>
|
||||
#include <dolphin/dolphin.h>
|
||||
|
||||
#include "../desktop_i.h"
|
||||
#include "desktop_view_pin_setup_done.h"
|
||||
|
||||
struct DesktopViewPinSetupDone {
|
||||
View* view;
|
||||
DesktopViewPinSetupDoneDoneCallback callback;
|
||||
void* context;
|
||||
};
|
||||
|
||||
static void desktop_view_pin_done_draw(Canvas* canvas, void* model) {
|
||||
furi_assert(canvas);
|
||||
UNUSED(model);
|
||||
|
||||
canvas_set_font(canvas, FontPrimary);
|
||||
elements_multiline_text_aligned(
|
||||
canvas, 64, 0, AlignCenter, AlignTop, "Prepare to use\narrows as\nPIN symbols");
|
||||
|
||||
canvas_set_font(canvas, FontSecondary);
|
||||
elements_multiline_text(canvas, 58, 24, "Prepare to use\narrows as\nPIN symbols");
|
||||
|
||||
canvas_draw_icon(canvas, 16, 18, &I_Pin_attention_dpad_29x29);
|
||||
elements_button_right(canvas, "Next");
|
||||
}
|
||||
|
||||
static bool desktop_view_pin_done_input(InputEvent* event, void* context) {
|
||||
furi_assert(event);
|
||||
furi_assert(context);
|
||||
|
||||
DesktopViewPinSetupDone* instance = context;
|
||||
bool consumed = false;
|
||||
|
||||
if((event->key == InputKeyRight) && (event->type == InputTypeShort)) {
|
||||
instance->callback(instance->context);
|
||||
consumed = true;
|
||||
}
|
||||
|
||||
return consumed;
|
||||
}
|
||||
|
||||
void desktop_view_pin_done_set_callback(
|
||||
DesktopViewPinSetupDone* instance,
|
||||
DesktopViewPinSetupDoneDoneCallback callback,
|
||||
void* context) {
|
||||
furi_assert(instance);
|
||||
furi_assert(callback);
|
||||
instance->callback = callback;
|
||||
instance->context = context;
|
||||
}
|
||||
|
||||
DesktopViewPinSetupDone* desktop_view_pin_done_alloc() {
|
||||
DesktopViewPinSetupDone* view = malloc(sizeof(DesktopViewPinSetupDone));
|
||||
view->view = view_alloc();
|
||||
view_set_context(view->view, view);
|
||||
view_set_draw_callback(view->view, desktop_view_pin_done_draw);
|
||||
view_set_input_callback(view->view, desktop_view_pin_done_input);
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
void desktop_view_pin_done_free(DesktopViewPinSetupDone* instance) {
|
||||
furi_assert(instance);
|
||||
|
||||
view_free(instance->view);
|
||||
free(instance);
|
||||
}
|
||||
|
||||
View* desktop_view_pin_done_get_view(DesktopViewPinSetupDone* instance) {
|
||||
furi_assert(instance);
|
||||
return instance->view;
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <gui/view.h>
|
||||
|
||||
typedef struct DesktopViewPinSetupDone DesktopViewPinSetupDone;
|
||||
|
||||
typedef void (*DesktopViewPinSetupDoneDoneCallback)(void*);
|
||||
|
||||
void desktop_view_pin_done_set_callback(
|
||||
DesktopViewPinSetupDone* instance,
|
||||
DesktopViewPinSetupDoneDoneCallback callback,
|
||||
void* context);
|
||||
DesktopViewPinSetupDone* desktop_view_pin_done_alloc();
|
||||
void desktop_view_pin_done_free(DesktopViewPinSetupDone* instance);
|
||||
View* desktop_view_pin_done_get_view(DesktopViewPinSetupDone* instance);
|
||||
Reference in New Issue
Block a user