aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeLayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/ThemeLayout.cpp')
-rw-r--r--gui/ThemeLayout.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/gui/ThemeLayout.cpp b/gui/ThemeLayout.cpp
index 3afded5504..3c930db73c 100644
--- a/gui/ThemeLayout.cpp
+++ b/gui/ThemeLayout.cpp
@@ -70,6 +70,22 @@ bool ThemeLayout::getWidgetData(const Common::String &name, int16 &x, int16 &y,
return false;
}
+Graphics::TextAlign ThemeLayout::getWidgetTextHAlign(const Common::String &name) {
+ if (name.empty()) {
+ assert(getLayoutType() == kLayoutMain);
+ return _textHAlign;
+ }
+
+ Graphics::TextAlign res;
+
+ for (uint i = 0; i < _children.size(); ++i) {
+ if ((res = _children[i]->getWidgetTextHAlign(name)) != Graphics::kTextAlignInvalid)
+ return res;
+ }
+
+ return Graphics::kTextAlignInvalid;
+}
+
int16 ThemeLayoutStacked::getParentWidth() {
ThemeLayout *p = _parent;
int width = 0;
@@ -135,6 +151,14 @@ bool ThemeLayoutWidget::getWidgetData(const Common::String &name, int16 &x, int1
return false;
}
+Graphics::TextAlign ThemeLayoutWidget::getWidgetTextHAlign(const Common::String &name) {
+ if (name == _name) {
+ return _textHAlign;
+ }
+
+ return Graphics::kTextAlignInvalid;
+}
+
void ThemeLayoutMain::reflowLayout() {
assert(_children.size() <= 1);