diff options
author | Alexander Tkachev | 2016-06-24 23:26:25 +0600 |
---|---|---|
committer | Eugene Sandulenko | 2016-07-03 12:20:03 +0200 |
commit | 0ae4409138f828ee7eb0241db44f43d68cec85d8 (patch) | |
tree | c9aca05fe9215661c2450e9368c97d04d7491c94 /gui/ThemeLayout.h | |
parent | 24963ac97d85a3d78d5b36d63be6cea6f63d178d (diff) | |
download | scummvm-rg350-0ae4409138f828ee7eb0241db44f43d68cec85d8.tar.gz scummvm-rg350-0ae4409138f828ee7eb0241db44f43d68cec85d8.tar.bz2 scummvm-rg350-0ae4409138f828ee7eb0241db44f43d68cec85d8.zip |
GUI: Add ThemeLayoutTabWidget
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) { |