1
0
forked from me/IronOS

Dropping single line menu support

This commit is contained in:
Ben V. Brown
2020-09-06 16:44:19 +10:00
parent c7bde079cd
commit aa78ca2594
5 changed files with 660 additions and 717 deletions

View File

@@ -9,16 +9,12 @@
#define TRANSLATION_H_
#include "unit.h"
#include "stdint.h"
enum ShortNameType {
SHORT_NAME_SINGLE_LINE = 1, SHORT_NAME_DOUBLE_LINE = 2,
};
extern const uint8_t USER_FONT_12[];
extern const uint8_t USER_FONT_6x8[];
/*
* When SettingsShortNameType is SHORT_NAME_SINGLE_LINE
* use SettingsShortNames as SettingsShortNames[16][1].. second column undefined
*/
extern const enum ShortNameType SettingsShortNameType;
extern const char *SettingsShortNames[28][2];
extern const char *SettingsDescriptions[28];
extern const char *SettingsMenuEntries[4];

View File

@@ -230,12 +230,6 @@ const menuitem advancedMenu[] = {
{ NULL, NULL, NULL } // end of menu marker. DO NOT REMOVE
};
static void printShortDescriptionSingleLine(uint32_t shortDescIndex) {
OLED::setFont(0);
OLED::setCharCursor(0, 0);
OLED::print(SettingsShortNames[shortDescIndex][0]);
}
static void printShortDescriptionDoubleLine(uint32_t shortDescIndex) {
OLED::setFont(1);
OLED::setCharCursor(0, 0);
@@ -254,11 +248,7 @@ static void printShortDescriptionDoubleLine(uint32_t shortDescIndex) {
static void printShortDescription(uint32_t shortDescIndex,
uint16_t cursorCharPosition) {
// print short description (default single line, explicit double line)
if (SettingsShortNameType == SHORT_NAME_DOUBLE_LINE) {
printShortDescriptionDoubleLine(shortDescIndex);
} else {
printShortDescriptionSingleLine(shortDescIndex);
}
printShortDescriptionDoubleLine(shortDescIndex);
// prepare cursor for value
OLED::setFont(0);