feat: use any source for expo/weight/offset (#5220)

Co-authored-by: philmoz <phil.a.mitchell@gmail.com>
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: elecpower <elecpower@users.noreply.github.com>
This commit is contained in:
philmoz
2024-07-26 20:51:21 +10:00
committed by GitHub
co-authored by philmoz 3djc elecpower
parent 326c58a7fd
commit 4b917b762c
87 changed files with 2751 additions and 1671 deletions
+24
View File
@@ -120,6 +120,30 @@ void drawSlider(coord_t x, coord_t y, uint8_t value, uint8_t max, uint8_t attr)
if (attr && (!(attr & BLINK) || !BLINK_ON_PHASE)) lcdDrawFilledRect(x, y, 5*FW-1, FH-1);
}
uint16_t editSrcVarFieldValue(coord_t x, coord_t y, const char* title, uint16_t value,
int16_t min, int16_t max, LcdFlags attr, event_t event,
IsValueAvailable isValueAvailable, int16_t sourceMin)
{
if (title)
lcdDrawTextAlignedLeft(y, title);
SourceNumVal v;
v.rawValue = value;
if (v.isSource) {
drawSource(x, y, v.value, attr);
if (attr & (~RIGHT)) {
value = checkIncDec(event, value, sourceMin,
MIXSRC_LAST, EE_MODEL|INCDEC_SOURCE|INCDEC_SOURCE_VALUE|INCDEC_SOURCE_INVERT|NO_INCDEC_MARKS, isValueAvailable);
}
} else {
lcdDrawNumber(x, y, v.value, attr);
if (attr & (~RIGHT)) {
value = checkIncDec(event, value, min, max,
EE_MODEL|INCDEC_SOURCE_VALUE|NO_INCDEC_MARKS|(sourceMin == INPUTSRC_FIRST ? INCDEC_SOURCE_NOINPUTS : 0));
}
}
return value;
}
#if defined(GVARS)
void drawGVarValue(coord_t x, coord_t y, uint8_t gvar, gvar_t value, LcdFlags flags)
{