From b0db1b5ed0634dee707d234cfda23201c648cf98 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 6 Jun 2009 17:52:44 +0000 Subject: Implement FR#2507667: "GUI: Improve PopupWidget rendering / theme layouting". - Split out label from PopUp widget - Aligned every widget on all layouts so GUI becomes to look nice again - Moved textHAlign to layout properties svn-id: r41266 --- gui/ThemeLayout.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'gui/ThemeLayout.cpp') 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); -- cgit v1.2.3