mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-23 13:38:01 +00:00
Update Bluetooth Toggle to match other variants (#7269)
This commit is contained in:
parent
db4e4e6e53
commit
916587c2a6
@ -337,8 +337,8 @@ void menuHandler::homeBaseMenu()
|
|||||||
} else if (selected == Freetext) {
|
} else if (selected == Freetext) {
|
||||||
cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST);
|
cannedMessageModule->LaunchFreetextWithDestination(NODENUM_BROADCAST);
|
||||||
} else if (selected == Bluetooth) {
|
} else if (selected == Bluetooth) {
|
||||||
InputEvent event = {.inputEvent = (input_broker_event)170, .kbchar = 170, .touchX = 0, .touchY = 0};
|
menuQueue = bluetooth_toggle_menu;
|
||||||
inputBroker->injectInputEvent(&event);
|
screen->runNow();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
screen->showOverlayBanner(bannerOptions);
|
screen->showOverlayBanner(bannerOptions);
|
||||||
@ -587,6 +587,23 @@ void menuHandler::GPSToggleMenu()
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void menuHandler::BluetoothToggleMenu()
|
||||||
|
{
|
||||||
|
static const char *optionsArray[] = {"Back", "Enabled", "Disabled"};
|
||||||
|
BannerOverlayOptions bannerOptions;
|
||||||
|
bannerOptions.message = "Toggle Bluetooth";
|
||||||
|
bannerOptions.optionsArrayPtr = optionsArray;
|
||||||
|
bannerOptions.optionsCount = 3;
|
||||||
|
bannerOptions.bannerCallback = [](int selected) -> void {
|
||||||
|
if (selected == 1 || selected == 2) {
|
||||||
|
InputEvent event = {.inputEvent = (input_broker_event)170, .kbchar = 170, .touchX = 0, .touchY = 0};
|
||||||
|
inputBroker->injectInputEvent(&event);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
bannerOptions.InitialSelected = config.bluetooth.enabled ? 1 : 2;
|
||||||
|
screen->showOverlayBanner(bannerOptions);
|
||||||
|
}
|
||||||
|
|
||||||
void menuHandler::BuzzerModeMenu()
|
void menuHandler::BuzzerModeMenu()
|
||||||
{
|
{
|
||||||
static const char *optionsArray[] = {"All Enabled", "Disabled", "Notifications", "System Only"};
|
static const char *optionsArray[] = {"All Enabled", "Disabled", "Notifications", "System Only"};
|
||||||
@ -935,6 +952,9 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display)
|
|||||||
case wifi_toggle_menu:
|
case wifi_toggle_menu:
|
||||||
wifiToggleMenu();
|
wifiToggleMenu();
|
||||||
break;
|
break;
|
||||||
|
case bluetooth_toggle_menu:
|
||||||
|
BluetoothToggleMenu();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
menuQueue = menu_none;
|
menuQueue = menu_none;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,8 @@ class menuHandler
|
|||||||
remove_favorite,
|
remove_favorite,
|
||||||
test_menu,
|
test_menu,
|
||||||
number_test,
|
number_test,
|
||||||
wifi_toggle_menu
|
wifi_toggle_menu,
|
||||||
|
bluetooth_toggle_menu
|
||||||
};
|
};
|
||||||
static screenMenus menuQueue;
|
static screenMenus menuQueue;
|
||||||
|
|
||||||
@ -55,6 +56,7 @@ class menuHandler
|
|||||||
static void numberTest();
|
static void numberTest();
|
||||||
static void wifiBaseMenu();
|
static void wifiBaseMenu();
|
||||||
static void wifiToggleMenu();
|
static void wifiToggleMenu();
|
||||||
|
static void BluetoothToggleMenu();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace graphics
|
} // namespace graphics
|
Loading…
Reference in New Issue
Block a user