aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeEval.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/ThemeEval.cpp')
-rw-r--r--gui/ThemeEval.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/gui/ThemeEval.cpp b/gui/ThemeEval.cpp
index 48629c306b..332dcfd841 100644
--- a/gui/ThemeEval.cpp
+++ b/gui/ThemeEval.cpp
@@ -145,11 +145,19 @@ void ThemeLayoutHorizontal::reflowLayout() {
}
-void ThemeEval::addWidget(const Common::String &name, int w, int h) {
+void ThemeEval::addWidget(const Common::String &name, int w, int h, const Common::String &type) {
ThemeLayoutWidget *widget = new ThemeLayoutWidget(_curLayout.top(), name);
- widget->setWidth(w);
- widget->setHeight(h);
+ int typeW = -1;
+ int typeH = -1;
+
+ if (!type.empty()) {
+ typeW = getVar("Globals." + type + ".Width", -1);
+ typeH = getVar("Globals." + type + ".Height", -1);
+ }
+
+ widget->setWidth(typeW == -1 ? w : typeW);
+ widget->setHeight(typeH == -1 ? h : typeH);
_curLayout.top()->addChild(widget);
}