diff options
author | Richard Linden <none@none> | 2011-09-20 16:37:21 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2011-09-20 16:37:21 -0700 |
commit | 64f30a302dfbcaf56502676fa4b8d8a06f355b40 (patch) | |
tree | 33cc60eb960181fa35142c7dffcb26f4efef9e2e /indra/llui/lltoolbar.h | |
parent | 3df9545017a4835e162801d3e8a13d68c8bc44ad (diff) |
EXP-1228 FIX Create toolbar widget class that displays list of buttons horizontally or vertically
buttons are now centered and sized according to content
created floater_test_toolbar.xml to test
Diffstat (limited to 'indra/llui/lltoolbar.h')
-rw-r--r-- | indra/llui/lltoolbar.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index dd454e3f0b..fb03095c56 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -32,28 +32,44 @@ #include "lllayoutstack.h" #include "llbutton.h" +class LLToolBarButton : public LLButton +{ +public: + struct Params : public LLInitParam::Block<Params, LLButton::Params> + { + }; + + LLToolBarButton(const Params& p) : LLButton(p) {} + +}; + class LLToolBar : public LLUICtrl { public: + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { - Mandatory<LLLayoutStack::ELayoutOrientation> orientation; - Multiple<LLButton::Params> buttons; + Mandatory<LLLayoutStack::ELayoutOrientation, + LLLayoutStack::OrientationNames> orientation; + Multiple<LLToolBarButton::Params> buttons; Params(); }; - void draw(); + /*virtual*/ void draw(); protected: friend class LLUICtrlFactory; LLToolBar(const Params&); void initFromParams(const Params&); + void addButton(LLToolBarButton* buttonp); + void updateLayout(); private: - LLLayoutStack::ELayoutOrientation mOrientation; - LLLayoutStack* mStack; + LLLayoutStack::ELayoutOrientation mOrientation; + LLLayoutStack* mStack; + std::list<LLToolBarButton*> mButtons; }; |