aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorBastien Bouclet2019-12-28 10:43:58 +0100
committerBastien Bouclet2020-01-04 10:56:25 +0100
commitc0d8b6d9fc73abc8de4575686e0776e3468d37b2 (patch)
tree156e4305363210c7a52a2d90985d71e1cd22a4ce /backends
parent303ee2694f4e85d3d9796068e33d2d48ca100e8a (diff)
downloadscummvm-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 'backends')
-rw-r--r--backends/keymapper/remap-dialog.cpp3
-rw-r--r--backends/keymapper/remap-dialog.h2
2 files changed, 3 insertions, 2 deletions
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 9c52a922c5..02400b4c49 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -50,6 +50,9 @@ RemapDialog::RemapDialog()
_scrollBar = new GUI::ScrollBarWidget(this, 0, 0, 0, 0);
+ GUI::ContainerWidget *keymapArea = new GUI::ContainerWidget(this, "KeyMapper.KeymapArea");
+ keymapArea->setBackgroundType(GUI::ThemeEngine::kWidgetBackgroundNo);
+
new GUI::ButtonWidget(this, "KeyMapper.Close", _("Close"), 0, kCloseCmd);
}
diff --git a/backends/keymapper/remap-dialog.h b/backends/keymapper/remap-dialog.h
index 054a471064..8fd961a81a 100644
--- a/backends/keymapper/remap-dialog.h
+++ b/backends/keymapper/remap-dialog.h
@@ -77,8 +77,6 @@ protected:
Array<ActionInfo> _currentActions;
int _topAction;
- Rect _keymapArea;
-
GUI::StaticTextWidget *_kmPopUpDesc;
GUI::PopUpWidget *_kmPopUp;
//GUI::ContainerWidget *_container;