Fix focus order after layout choice

Resolves #76
This commit is contained in:
Raphael Coeffic
2021-05-27 07:50:33 +02:00
parent cd8c7e07f7
commit e903a88f24
+6 -3
View File
@@ -413,12 +413,13 @@ void ScreenSetupPage::build(FormWindow * window)
if (!layout) return nullptr; if (!layout) return nullptr;
return layout->getFactory(); return layout->getFactory();
}; };
LayoutChoice::LayoutFactorySetter setLayout = [idx, optionsWindow](const LayoutFactory *factory) { LayoutChoice::LayoutFactorySetter setLayout =
[=](const LayoutFactory* factory) {
// delete any options potentially accessing // delete any options potentially accessing
// the old custom screen // the old custom screen
optionsWindow->clear(); window->clear();
createCustomScreen(factory, idx); createCustomScreen(factory, idx);
updateLayoutOptions(optionsWindow, idx); build(window);
}; };
auto layoutChoice = new LayoutChoice(window, layoutSlot, getFactory, setLayout); auto layoutChoice = new LayoutChoice(window, layoutSlot, getFactory, setLayout);
@@ -477,4 +478,6 @@ void ScreenSetupPage::build(FormWindow * window)
// fix focus order due to early insertion // fix focus order due to early insertion
FormField::link(button, layoutChoice); FormField::link(button, layoutChoice);
} }
window->adjustInnerHeight();
} }