diff options
author | Bastien Bouclet | 2019-12-28 10:43:58 +0100 |
---|---|---|
committer | Bastien Bouclet | 2020-01-04 10:56:25 +0100 |
commit | c0d8b6d9fc73abc8de4575686e0776e3468d37b2 (patch) | |
tree | 156e4305363210c7a52a2d90985d71e1cd22a4ce /gui/recorderdialog.cpp | |
parent | 303ee2694f4e85d3d9796068e33d2d48ca100e8a (diff) | |
download | scummvm-rg350-c0d8b6d9fc73abc8de4575686e0776e3468d37b2.tar.gz scummvm-rg350-c0d8b6d9fc73abc8de4575686e0776e3468d37b2.tar.bz2 scummvm-rg350-c0d8b6d9fc73abc8de4575686e0776e3468d37b2.zip |
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.
Diffstat (limited to 'gui/recorderdialog.cpp')
-rw-r--r-- | gui/recorderdialog.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gui/recorderdialog.cpp b/gui/recorderdialog.cpp index cbe90c93b8..b9ac1e2484 100644 --- a/gui/recorderdialog.cpp +++ b/gui/recorderdialog.cpp @@ -60,7 +60,7 @@ RecorderDialog::RecorderDialog() : Dialog("RecorderDialog"), _list(0), _currentS _backgroundType = ThemeEngine::kDialogBackgroundSpecial; - new StaticTextWidget(this, "SaveLoadChooser.Title", _("Recorder or Playback Gameplay")); + new StaticTextWidget(this, "RecorderDialog.Title", _("Recorder or Playback Gameplay")); _list = new GUI::ListWidget(this, "RecorderDialog.List"); _list->setNumberingMode(GUI::kListNumberingOff); @@ -77,7 +77,7 @@ RecorderDialog::RecorderDialog() : Dialog("RecorderDialog"), _list(0), _currentS _playbackButton->setEnabled(false); _gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10); - _container = new GUI::ContainerWidget(this, 0, 0, 10, 10); + _container = new GUI::ContainerWidget(this, "RecorderDialog.Thumbnail"); if (g_gui.xmlEval()->getVar("Globals.RecorderDialog.ExtInfo.Visible") == 1) { new GUI::ButtonWidget(this,"RecorderDialog.NextScreenShotButton", "<", 0, kPrevScreenshotCmd); new GUI::ButtonWidget(this, "RecorderDialog.PreviousScreenShotButton", ">", 0, kNextScreenshotCmd); @@ -91,6 +91,8 @@ RecorderDialog::RecorderDialog() : Dialog("RecorderDialog"), _list(0), _currentS void RecorderDialog::reflowLayout() { + Dialog::reflowLayout(); + if (g_gui.xmlEval()->getVar("Globals.RecorderDialog.ExtInfo.Visible") == 1) { int16 x, y; uint16 w, h; @@ -114,7 +116,6 @@ void RecorderDialog::reflowLayout() { _container->setVisible(false); _gfxWidget->setVisible(false); } - Dialog::reflowLayout(); } |