Dialog now themeable
This commit is contained in:
@@ -152,28 +152,29 @@ class RegisterDialog: public Dialog {
|
|||||||
Dialog(STR_REGISTER, {50, 73, LCD_W - 100, 0}),
|
Dialog(STR_REGISTER, {50, 73, LCD_W - 100, 0}),
|
||||||
moduleIdx(moduleIdx)
|
moduleIdx(moduleIdx)
|
||||||
{
|
{
|
||||||
FormGridLayout grid(form.width());
|
FormGroup * form = &content->form;
|
||||||
|
FormGridLayout grid(content->form.width());
|
||||||
grid.setLabelWidth(150);
|
grid.setLabelWidth(150);
|
||||||
grid.spacer(PAGE_PADDING);
|
grid.spacer(PAGE_PADDING);
|
||||||
|
|
||||||
// Register ID
|
// Register ID
|
||||||
new StaticText(&form, grid.getLabelSlot(), STR_REG_ID);
|
new StaticText(form, grid.getLabelSlot(), STR_REG_ID);
|
||||||
auto edit = new TextEdit(&form, grid.getFieldSlot(), g_model.modelRegistrationID, sizeof(g_model.modelRegistrationID));
|
auto edit = new TextEdit(form, grid.getFieldSlot(), g_model.modelRegistrationID, sizeof(g_model.modelRegistrationID));
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
|
|
||||||
// UID
|
// UID
|
||||||
new StaticText(&form, grid.getLabelSlot(), "UID");
|
new StaticText(form, grid.getLabelSlot(), "UID");
|
||||||
uid = new NumberEdit(&form, grid.getFieldSlot(), 0, 2, GET_SET_DEFAULT(reusableBuffer.moduleSetup.pxx2.registerLoopIndex));
|
uid = new NumberEdit(form, grid.getFieldSlot(), 0, 2, GET_SET_DEFAULT(reusableBuffer.moduleSetup.pxx2.registerLoopIndex));
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
|
|
||||||
// RX name
|
// RX name
|
||||||
new StaticText(&form, grid.getLabelSlot(), STR_RX_NAME);
|
new StaticText(form, grid.getLabelSlot(), STR_RX_NAME);
|
||||||
waiting = new StaticText(&form, grid.getFieldSlot(), STR_WAITING);
|
waiting = new StaticText(form, grid.getFieldSlot(), STR_WAITING);
|
||||||
grid.nextLine();
|
grid.nextLine();
|
||||||
grid.spacer(6);
|
grid.spacer(6);
|
||||||
|
|
||||||
// Buttons
|
// Buttons
|
||||||
exitButton = new TextButton(&form, grid.getLabelSlot(), "EXIT",
|
exitButton = new TextButton(form, grid.getLabelSlot(), "EXIT",
|
||||||
[=]() -> int8_t {
|
[=]() -> int8_t {
|
||||||
this->deleteLater();
|
this->deleteLater();
|
||||||
return 0;
|
return 0;
|
||||||
@@ -183,7 +184,7 @@ class RegisterDialog: public Dialog {
|
|||||||
grid.spacer(PAGE_PADDING);
|
grid.spacer(PAGE_PADDING);
|
||||||
|
|
||||||
FormField::link(exitButton, edit);
|
FormField::link(exitButton, edit);
|
||||||
form.setHeight(grid.getWindowHeight());
|
form->setHeight(grid.getWindowHeight());
|
||||||
content->adjustHeight();
|
content->adjustHeight();
|
||||||
|
|
||||||
start();
|
start();
|
||||||
@@ -205,9 +206,9 @@ class RegisterDialog: public Dialog {
|
|||||||
rect_t rect = waiting->getRect();
|
rect_t rect = waiting->getRect();
|
||||||
waiting->deleteLater();
|
waiting->deleteLater();
|
||||||
|
|
||||||
rxName = new TextEdit(&form, rect, reusableBuffer.moduleSetup.pxx2.registerRxName, PXX2_LEN_RX_NAME);
|
rxName = new TextEdit(&content->form, rect, reusableBuffer.moduleSetup.pxx2.registerRxName, PXX2_LEN_RX_NAME);
|
||||||
rect = exitButton->getRect();
|
rect = exitButton->getRect();
|
||||||
auto okButton = new TextButton(&form, rect, "OK",
|
auto okButton = new TextButton(&content->form, rect, "OK",
|
||||||
[=]() -> int8_t {
|
[=]() -> int8_t {
|
||||||
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_RX_NAME_SELECTED;
|
reusableBuffer.moduleSetup.pxx2.registerStep = REGISTER_RX_NAME_SELECTED;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -241,7 +242,7 @@ class BindWaitDialog: public Dialog {
|
|||||||
moduleIdx(moduleIdx),
|
moduleIdx(moduleIdx),
|
||||||
receiverIdx(receiverIdx)
|
receiverIdx(receiverIdx)
|
||||||
{
|
{
|
||||||
new StaticText(&form, {0, height() / 2, width(), PAGE_LINE_HEIGHT}, STR_WAITING_FOR_RX, CENTERED);
|
new StaticText(&content->form, {0, height() / 2, width(), PAGE_LINE_HEIGHT}, STR_WAITING_FOR_RX, CENTERED);
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkEvents() override;
|
void checkEvents() override;
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ MenuWindowContent * createMenuWindow(Menu * menu)
|
|||||||
return new MenuWindowContent(menu);
|
return new MenuWindowContent(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
ModalWindowContent * createDialogWindow(Dialog * dialog, const rect_t & rect)
|
DialogWindowContent * createDialogWindow(Dialog * dialog, const rect_t & rect)
|
||||||
{
|
{
|
||||||
return new ModalWindowContent(dialog, rect);
|
return new DialogWindowContent(dialog, rect);
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-1
Submodule radio/src/thirdparty/libopenui updated: 50d4587a35...c408b0d5da
Reference in New Issue
Block a user