mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-28 05:30:30 +00:00
Compare commits
3 Commits
develop
...
baseui_tem
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c27c84b5f | ||
|
|
fbd866fda3 | ||
|
|
ae770e9c6c |
@@ -325,7 +325,7 @@ void drawCommonHeader(OLEDDisplay *display, int16_t x, int16_t y, const char *ti
|
|||||||
int iconX = iconRightEdge - mute_symbol_width;
|
int iconX = iconRightEdge - mute_symbol_width;
|
||||||
int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2;
|
int iconY = textY + (FONT_HEIGHT_SMALL - mail_height) / 2;
|
||||||
|
|
||||||
if (isInverted) {
|
if (isInverted && !force_no_invert) {
|
||||||
display->setColor(WHITE);
|
display->setColor(WHITE);
|
||||||
display->fillRect(iconX - 1, iconY - 1, mute_symbol_width + 2, mute_symbol_height + 2);
|
display->fillRect(iconX - 1, iconY - 1, mute_symbol_width + 2, mute_symbol_height + 2);
|
||||||
display->setColor(BLACK);
|
display->setColor(BLACK);
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
#include "mesh/MeshTypes.h"
|
#include "mesh/MeshTypes.h"
|
||||||
#include "modules/AdminModule.h"
|
#include "modules/AdminModule.h"
|
||||||
#include "modules/CannedMessageModule.h"
|
#include "modules/CannedMessageModule.h"
|
||||||
|
#include "modules/ExternalNotificationModule.h"
|
||||||
#include "modules/KeyVerificationModule.h"
|
#include "modules/KeyVerificationModule.h"
|
||||||
|
|
||||||
#include "modules/TraceRouteModule.h"
|
#include "modules/TraceRouteModule.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <array>
|
#include <array>
|
||||||
@@ -843,12 +843,20 @@ void menuHandler::messageViewModeMenu()
|
|||||||
|
|
||||||
void menuHandler::homeBaseMenu()
|
void menuHandler::homeBaseMenu()
|
||||||
{
|
{
|
||||||
enum optionsNumbers { Back, Backlight, Position, Preset, Freetext, Sleep, enumEnd };
|
enum optionsNumbers { Back, Mute, Backlight, Position, Preset, Freetext, Sleep, enumEnd };
|
||||||
|
|
||||||
static const char *optionsArray[enumEnd] = {"Back"};
|
static const char *optionsArray[enumEnd] = {"Back"};
|
||||||
static int optionsEnumArray[enumEnd] = {Back};
|
static int optionsEnumArray[enumEnd] = {Back};
|
||||||
int options = 1;
|
int options = 1;
|
||||||
|
|
||||||
|
if (config.device.buzzer_mode != meshtastic_Config_DeviceConfig_BuzzerMode_DISABLED) {
|
||||||
|
if (!isMuted) {
|
||||||
|
optionsArray[options] = "Temporarily Mute";
|
||||||
|
} else {
|
||||||
|
optionsArray[options] = "Unmute";
|
||||||
|
}
|
||||||
|
optionsEnumArray[options++] = Mute;
|
||||||
|
}
|
||||||
#if defined(PIN_EINK_EN) || defined(PCA_PIN_EINK_EN)
|
#if defined(PIN_EINK_EN) || defined(PCA_PIN_EINK_EN)
|
||||||
optionsArray[options] = "Toggle Backlight";
|
optionsArray[options] = "Toggle Backlight";
|
||||||
optionsEnumArray[options++] = Backlight;
|
optionsEnumArray[options++] = Backlight;
|
||||||
@@ -872,7 +880,14 @@ void menuHandler::homeBaseMenu()
|
|||||||
bannerOptions.optionsEnumPtr = optionsEnumArray;
|
bannerOptions.optionsEnumPtr = optionsEnumArray;
|
||||||
bannerOptions.optionsCount = options;
|
bannerOptions.optionsCount = options;
|
||||||
bannerOptions.bannerCallback = [](int selected) -> void {
|
bannerOptions.bannerCallback = [](int selected) -> void {
|
||||||
if (selected == Backlight) {
|
if (selected == Mute) {
|
||||||
|
if (moduleConfig.external_notification.enabled && externalNotificationModule) {
|
||||||
|
bool isMuted = externalNotificationModule->getMute();
|
||||||
|
externalNotificationModule->setMute(!isMuted);
|
||||||
|
IF_SCREEN(graphics::isMuted = !isMuted; if (!isMuted) externalNotificationModule->stopNow();)
|
||||||
|
}
|
||||||
|
} else if (selected == Backlight) {
|
||||||
|
screen->setOn(false);
|
||||||
#if defined(PIN_EINK_EN)
|
#if defined(PIN_EINK_EN)
|
||||||
if (uiconfig.screen_brightness == 1) {
|
if (uiconfig.screen_brightness == 1) {
|
||||||
uiconfig.screen_brightness = 0;
|
uiconfig.screen_brightness = 0;
|
||||||
@@ -949,6 +964,7 @@ void menuHandler::systemBaseMenu()
|
|||||||
|
|
||||||
optionsArray[options] = "Notifications";
|
optionsArray[options] = "Notifications";
|
||||||
optionsEnumArray[options++] = Notifications;
|
optionsEnumArray[options++] = Notifications;
|
||||||
|
|
||||||
optionsArray[options] = "Display Options";
|
optionsArray[options] = "Display Options";
|
||||||
optionsEnumArray[options++] = ScreenOptions;
|
optionsEnumArray[options++] = ScreenOptions;
|
||||||
|
|
||||||
@@ -985,7 +1001,7 @@ void menuHandler::systemBaseMenu()
|
|||||||
bannerOptions.optionsEnumPtr = optionsEnumArray;
|
bannerOptions.optionsEnumPtr = optionsEnumArray;
|
||||||
bannerOptions.bannerCallback = [](int selected) -> void {
|
bannerOptions.bannerCallback = [](int selected) -> void {
|
||||||
if (selected == Notifications) {
|
if (selected == Notifications) {
|
||||||
menuHandler::menuQueue = menuHandler::notifications_menu;
|
menuHandler::menuQueue = menuHandler::buzzermodemenupicker;
|
||||||
screen->runNow();
|
screen->runNow();
|
||||||
} else if (selected == ScreenOptions) {
|
} else if (selected == ScreenOptions) {
|
||||||
menuHandler::menuQueue = menuHandler::screen_options_menu;
|
menuHandler::menuQueue = menuHandler::screen_options_menu;
|
||||||
@@ -1604,9 +1620,9 @@ void menuHandler::BluetoothToggleMenu()
|
|||||||
|
|
||||||
void menuHandler::BuzzerModeMenu()
|
void menuHandler::BuzzerModeMenu()
|
||||||
{
|
{
|
||||||
static const char *optionsArray[] = {"All Enabled", "Disabled", "Notifications", "System Only", "DMs Only"};
|
static const char *optionsArray[] = {"All Enabled", "All Disabled", "Notifications", "System Only", "DMs Only"};
|
||||||
BannerOverlayOptions bannerOptions;
|
BannerOverlayOptions bannerOptions;
|
||||||
bannerOptions.message = "Buzzer Mode";
|
bannerOptions.message = "Notification Sounds";
|
||||||
bannerOptions.optionsArrayPtr = optionsArray;
|
bannerOptions.optionsArrayPtr = optionsArray;
|
||||||
bannerOptions.optionsCount = 5;
|
bannerOptions.optionsCount = 5;
|
||||||
bannerOptions.bannerCallback = [](int selected) -> void {
|
bannerOptions.bannerCallback = [](int selected) -> void {
|
||||||
@@ -1981,30 +1997,6 @@ void menuHandler::wifiToggleMenu()
|
|||||||
screen->showOverlayBanner(bannerOptions);
|
screen->showOverlayBanner(bannerOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
void menuHandler::notificationsMenu()
|
|
||||||
{
|
|
||||||
enum optionsNumbers { Back, BuzzerActions };
|
|
||||||
static const char *optionsArray[] = {"Back", "Buzzer Actions"};
|
|
||||||
static int optionsEnumArray[] = {Back, BuzzerActions};
|
|
||||||
int options = 2;
|
|
||||||
|
|
||||||
BannerOverlayOptions bannerOptions;
|
|
||||||
bannerOptions.message = "Notifications";
|
|
||||||
bannerOptions.optionsArrayPtr = optionsArray;
|
|
||||||
bannerOptions.optionsCount = options;
|
|
||||||
bannerOptions.optionsEnumPtr = optionsEnumArray;
|
|
||||||
bannerOptions.bannerCallback = [](int selected) -> void {
|
|
||||||
if (selected == BuzzerActions) {
|
|
||||||
menuHandler::menuQueue = menuHandler::buzzermodemenupicker;
|
|
||||||
screen->runNow();
|
|
||||||
} else {
|
|
||||||
menuQueue = system_base_menu;
|
|
||||||
screen->runNow();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
screen->showOverlayBanner(bannerOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
void menuHandler::screenOptionsMenu()
|
void menuHandler::screenOptionsMenu()
|
||||||
{
|
{
|
||||||
// Check if brightness is supported
|
// Check if brightness is supported
|
||||||
@@ -2422,9 +2414,6 @@ void menuHandler::handleMenuSwitch(OLEDDisplay *display)
|
|||||||
case bluetooth_toggle_menu:
|
case bluetooth_toggle_menu:
|
||||||
BluetoothToggleMenu();
|
BluetoothToggleMenu();
|
||||||
break;
|
break;
|
||||||
case notifications_menu:
|
|
||||||
notificationsMenu();
|
|
||||||
break;
|
|
||||||
case screen_options_menu:
|
case screen_options_menu:
|
||||||
screenOptionsMenu();
|
screenOptionsMenu();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ class menuHandler
|
|||||||
number_test,
|
number_test,
|
||||||
wifi_toggle_menu,
|
wifi_toggle_menu,
|
||||||
bluetooth_toggle_menu,
|
bluetooth_toggle_menu,
|
||||||
notifications_menu,
|
|
||||||
screen_options_menu,
|
screen_options_menu,
|
||||||
power_menu,
|
power_menu,
|
||||||
system_base_menu,
|
system_base_menu,
|
||||||
@@ -98,7 +97,6 @@ class menuHandler
|
|||||||
static void numberTest();
|
static void numberTest();
|
||||||
static void wifiBaseMenu();
|
static void wifiBaseMenu();
|
||||||
static void wifiToggleMenu();
|
static void wifiToggleMenu();
|
||||||
static void notificationsMenu();
|
|
||||||
static void screenOptionsMenu();
|
static void screenOptionsMenu();
|
||||||
static void powerMenu();
|
static void powerMenu();
|
||||||
static void nodeNameLengthMenu();
|
static void nodeNameLengthMenu();
|
||||||
|
|||||||
Reference in New Issue
Block a user