diff options
Diffstat (limited to 'gui/ThemeLayout.h')
| -rw-r--r-- | gui/ThemeLayout.h | 38 | 
1 files changed, 37 insertions, 1 deletions
diff --git a/gui/ThemeLayout.h b/gui/ThemeLayout.h index c4d7e672dd..00e55ce509 100644 --- a/gui/ThemeLayout.h +++ b/gui/ThemeLayout.h @@ -45,7 +45,8 @@ public:  		kLayoutMain,  		kLayoutVertical,  		kLayoutHorizontal, -		kLayoutWidget +		kLayoutWidget, +		kLayoutTabWidget  	};  	ThemeLayout(ThemeLayout *p) : @@ -223,6 +224,41 @@ protected:  	Common::String _name;  }; +class ThemeLayoutTabWidget : public ThemeLayoutWidget { +	int _tabHeight; + +public: +	ThemeLayoutTabWidget(ThemeLayout *p, const Common::String &name, int16 w, int16 h, Graphics::TextAlign align, int tabHeight): +		ThemeLayoutWidget(p, name, w, h, align) { +		_tabHeight = tabHeight; +	} + +	void reflowLayout() {		 +		for (uint i = 0; i < _children.size(); ++i) { +			_children[i]->resetLayout(); +			_children[i]->reflowLayout(); +		} +	} + +	virtual bool getWidgetData(const Common::String &name, int16 &x, int16 &y, uint16 &w, uint16 &h) { +		if (ThemeLayoutWidget::getWidgetData(name, x, y, w, h)) { +			h -= _tabHeight; +			return true; +		} + +		return false; +	} + +protected: +	LayoutType getLayoutType() { return kLayoutTabWidget; } + +	ThemeLayout *makeClone(ThemeLayout *newParent) { +		ThemeLayoutTabWidget *n = new ThemeLayoutTabWidget(*this); +		n->_parent = newParent; +		return n; +	} +}; +  class ThemeLayoutSpacing : public ThemeLayout {  public:  	ThemeLayoutSpacing(ThemeLayout *p, int size) : ThemeLayout(p) {  | 
