Fixed indentation and removed whitespaces at the end of line
svn-id: r35481
This commit is contained in:
parent
2ec51ef358
commit
b1999a2a16
71 changed files with 651 additions and 651 deletions
|
@ -44,45 +44,45 @@ void ThemeEval::reset() {
|
|||
_vars.clear();
|
||||
_curDialog.clear();
|
||||
_curLayout.clear();
|
||||
|
||||
|
||||
for (LayoutsMap::iterator i = _layouts.begin(); i != _layouts.end(); ++i)
|
||||
delete i->_value;
|
||||
|
||||
|
||||
_layouts.clear();
|
||||
}
|
||||
|
||||
bool ThemeEval::getWidgetData(const Common::String &widget, int16 &x, int16 &y, uint16 &w, uint16 &h) {
|
||||
Common::StringTokenizer tokenizer(widget, ".");
|
||||
|
||||
|
||||
if (widget.hasPrefix("Dialog."))
|
||||
tokenizer.nextToken();
|
||||
|
||||
Common::String dialogName = "Dialog." + tokenizer.nextToken();
|
||||
Common::String widgetName = tokenizer.nextToken();
|
||||
|
||||
if (!_layouts.contains(dialogName))
|
||||
|
||||
if (!_layouts.contains(dialogName))
|
||||
return false;
|
||||
|
||||
if (widgetName.empty())
|
||||
return _layouts[dialogName]->getDialogData(x, y, w, h);
|
||||
|
||||
|
||||
return _layouts[dialogName]->getWidgetData(widgetName, x, y, w, h);
|
||||
}
|
||||
|
||||
|
||||
void ThemeEval::addWidget(const Common::String &name, int w, int h, const Common::String &type, bool enabled) {
|
||||
void ThemeEval::addWidget(const Common::String &name, int w, int h, const Common::String &type, bool enabled) {
|
||||
int typeW = -1;
|
||||
int typeH = -1;
|
||||
|
||||
|
||||
if (!type.empty()) {
|
||||
typeW = getVar("Globals." + type + ".Width", -1);
|
||||
typeH = getVar("Globals." + type + ".Height", -1);
|
||||
}
|
||||
|
||||
ThemeLayoutWidget *widget = new ThemeLayoutWidget(_curLayout.top(), name,
|
||||
typeW == -1 ? w : typeW,
|
||||
|
||||
ThemeLayoutWidget *widget = new ThemeLayoutWidget(_curLayout.top(), name,
|
||||
typeW == -1 ? w : typeW,
|
||||
typeH == -1 ? h : typeH);
|
||||
|
||||
|
||||
_curLayout.top()->addChild(widget);
|
||||
setVar(_curDialog + "." + name + ".Enabled", enabled ? 1 : 0);
|
||||
}
|
||||
|
@ -90,9 +90,9 @@ void ThemeEval::addWidget(const Common::String &name, int w, int h, const Common
|
|||
void ThemeEval::addDialog(const Common::String &name, const Common::String &overlays, bool enabled, int inset) {
|
||||
int16 x, y;
|
||||
uint16 w, h;
|
||||
|
||||
|
||||
ThemeLayout *layout = 0;
|
||||
|
||||
|
||||
if (overlays == "screen") {
|
||||
layout = new ThemeLayoutMain(inset, inset, g_system->getOverlayWidth() - 2 * inset, g_system->getOverlayHeight() - 2 * inset);
|
||||
} else if (overlays == "screen_center") {
|
||||
|
@ -100,13 +100,13 @@ void ThemeEval::addDialog(const Common::String &name, const Common::String &over
|
|||
} else if (getWidgetData(overlays, x, y, w, h)) {
|
||||
layout = new ThemeLayoutMain(x + inset, y + inset, w - 2 * inset, h - 2 * inset);
|
||||
}
|
||||
|
||||
|
||||
if (!layout)
|
||||
error("Error when loading dialog position for '%s'", overlays.c_str());
|
||||
|
||||
|
||||
if (_layouts.contains(name))
|
||||
delete _layouts[name];
|
||||
|
||||
|
||||
_layouts[name] = layout;
|
||||
|
||||
layout->setPadding(
|
||||
|
@ -115,7 +115,7 @@ void ThemeEval::addDialog(const Common::String &name, const Common::String &over
|
|||
getVar("Globals.Padding.Top", 0),
|
||||
getVar("Globals.Padding.Bottom", 0)
|
||||
);
|
||||
|
||||
|
||||
_curLayout.push(layout);
|
||||
_curDialog = name;
|
||||
setVar(name + ".Enabled", enabled ? 1 : 0);
|
||||
|
@ -123,24 +123,24 @@ void ThemeEval::addDialog(const Common::String &name, const Common::String &over
|
|||
|
||||
void ThemeEval::addLayout(ThemeLayout::LayoutType type, int spacing, bool center) {
|
||||
ThemeLayout *layout = 0;
|
||||
|
||||
|
||||
if (spacing == -1)
|
||||
spacing = getVar("Globals.Layout.Spacing", 4);
|
||||
|
||||
|
||||
if (type == ThemeLayout::kLayoutVertical)
|
||||
layout = new ThemeLayoutVertical(_curLayout.top(), spacing, center);
|
||||
else if (type == ThemeLayout::kLayoutHorizontal)
|
||||
layout = new ThemeLayoutHorizontal(_curLayout.top(), spacing, center);
|
||||
|
||||
assert(layout);
|
||||
|
||||
|
||||
layout->setPadding(
|
||||
getVar("Globals.Padding.Left", 0),
|
||||
getVar("Globals.Padding.Right", 0),
|
||||
getVar("Globals.Padding.Top", 0),
|
||||
getVar("Globals.Padding.Bottom", 0)
|
||||
);
|
||||
|
||||
|
||||
_curLayout.top()->addChild(layout);
|
||||
_curLayout.push(layout);
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ void ThemeEval::addSpace(int size) {
|
|||
bool ThemeEval::addImportedLayout(const Common::String &name) {
|
||||
if (!_layouts.contains(name))
|
||||
return false;
|
||||
|
||||
|
||||
_curLayout.top()->importLayout(_layouts[name]);
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue