GUI: Generate ExtraGuiOptions dynamically in a scrollable container (#2783)

This allows for the removal of hardcoded extra GUI options from the
theme files, and lifts restrictions related to the maximum number
of allowed ExtraGuiOptions
This commit is contained in:
Matthew Jimenez 2021-02-20 05:17:11 -06:00 committed by GitHub
parent a7b776cab5
commit f9f7d0eb10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 30 additions and 337 deletions

View file

@ -941,7 +941,7 @@ OptionsContainerWidget::OptionsContainerWidget(GuiObject *boss, const Common::St
_scrollContainer(nullptr) {
if (scrollable) {
_scrollContainer = new ScrollContainerWidget(this, 0, 0, 0, 0, kReflowCmd);
_scrollContainer = new ScrollContainerWidget(this, name, _dialogLayout, kReflowCmd);
_scrollContainer->setTarget(this);
_scrollContainer->setBackgroundType(GUI::ThemeEngine::kWidgetBackgroundNo);
}
@ -958,7 +958,9 @@ void OptionsContainerWidget::reflowLayout() {
defineLayout(*g_gui.xmlEval(), _dialogLayout, _name);
}
g_gui.xmlEval()->reflowDialogLayout(_dialogLayout, _firstWidget);
if (!_scrollContainer) {
g_gui.xmlEval()->reflowDialogLayout(_dialogLayout, _firstWidget);
}
}
if (_scrollContainer) {