Cosmetics

This commit is contained in:
3djc
2019-12-12 16:16:19 +01:00
parent ace69a4889
commit ca95c25a15
3 changed files with 25 additions and 23 deletions
+6 -6
View File
@@ -23,9 +23,9 @@
constexpr coord_t ANA_OFFSET = 150; constexpr coord_t ANA_OFFSET = 150;
class RadioAnaDiagsWindow: public Window { class RadioAnalogsDiagsWindow: public Window {
public: public:
RadioAnaDiagsWindow(Window * parent, const rect_t & rect): RadioAnalogsDiagsWindow(Window * parent, const rect_t & rect):
Window(parent, rect) Window(parent, rect)
{ {
} }
@@ -51,17 +51,17 @@ class RadioAnaDiagsWindow: public Window {
protected: protected:
}; };
void RadioAnaDiagsPage::buildHeader(Window * window) void RadioAnalogsDiagsPage::buildHeader(Window * window)
{ {
new StaticText(window, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + 10, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT}, STR_MENU_RADIO_ANALOGS, 0, MENU_COLOR); new StaticText(window, {PAGE_TITLE_LEFT, PAGE_TITLE_TOP + 10, LCD_W - PAGE_TITLE_LEFT, PAGE_LINE_HEIGHT}, STR_MENU_RADIO_ANALOGS, 0, MENU_COLOR);
} }
void RadioAnaDiagsPage::buildBody(Window * window) void RadioAnalogsDiagsPage::buildBody(Window * window)
{ {
new RadioAnaDiagsWindow(window, {10, 10, window->width() - 10, window->height() - 10}); new RadioAnalogsDiagsWindow(window, {10, 10, window->width() - 10, window->height() - 10});
} }
RadioAnaDiagsPage::RadioAnaDiagsPage(): RadioAnalogsDiagsPage::RadioAnalogsDiagsPage():
Page(ICON_MODEL_SETUP) Page(ICON_MODEL_SETUP)
{ {
buildHeader(&header); buildHeader(&header);
+2 -2
View File
@@ -20,9 +20,9 @@
#include "page.h" #include "page.h"
class RadioAnaDiagsPage: public Page { class RadioAnalogsDiagsPage: public Page {
public: public:
explicit RadioAnaDiagsPage(); explicit RadioAnalogsDiagsPage();
protected: protected:
void buildHeader(Window * window); void buildHeader(Window * window);
+17 -15
View File
@@ -64,22 +64,19 @@ class RadioKeyDiagsWindow : public Window
dc->drawText(TRIM_MINUS_COLUMN, 1, "-"); dc->drawText(TRIM_MINUS_COLUMN, 1, "-");
dc->drawText(TRIM_PLUS_COLUMN, 1, "+"); dc->drawText(TRIM_PLUS_COLUMN, 1, "+");
for (uint8_t i = 0; i < NUM_TRIMS_KEYS; i++) { //KEYS
const uint8_t trimMap[NUM_TRIMS_KEYS] = {6, 7, 4, 5, 2, 3, 0, 1, 8, 9, 10, 11};
coord_t y = 1 + FH + FH * (i / 2);
if (i & 1) {
dc->drawText(TRIM_COLUMN, y, "T", 0);
dc->drawNumber(TRIM_COLUMN + 10, y, i / 2 + 1, 0);
}
displayKeyState(dc, i & 1 ? TRIM_PLUS_COLUMN : TRIM_MINUS_COLUMN, y, TRM_BASE + trimMap[i]);
}
for (uint8_t i = KEY_START; i <= 6; i++) { for (uint8_t i = KEY_START; i <= 6; i++) {
coord_t y = 1 + FH * (i - KEY_START); coord_t y = 1 + FH * (i - KEY_START);
dc->drawTextAtIndex(KEY_COLUMN, y, STR_VKEYS, (i), 0); dc->drawTextAtIndex(KEY_COLUMN, y, STR_VKEYS, (i), 0);
displayKeyState(dc, 70, y, i); displayKeyState(dc, 70, y, i);
} }
#if defined(ROTARY_ENCODER_NAVIGATION)
coord_t y = FH * (8 - KEY_START);
dc->drawText(KEY_COLUMN, y, STR_ROTARY_ENCODER);
dc->drawNumber(70, y, rotencValue, 0);
#endif
// SWITCHES
for (uint8_t i = 0; i <= NUM_SWITCHES; i++) { for (uint8_t i = 0; i <= NUM_SWITCHES; i++) {
if (SWITCH_EXISTS(i)) { if (SWITCH_EXISTS(i)) {
coord_t y = 1 + FH * i; coord_t y = 1 + FH * i;
@@ -89,11 +86,16 @@ class RadioKeyDiagsWindow : public Window
} }
} }
#if defined(ROTARY_ENCODER_NAVIGATION) //TRIMS
coord_t y = FH * (8 - KEY_START); for (uint8_t i = 0; i < NUM_TRIMS_KEYS; i++) {
dc->drawText(KEY_COLUMN, y, STR_ROTARY_ENCODER); const uint8_t trimMap[NUM_TRIMS_KEYS] = {6, 7, 4, 5, 2, 3, 0, 1, 8, 9, 10, 11};
dc->drawNumber(70, y, rotencValue, 0); coord_t y = 1 + FH + FH * (i / 2);
#endif if (i & 1) {
dc->drawText(TRIM_COLUMN, y, "T", 0);
dc->drawNumber(TRIM_COLUMN + 10, y, i / 2 + 1, 0);
}
displayKeyState(dc, i & 1 ? TRIM_PLUS_COLUMN : TRIM_MINUS_COLUMN, y, TRM_BASE + trimMap[i]);
}
}; };
protected: protected: