aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeEval.cpp
diff options
context:
space:
mode:
authorVicent Marti2008-08-06 14:28:37 +0000
committerVicent Marti2008-08-06 14:28:37 +0000
commitbd0cdd0f7493b5f00f6533d757fd363ac6db9aac (patch)
tree5b7a26546d7a0331557990baceabc50e84f44508 /gui/ThemeEval.cpp
parent38f130db346e2ed451e2a12a5345332b0c0e39b0 (diff)
downloadscummvm-rg350-bd0cdd0f7493b5f00f6533d757fd363ac6db9aac.tar.gz
scummvm-rg350-bd0cdd0f7493b5f00f6533d757fd363ac6db9aac.tar.bz2
scummvm-rg350-bd0cdd0f7493b5f00f6533d757fd363ac6db9aac.zip
Cleanup on default theme.
Added support for Widget Type Declaration (makes XML much cleaner). svn-id: r33661
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);
}