From e903a88f24b4a44be828d9f5442483438815ecdb Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Thu, 27 May 2021 07:50:33 +0200 Subject: [PATCH] Fix focus order after layout choice Resolves #76 --- radio/src/gui/colorlcd/screen_setup.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/radio/src/gui/colorlcd/screen_setup.cpp b/radio/src/gui/colorlcd/screen_setup.cpp index 693e3628e..70f316fbd 100644 --- a/radio/src/gui/colorlcd/screen_setup.cpp +++ b/radio/src/gui/colorlcd/screen_setup.cpp @@ -413,14 +413,15 @@ void ScreenSetupPage::build(FormWindow * window) if (!layout) return nullptr; return layout->getFactory(); }; - LayoutChoice::LayoutFactorySetter setLayout = [idx, optionsWindow](const LayoutFactory *factory) { - // delete any options potentially accessing - // the old custom screen - optionsWindow->clear(); - createCustomScreen(factory, idx); - updateLayoutOptions(optionsWindow, idx); - }; - + LayoutChoice::LayoutFactorySetter setLayout = + [=](const LayoutFactory* factory) { + // delete any options potentially accessing + // the old custom screen + window->clear(); + createCustomScreen(factory, idx); + build(window); + }; + auto layoutChoice = new LayoutChoice(window, layoutSlot, getFactory, setLayout); grid.nextLine(layoutChoice->height()); @@ -477,4 +478,6 @@ void ScreenSetupPage::build(FormWindow * window) // fix focus order due to early insertion FormField::link(button, layoutChoice); } + + window->adjustInnerHeight(); }