Cosmetics

This commit is contained in:
Bertrand Songis
2019-03-09 11:23:16 +01:00
parent 2ce2f082db
commit aee6daf0d0
10 changed files with 47 additions and 16 deletions
+5 -5
View File
@@ -281,11 +281,11 @@ void drawStatusLine();
#endif
#define TEXT_FILENAME_MAXLEN 40
extern char s_text_file[TEXT_FILENAME_MAXLEN];
void menuTextView(event_t event);
void pushMenuTextView(const char *filename);
void pushModelNotes();
void readModelNotes();
extern char s_text_file[TEXT_FILENAME_MAXLEN];
void menuTextView(event_t event);
void pushMenuTextView(const char *filename);
void pushModelNotes();
void readModelNotes();
#define LABEL(...) (uint8_t)-1
+10
View File
@@ -57,6 +57,16 @@ void chainMenu(MenuHandlerFunc newMenu);
void pushMenu(MenuHandlerFunc newMenu);
void popMenu();
inline bool isRadioMenuDisplayed()
{
return menuVerticalPositions[0] == 1;
}
inline bool isModelMenuDisplayed()
{
return menuVerticalPositions[0] == 0;
}
inline MenuHandlerFunc lastPopMenu()
{
return menuHandlers[menuLevel+1];
+6 -2
View File
@@ -428,7 +428,7 @@ void menuModelSetup(event_t event)
NUM_STICKS + NUM_POTS + NUM_SLIDERS + NUM_ROTARY_ENCODERS - 1, // Center beeps
0, // Global functions
isDefaultModelRegistrationID() ? HIDDEN_ROW : READONLY_ROW, // Registration ID
READONLY_ROW, // Registration ID
LABEL(InternalModule),
INTERNAL_MODULE_MODE_ROWS, // module mode (PXX(2) / None)
@@ -1185,7 +1185,11 @@ void menuModelSetup(event_t event)
#if defined(PCBTARANIS)
case ITEM_MODEL_REGISTRATION_ID:
editSingleName(MODEL_SETUP_2ND_COLUMN, y, STR_REG_ID, g_model.modelRegistrationID, sizeof(g_model.modelRegistrationID), event, attr);
lcdDrawTextAlignedLeft(y, STR_REG_ID);
if (isDefaultModelRegistrationID())
lcdDrawText(MODEL_SETUP_2ND_COLUMN, y, "<default>");
else
lcdDrawSizedText(MODEL_SETUP_2ND_COLUMN, y, g_model.modelRegistrationID, sizeof(g_model.modelRegistrationID), ZCHAR);
break;
case ITEM_MODEL_INTERNAL_MODULE_PXX2_MODEL_NUM:
+1 -1
View File
@@ -74,7 +74,7 @@ choice_t editChoice(coord_t x, coord_t y, const char * label, const char *values
{
drawFieldLabel(x, y, label);
if (values) lcdDrawTextAtIndex(x, y, values, value-min, attr);
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (menuVerticalPositions[0] == 0) ? EE_MODEL : EE_GENERAL);
if (attr & (~RIGHT)) value = checkIncDec(event, value, min, max, (isModelMenuDisplayed()) ? EE_MODEL : EE_GENERAL);
return value;
}