From c0d8b6d9fc73abc8de4575686e0776e3468d37b2 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 28 Dec 2019 10:43:58 +0100 Subject: GUI: Introduce dynamic layouts Prior to this change, a GUI layout was only affected by the screen size. Now, a layout can additionally be influenced by the GUI dialog and widgets that uses it. This capability is leveraged to implement the following features: * Layout elements that are not bound to a GUI widget do not take space. This means that dialogs where the widgets shown depend on for example a feature being enabled at configure time no longer have blank spaces. * Widgets can define a minimal required size for their contents not to be cut. For now this is only used for buttons so their width is always sufficient for their caption not to be cut. This mechanism could be applied to other widget types in the future. --- engines/scumm/dialogs.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/scumm') diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 215abe107b..4b58290f84 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -287,6 +287,9 @@ HelpDialog::HelpDialog(const GameSettings &game) new GUI::ButtonWidget(this, "ScummHelp.Close", _("~C~lose"), 0, GUI::kCloseCmd); _prevButton->clearFlags(WIDGET_ENABLED); + GUI::ContainerWidget *placeHolder = new GUI::ContainerWidget(this, "ScummHelp.HelpText"); + placeHolder->setBackgroundType(GUI::ThemeEngine::kWidgetBackgroundNo); + _numLines = HELP_NUM_LINES; // Dummy entries -- cgit v1.2.3