feat(colorlcd): Value widget text alignment options (#3080)
* Adds option to align value widget label and value to left, center or right border of the widget zone. * Cpn sync * Typofix thx to @Eldenroot * fix: Add `TW` translation * fix: Two spaces for indent --------- Co-authored-by: elecpower <neilh713@tpg.com.au>
This commit is contained in:
@@ -2823,6 +2823,7 @@ LROT_BEGIN(etxcst, NULL, 0)
|
||||
LROT_NUMENTRY( STRING, ZoneOption::String )
|
||||
LROT_NUMENTRY( TIMER, ZoneOption::Timer )
|
||||
LROT_NUMENTRY( TEXT_SIZE, ZoneOption::TextSize )
|
||||
LROT_NUMENTRY( ALIGNMENT, ZoneOption::Align )
|
||||
LROT_NUMENTRY( MENU_HEADER_HEIGHT, COLOR2FLAGS(MENU_HEADER_HEIGHT) )
|
||||
|
||||
// Colors gui/colorlcd/colors.h
|
||||
|
||||
@@ -162,7 +162,8 @@ ZoneOption *createOptionsArray(int reference, uint8_t maxOptions)
|
||||
option->deflt.signedValue = lua_tointeger(lsWidgets, -1);
|
||||
// TRACE("default signed = %d", option->deflt.signedValue);
|
||||
} else if (option->type == ZoneOption::Source ||
|
||||
option->type == ZoneOption::TextSize) {
|
||||
option->type == ZoneOption::TextSize ||
|
||||
option->type == ZoneOption::Align) {
|
||||
luaL_checktype(lsWidgets, -1, LUA_TNUMBER); // value is number
|
||||
option->deflt.unsignedValue = lua_tounsigned(lsWidgets, -1);
|
||||
// TRACE("default unsigned = %u", option->deflt.unsignedValue);
|
||||
|
||||
Reference in New Issue
Block a user