aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeLayout.h
diff options
context:
space:
mode:
authorEugene Sandulenko2009-06-06 17:52:44 +0000
committerEugene Sandulenko2009-06-06 17:52:44 +0000
commitb0db1b5ed0634dee707d234cfda23201c648cf98 (patch)
tree940e4143fab6667cbfdfeaf53f0fd1b4a1b288f3 /gui/ThemeLayout.h
parentb0f7f2e8d412b65a7bb950f50d1fa511fd6ef946 (diff)
downloadscummvm-rg350-b0db1b5ed0634dee707d234cfda23201c648cf98.tar.gz
scummvm-rg350-b0db1b5ed0634dee707d234cfda23201c648cf98.tar.bz2
scummvm-rg350-b0db1b5ed0634dee707d234cfda23201c648cf98.zip
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
Diffstat (limited to 'gui/ThemeLayout.h')
-rw-r--r--gui/ThemeLayout.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/gui/ThemeLayout.h b/gui/ThemeLayout.h
index ac17e5744b..3d367df147 100644
--- a/gui/ThemeLayout.h
+++ b/gui/ThemeLayout.h
@@ -52,7 +52,8 @@ public:
ThemeLayout(ThemeLayout *p) :
_parent(p), _x(0), _y(0), _w(-1), _h(-1),
- _centered(false), _defaultW(-1), _defaultH(-1) { }
+ _centered(false), _defaultW(-1), _defaultH(-1),
+ _textHAlign(Graphics::kTextAlignInvalid) {}
virtual ~ThemeLayout() {
for (uint i = 0; i < _children.size(); ++i)
@@ -90,6 +91,7 @@ protected:
void setWidth(int16 width) { _w = width; }
void setHeight(int16 height) { _h = height; }
+ void setTextHAlign(Graphics::TextAlign align) { _textHAlign = align; }
virtual LayoutType getLayoutType() = 0;
@@ -98,8 +100,12 @@ protected:
public:
virtual bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h);
+ virtual Graphics::TextAlign getWidgetTextHAlign(const Common::String &name);
+
void importLayout(ThemeLayout *layout);
+ Graphics::TextAlign getTextHAlign() { return _textHAlign; }
+
#ifdef LAYOUT_DEBUG_DIALOG
void debugDraw(Graphics::Surface *screen, const Graphics::Font *font);
@@ -113,6 +119,7 @@ protected:
Common::Array<ThemeLayout *> _children;
bool _centered;
int16 _defaultW, _defaultH;
+ Graphics::TextAlign _textHAlign;
};
class ThemeLayoutMain : public ThemeLayout {
@@ -190,12 +197,16 @@ protected:
class ThemeLayoutWidget : public ThemeLayout {
public:
- ThemeLayoutWidget(ThemeLayout *p, const Common::String &name, int16 w, int16 h) : ThemeLayout(p), _name(name) {
+ ThemeLayoutWidget(ThemeLayout *p, const Common::String &name, int16 w, int16 h, Graphics::TextAlign align) : ThemeLayout(p), _name(name) {
_w = _defaultW = w;
_h = _defaultH = h;
+
+ setTextHAlign(align);
}
bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h);
+ Graphics::TextAlign getWidgetTextHAlign(const Common::String &name);
+
void reflowLayout() {}
#ifdef LAYOUT_DEBUG_DIALOG