Aligned the protocol selector in multiline for narrow screen.
This commit is contained in:
@@ -640,10 +640,12 @@ class ModuleWindow : public FormGroup {
|
|||||||
|
|
||||||
// Multi type (CUSTOM, brand A, brand B,...)
|
// Multi type (CUSTOM, brand A, brand B,...)
|
||||||
int multiRfProto = g_model.moduleData[moduleIdx].getMultiProtocol();
|
int multiRfProto = g_model.moduleData[moduleIdx].getMultiProtocol();
|
||||||
|
|
||||||
|
// Grid count for narrow/wide screen
|
||||||
|
int count = LCD_W < LCD_H ? 1 : (g_model.moduleData[moduleIdx].multi.customProto ? 3 : 2);
|
||||||
rfChoice = new Choice(
|
rfChoice = new Choice(
|
||||||
this,
|
this,
|
||||||
grid.getFieldSlot(
|
grid.getFieldSlot(count, 0),
|
||||||
g_model.moduleData[moduleIdx].multi.customProto ? 3 : 2, 0),
|
|
||||||
STR_MULTI_PROTOCOLS, MODULE_SUBTYPE_MULTI_FIRST,
|
STR_MULTI_PROTOCOLS, MODULE_SUBTYPE_MULTI_FIRST,
|
||||||
MODULE_SUBTYPE_MULTI_LAST, GET_DEFAULT(multiRfProto),
|
MODULE_SUBTYPE_MULTI_LAST, GET_DEFAULT(multiRfProto),
|
||||||
[=](int32_t newValue) {
|
[=](int32_t newValue) {
|
||||||
@@ -658,11 +660,20 @@ class ModuleWindow : public FormGroup {
|
|||||||
|
|
||||||
if (MULTIMODULE_HAS_SUBTYPE(moduleIdx)) {
|
if (MULTIMODULE_HAS_SUBTYPE(moduleIdx)) {
|
||||||
// Subtype (D16, DSMX,...)
|
// Subtype (D16, DSMX,...)
|
||||||
|
|
||||||
|
// Grid count for narrow/wide screen
|
||||||
|
count = LCD_W < LCD_H ? 1 : 2;
|
||||||
|
int index = 1;
|
||||||
|
if (count == 1)
|
||||||
|
{
|
||||||
|
grid.nextLine();
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
const mm_protocol_definition *pdef = getMultiProtocolDefinition(
|
const mm_protocol_definition *pdef = getMultiProtocolDefinition(
|
||||||
g_model.moduleData[moduleIdx].getMultiProtocol());
|
g_model.moduleData[moduleIdx].getMultiProtocol());
|
||||||
if (pdef->maxSubtype > 0) {
|
if (pdef->maxSubtype > 0) {
|
||||||
mmSubProtocol = new Choice(
|
mmSubProtocol = new Choice(
|
||||||
this, grid.getFieldSlot(2, 1), pdef->subTypeString, 0,
|
this, grid.getFieldSlot(count, index), pdef->subTypeString, 0,
|
||||||
pdef->maxSubtype,
|
pdef->maxSubtype,
|
||||||
[=]() { return g_model.moduleData[moduleIdx].subType; },
|
[=]() { return g_model.moduleData[moduleIdx].subType; },
|
||||||
[=](int16_t newValue) {
|
[=](int16_t newValue) {
|
||||||
|
|||||||
Reference in New Issue
Block a user