BT on/off to desktop_lock_menu

This commit is contained in:
Dmitry422
2026-02-12 16:55:19 +07:00
parent aec6045392
commit 808774c05f
5 changed files with 37 additions and 12 deletions

View File

@@ -37,7 +37,8 @@ typedef enum {
DesktopDebugEventToggleDebugMode,
DesktopDebugEventExit,
DesktopLockMenuEventLock,
//DesktopLockMenuEventLock,
DesktopLockMenuEventBt,
DesktopLockMenuEventDummyModeOn,
DesktopLockMenuEventDummyModeOff,
DesktopLockMenuEventStealthModeOn,

View File

@@ -6,7 +6,8 @@
#include "desktop_view_lock_menu.h"
typedef enum {
DesktopLockMenuIndexLock,
//DesktopLockMenuIndexLock,
DesktopLockMenuIndexBt,
DesktopLockMenuIndexStealth,
DesktopLockMenuIndexDummy,
@@ -56,8 +57,9 @@ void desktop_lock_menu_draw_callback(Canvas* canvas, void* model) {
for(size_t i = 0; i < DesktopLockMenuIndexTotalCount; ++i) {
const char* str = NULL;
if(i == DesktopLockMenuIndexLock) {
str = "Lock";
//if(i == DesktopLockMenuIndexLock) {
if(i == DesktopLockMenuIndexBt) {
str = "Bluetooth On/Off";
} else if(i == DesktopLockMenuIndexStealth) {
if(m->stealth_mode) {
str = "Unmute";
@@ -126,10 +128,15 @@ bool desktop_lock_menu_input_callback(InputEvent* event, void* context) {
update);
if(event->key == InputKeyOk) {
if(idx == DesktopLockMenuIndexLock) {
if(idx == DesktopLockMenuIndexBt) {
if(event->type == InputTypeShort) {
lock_menu->callback(DesktopLockMenuEventLock, lock_menu->context);
lock_menu->callback(DesktopLockMenuEventBt, lock_menu->context);
}
// old use case
// } else if(idx == DesktopLockMenuIndexLock) {
// if(event->type == InputTypeShort) {
// lock_menu->callback(DesktopLockMenuEventLock, lock_menu->context);
// }
} else if(idx == DesktopLockMenuIndexStealth) {
if((stealth_mode == false) && (event->type == InputTypeShort)) {
lock_menu->callback(DesktopLockMenuEventStealthModeOn, lock_menu->context);