Fix GVARS=NO output values not correctly applied or editing correctly (#1264)

This commit is contained in:
eshifri
2021-12-19 17:53:34 +10:00
committed by GitHub
parent a4c718f6b7
commit a892cc2dac
2 changed files with 6 additions and 14 deletions
+4 -5
View File
@@ -29,9 +29,7 @@
constexpr coord_t GVAR_BUTTON_WIDTH = 30;
#if !defined(GVARS)
typedef NumberEdit GVarNumberEdit;
#else
class GVarNumberEdit : public FormGroup
{
public:
@@ -128,7 +126,7 @@ class GVarNumberEdit : public FormGroup
result->setSuffix(suffix);
field = result;
}
#if defined(GVARS)
// The GVAR button
new TextButton(
this, {width() - GVAR_BUTTON_WIDTH, 0, GVAR_BUTTON_WIDTH, height()},
@@ -138,8 +136,9 @@ class GVarNumberEdit : public FormGroup
return 0;
},
BUTTON_BACKGROUND | OPAQUE | FORM_DETACHED);
#endif
}
};
#endif
#endif // _GVAR_NUMBEREDIT_H_
+2 -9
View File
@@ -79,11 +79,7 @@ class OutputEditWindow : public Page {
COLOR_THEME_PRIMARY1);
new GVarNumberEdit(window, grid.getFieldSlot(), -limit, 0,
GET_SET_DEFAULT(output->min), 0, PREC1
#if defined(GVARS)
, -LIMIT_STD_MAX
#endif
);
, -LIMIT_STD_MAX);
grid.nextLine();
// Max
@@ -91,10 +87,7 @@ class OutputEditWindow : public Page {
COLOR_THEME_PRIMARY1);
new GVarNumberEdit(window, grid.getFieldSlot(), 0, +limit,
GET_SET_DEFAULT(output->max), 0, PREC1
#if defined(GVARS)
, +LIMIT_STD_MAX
#endif
);
, +LIMIT_STD_MAX);
grid.nextLine();
// Direction