colorlcd: Left align input names on Model Inputs tab (#1775)
This commit is contained in:
@@ -519,8 +519,7 @@ void ModelInputsPage::build(FormWindow *window, int8_t focusIndex)
|
|||||||
coord_t h = grid.getWindowHeight();
|
coord_t h = grid.getWindowHeight();
|
||||||
auto txt = new StaticText(window, grid.getLabelSlot(),
|
auto txt = new StaticText(window, grid.getLabelSlot(),
|
||||||
getSourceString(MIXSRC_FIRST_INPUT + input),
|
getSourceString(MIXSRC_FIRST_INPUT + input),
|
||||||
BUTTON_BACKGROUND, CENTERED | COLOR_THEME_PRIMARY1);
|
BUTTON_BACKGROUND, LEFT | COLOR_THEME_PRIMARY1);
|
||||||
|
|
||||||
while (inputIndex < MAX_EXPOS && line->chn == input && EXPO_VALID(line)) {
|
while (inputIndex < MAX_EXPOS && line->chn == input && EXPO_VALID(line)) {
|
||||||
Button *button =
|
Button *button =
|
||||||
new InputLineButton(window, grid.getFieldSlot(), inputIndex);
|
new InputLineButton(window, grid.getFieldSlot(), inputIndex);
|
||||||
@@ -576,10 +575,10 @@ void ModelInputsPage::build(FormWindow *window, int8_t focusIndex)
|
|||||||
button->setFocusHandler([=](bool focus) {
|
button->setFocusHandler([=](bool focus) {
|
||||||
if (focus) {
|
if (focus) {
|
||||||
txt->setBackgroundColor(COLOR_THEME_FOCUS);
|
txt->setBackgroundColor(COLOR_THEME_FOCUS);
|
||||||
txt->setTextFlags(COLOR_THEME_PRIMARY2 | CENTERED);
|
txt->setTextFlags(COLOR_THEME_PRIMARY2 | LEFT);
|
||||||
} else {
|
} else {
|
||||||
txt->setBackgroundColor(COLOR_THEME_SECONDARY2);
|
txt->setBackgroundColor(COLOR_THEME_SECONDARY2);
|
||||||
txt->setTextFlags(COLOR_THEME_PRIMARY1 | CENTERED);
|
txt->setTextFlags(COLOR_THEME_PRIMARY1 | LEFT);
|
||||||
}
|
}
|
||||||
txt->invalidate();
|
txt->invalidate();
|
||||||
if (focus) button->bringToTop();
|
if (focus) button->bringToTop();
|
||||||
@@ -588,7 +587,7 @@ void ModelInputsPage::build(FormWindow *window, int8_t focusIndex)
|
|||||||
if (focusIndex == inputIndex) {
|
if (focusIndex == inputIndex) {
|
||||||
button->setFocus(SET_FOCUS_DEFAULT);
|
button->setFocus(SET_FOCUS_DEFAULT);
|
||||||
txt->setBackgroundColor(COLOR_THEME_FOCUS);
|
txt->setBackgroundColor(COLOR_THEME_FOCUS);
|
||||||
txt->setTextFlags(COLOR_THEME_PRIMARY2 | CENTERED);
|
txt->setTextFlags(COLOR_THEME_PRIMARY2 | LEFT);
|
||||||
txt->invalidate();
|
txt->invalidate();
|
||||||
}
|
}
|
||||||
grid.spacer(button->height() - 1);
|
grid.spacer(button->height() - 1);
|
||||||
@@ -602,7 +601,9 @@ void ModelInputsPage::build(FormWindow *window, int8_t focusIndex)
|
|||||||
grid.spacer(7);
|
grid.spacer(7);
|
||||||
} else {
|
} else {
|
||||||
auto button = new TextButton(window, grid.getLabelSlot(),
|
auto button = new TextButton(window, grid.getLabelSlot(),
|
||||||
getSourceString(MIXSRC_FIRST_INPUT + input));
|
getSourceString(MIXSRC_FIRST_INPUT + input),
|
||||||
|
nullptr, BUTTON_BACKGROUND,
|
||||||
|
COLOR_THEME_PRIMARY1 | RIGHT);
|
||||||
button->setPressHandler([=]() -> uint8_t {
|
button->setPressHandler([=]() -> uint8_t {
|
||||||
button->bringToTop();
|
button->bringToTop();
|
||||||
Menu *menu = new Menu(window);
|
Menu *menu = new Menu(window);
|
||||||
|
|||||||
Reference in New Issue
Block a user