Merge with latest libopenui changes

This commit is contained in:
Bertrand Songis
2019-10-23 14:49:04 +02:00
parent 1641909375
commit d2322526eb
9 changed files with 10 additions and 12 deletions
+1 -1
View File
@@ -354,7 +354,7 @@ void ModelGVarsPage::build(FormWindow * window)
return 0; return 0;
}); });
grid.nextLine(button->getHeight()); grid.nextLine(button->height());
} }
window->setInnerHeight(grid.getWindowHeight()); window->setInnerHeight(grid.getWindowHeight());
} }
+1 -1
View File
@@ -328,7 +328,7 @@ class InputLineButton : public CommonInputOrMixButton {
{ {
const ExpoData & line = g_model.expoData[index]; const ExpoData & line = g_model.expoData[index];
if (line.swtch || line.curve.value != 0 || line.flightModes) { if (line.swtch || line.curve.value != 0 || line.flightModes) {
setHeight(getHeight() + PAGE_LINE_HEIGHT); setHeight(height() + PAGE_LINE_HEIGHT);
} }
} }
@@ -241,9 +241,9 @@ class LogicalSwitchButton : public Button {
{ {
LogicalSwitchData * ls = lswAddress(lsIndex); LogicalSwitchData * ls = lswAddress(lsIndex);
if (ls->andsw != SWSRC_NONE || ls->duration != 0 || ls->delay != 0) if (ls->andsw != SWSRC_NONE || ls->duration != 0 || ls->delay != 0)
setHeight(getHeight() + 20); setHeight(height() + 20);
if (lswFamily(ls->func) == LS_FAMILY_EDGE) if (lswFamily(ls->func) == LS_FAMILY_EDGE)
setHeight(getHeight() + 20); setHeight(height() + 20);
} }
bool isActive() bool isActive()
+1 -1
View File
@@ -233,7 +233,7 @@ class MixLineButton : public CommonInputOrMixButton {
{ {
const MixData & mix = g_model.mixData[index]; const MixData & mix = g_model.mixData[index];
if (mix.swtch || mix.curve.value != 0 || mix.flightModes) { if (mix.swtch || mix.curve.value != 0 || mix.flightModes) {
setHeight(getHeight() + PAGE_LINE_HEIGHT); setHeight(height() + PAGE_LINE_HEIGHT);
} }
} }
+1 -1
View File
@@ -114,7 +114,7 @@ class OutputLineButton : public Button {
output(output) output(output)
{ {
if (output->revert || output->curve || output->name[0]) { if (output->revert || output->curve || output->name[0]) {
setHeight(getHeight() + PAGE_LINE_HEIGHT); setHeight(height() + PAGE_LINE_HEIGHT);
} }
} }
+1 -3
View File
@@ -64,12 +64,10 @@ void RadioTrainerPage::build(FormWindow * window)
new StaticText(window, grid.getLabelSlot(), STR_CAL); new StaticText(window, grid.getLabelSlot(), STR_CAL);
for (int i = 0; i < NUM_STICKS; i++) { for (int i = 0; i < NUM_STICKS; i++) {
#if defined (PPM_UNIT_PERCENT_PREC1) #if defined (PPM_UNIT_PERCENT_PREC1)
auto calib = new NumberEdit(window, grid.getFieldSlot(4, i), 0 , 0, [=]() { return (ppmInput[i]-g_eeGeneral.trainer.calib[i]) * 2; }, nullptr, LEFT|PREC1); auto calib = new NumberEdit(window, grid.getFieldSlot(4, i), 0 , 0, [=]() { return (ppmInput[i]-g_eeGeneral.trainer.calib[i]) * 2; }, nullptr, LEFT | PREC1);
#else #else
auto calib = new NumberEdit(window, grid.getFieldSlot(4, i), 0 , 0, [=]() { return (ppmInput[i]-g_eeGeneral.trainer.calib[i]) / 5; }, nullptr, LEFT); auto calib = new NumberEdit(window, grid.getFieldSlot(4, i), 0 , 0, [=]() { return (ppmInput[i]-g_eeGeneral.trainer.calib[i]) / 5; }, nullptr, LEFT);
#endif #endif
calib->setWindowFlags(REFRESH_ALWAYS); calib->setWindowFlags(REFRESH_ALWAYS);
FormField::link(multiplier, window->getFirstField());
} }
} }
+1 -1
View File
@@ -33,7 +33,7 @@ class OptionsText : public StaticText {
const char * option = options[i]; const char * option = options[i];
optionWidth += getTextWidth(option); optionWidth += getTextWidth(option);
if (optionWidth + 5 > width()) { if (optionWidth + 5 > width()) {
setHeight(getHeight() + 20); setHeight(height() + 20);
optionWidth = 0; optionWidth = 0;
} }
} }
+1 -1
View File
@@ -253,7 +253,7 @@ class SpecialFunctionButton : public Button {
uint8_t func = CFN_FUNC(cfn); uint8_t func = CFN_FUNC(cfn);
if (!cfn->isEmpty() && if (!cfn->isEmpty() &&
(HAS_ENABLE_PARAM(func) || HAS_REPEAT_PARAM(func) || (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT))) { (HAS_ENABLE_PARAM(func) || HAS_REPEAT_PARAM(func) || (func == FUNC_PLAY_TRACK || func == FUNC_BACKGND_MUSIC || func == FUNC_PLAY_SCRIPT))) {
setHeight(getHeight() + 20); setHeight(height() + 20);
} }
} }