libopenui TextButtons are not opaque by default anymore
This commit is contained in:
@@ -111,7 +111,7 @@ class GVarNumberEdit: public FormGroup
|
||||
new TextButton(this, {width() - GVAR_BUTTON_WIDTH, 0, GVAR_BUTTON_WIDTH, height()}, STR_GV, [=]() {
|
||||
switchGVarMode();
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | FORM_DETACHED);
|
||||
}, BUTTON_BACKGROUND | OPAQUE | FORM_DETACHED);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -34,42 +34,42 @@ CurveKeyboard::CurveKeyboard() :
|
||||
[=]() -> uint8_t {
|
||||
putEvent(EVT_VIRTUAL_KEY_UP);
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | NO_FOCUS);
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
|
||||
// down
|
||||
new TextButton(this, {LCD_W / 2 - 20, 65, 40, 40}, "\201",
|
||||
[=]() -> uint8_t {
|
||||
putEvent(EVT_VIRTUAL_KEY_DOWN);
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | NO_FOCUS);
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
|
||||
// left
|
||||
left = new TextButton(this, {LCD_W / 2 - 70, 35, 40, 40}, "\177",
|
||||
[=]() -> uint8_t {
|
||||
putEvent(EVT_VIRTUAL_KEY_LEFT);
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | NO_FOCUS);
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
|
||||
// right
|
||||
right = new TextButton(this, {LCD_W / 2 + 30, 35, 40, 40}, "\176",
|
||||
[=]() -> uint8_t {
|
||||
putEvent(EVT_VIRTUAL_KEY_RIGHT);
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | NO_FOCUS);
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
|
||||
// next
|
||||
new TextButton(this, {LCD_W / 2 + 80, 35, 60, 40}, "Next",
|
||||
[=]() -> uint8_t {
|
||||
putEvent(EVT_VIRTUAL_KEY_NEXT);
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | NO_FOCUS);
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
|
||||
// previous
|
||||
new TextButton(this, {LCD_W / 2 - 140, 35, 60, 40}, "Prev",
|
||||
[=]() -> uint8_t {
|
||||
putEvent(EVT_VIRTUAL_KEY_PREVIOUS);
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | NO_FOCUS);
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -278,12 +278,12 @@ class InputEditWindow: public Page
|
||||
if (i > 0 && (i % 4) == 0)
|
||||
grid.nextLine();
|
||||
new TextButton(window, grid.getFieldSlot(4, i % 4), fm,
|
||||
[=]() -> uint8_t {
|
||||
BFBIT_FLIP(line->flightModes, bfBit<uint32_t>(i));
|
||||
SET_DIRTY();
|
||||
return !(bfSingleBitGet(line->flightModes, i));
|
||||
},
|
||||
bfSingleBitGet(line->flightModes, i) ? 0 : BUTTON_CHECKED);
|
||||
[=]() -> uint8_t {
|
||||
BFBIT_FLIP(line->flightModes, bfBit<uint32_t>(i));
|
||||
SET_DIRTY();
|
||||
return !(bfSingleBitGet(line->flightModes, i));
|
||||
},
|
||||
OPAQUE | (bfSingleBitGet(line->flightModes, i) ? 0 : BUTTON_CHECKED));
|
||||
}
|
||||
grid.nextLine();
|
||||
|
||||
|
||||
@@ -131,11 +131,11 @@ class MixEditWindow : public Page {
|
||||
grid.nextLine();
|
||||
new TextButton(window, grid.getFieldSlot(4, i % 4), fm,
|
||||
[=]() -> uint8_t {
|
||||
BFBIT_FLIP(mix->flightModes, bfBit<uint8_t >(i));
|
||||
SET_DIRTY();
|
||||
return !(bfSingleBitGet(mix->flightModes, i));
|
||||
BFBIT_FLIP(mix->flightModes, bfBit<uint8_t>(i));
|
||||
SET_DIRTY();
|
||||
return !(bfSingleBitGet(mix->flightModes, i));
|
||||
},
|
||||
bfSingleBitGet(mix->flightModes, i) ? 0 : BUTTON_CHECKED);
|
||||
OPAQUE | (bfSingleBitGet(mix->flightModes, i) ? 0 : BUTTON_CHECKED));
|
||||
}
|
||||
grid.nextLine();
|
||||
|
||||
|
||||
@@ -343,7 +343,8 @@ void BindWaitDialog::checkEvents()
|
||||
Dialog::checkEvents();
|
||||
}
|
||||
|
||||
class ReceiverButton: public TextButton {
|
||||
class ReceiverButton: public TextButton
|
||||
{
|
||||
public:
|
||||
ReceiverButton(FormGroup * parent, rect_t rect, uint8_t moduleIdx, uint8_t receiverIdx):
|
||||
TextButton(parent, rect, STR_BIND, [=]() {
|
||||
@@ -1153,7 +1154,7 @@ void ModelSetupPage::build(FormWindow * window)
|
||||
if (j > 0 && (j % 3) == 0)
|
||||
switchesGrid.nextLine();
|
||||
auto button = new TextButton(group, switchesGrid.getSlot(3, j % 3), switchWarninglabel(i), nullptr,
|
||||
(bfGet(g_model.switchWarningState, 3 * i, 3) == 0 ? 0 : BUTTON_CHECKED));
|
||||
OPAQUE | (bfGet(g_model.switchWarningState, 3 * i, 3) == 0 ? 0 : BUTTON_CHECKED));
|
||||
button->setPressHandler([button, i] {
|
||||
swarnstate_t newstate = bfGet(g_model.switchWarningState, 3 * i, 3);
|
||||
if (newstate == 1 && SWITCH_CONFIG(i) != SWITCH_3POS)
|
||||
@@ -1188,7 +1189,7 @@ void ModelSetupPage::build(FormWindow * window)
|
||||
SET_DIRTY();
|
||||
return bfSingleBitGet<BeepANACenter>(g_model.beepANACenter, i);
|
||||
},
|
||||
bfSingleBitGet(g_model.beepANACenter, i) ? BUTTON_CHECKED : 0);
|
||||
OPAQUE | (bfSingleBitGet(g_model.beepANACenter, i) ? BUTTON_CHECKED : 0));
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ void RadioCalibrationPage::buildBody(FormWindow * window)
|
||||
[=]() -> uint8_t {
|
||||
nextStep();
|
||||
return 0;
|
||||
}, BUTTON_BACKGROUND | NO_FOCUS);
|
||||
}, BUTTON_BACKGROUND | OPAQUE | NO_FOCUS);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user