diff options
author | Merov Linden <merov@lindenlab.com> | 2011-09-26 15:19:04 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2011-09-26 15:19:04 -0700 |
commit | e3199b98be55c7d3355258e836b6cab522922cfa (patch) | |
tree | 79c416fe42e193ab1859af4e9309bc374d4f6093 /indra/llui | |
parent | 16fead6429eba35bdfb8ef01610780a508e062df (diff) |
EXP-1207 : Display toolbars only after login, use correct position (temporary), follow resize correctly, store pointers to toolbars, debug display (temporary)
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lltoolbarview.cpp | 35 | ||||
-rw-r--r-- | indra/llui/lltoolbarview.h | 8 |
2 files changed, 32 insertions, 11 deletions
diff --git a/indra/llui/lltoolbarview.cpp b/indra/llui/lltoolbarview.cpp index c99b573b35..0b0fcef52c 100644 --- a/indra/llui/lltoolbarview.cpp +++ b/indra/llui/lltoolbarview.cpp @@ -37,7 +37,10 @@ LLToolBarView* gToolBarView = NULL; static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view"); LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) -: LLUICtrl(p) +: LLUICtrl(p), + mToolbarLeft(NULL), + mToolbarRight(NULL), + mToolbarBottom(NULL) { } @@ -51,20 +54,28 @@ LLToolBarView::~LLToolBarView() { } +BOOL LLToolBarView::postBuild() +{ + mToolbarLeft = getChild<LLToolBar>("toolbar_left"); + mToolbarRight = getChild<LLToolBar>("toolbar_right"); + mToolbarBottom = getChild<LLToolBar>("toolbar_bottom"); + return TRUE; +} + void LLToolBarView::draw() { static bool debug_print = true; static S32 old_width = 0; static S32 old_height = 0; - LLToolBar* toolbar_bottom = getChild<LLToolBar>("toolbar_bottom"); - LLToolBar* toolbar_left = getChild<LLToolBar>("toolbar_left"); - LLToolBar* toolbar_right = getChild<LLToolBar>("toolbar_right"); LLPanel* sizer_left = getChild<LLPanel>("sizer_left"); - LLRect bottom_rect = toolbar_bottom->getRect(); - LLRect left_rect = toolbar_left->getRect(); - LLRect right_rect = toolbar_right->getRect(); + LLRect bottom_rect, left_rect, right_rect; + + if (mToolbarBottom) bottom_rect = mToolbarBottom->getRect(); + if (mToolbarLeft) left_rect = mToolbarLeft->getRect(); + if (mToolbarRight) right_rect = mToolbarRight->getRect(); + LLRect sizer_left_rect = sizer_left->getRect(); if ((old_width != getRect().getWidth()) || (old_height != getRect().getHeight())) @@ -83,11 +94,15 @@ void LLToolBarView::draw() } // Debug draw LLColor4 back_color = LLColor4::blue; + LLColor4 back_color_vert = LLColor4::red; + LLColor4 back_color_hori = LLColor4::yellow; back_color[VALPHA] = 0.5f; + back_color_hori[VALPHA] = 0.5f; + back_color_vert[VALPHA] = 0.5f; //gl_rect_2d(getLocalRect(), back_color, TRUE); - //gl_rect_2d(bottom_rect, LLColor4::red, TRUE); - //gl_rect_2d(left_rect, LLColor4::green, TRUE); - //gl_rect_2d(right_rect, LLColor4::yellow, TRUE); + gl_rect_2d(bottom_rect, back_color_hori, TRUE); + gl_rect_2d(left_rect, back_color_vert, TRUE); + gl_rect_2d(right_rect, back_color_vert, TRUE); LLUICtrl::draw(); } diff --git a/indra/llui/lltoolbarview.h b/indra/llui/lltoolbarview.h index 0e6545015d..24735d69e9 100644 --- a/indra/llui/lltoolbarview.h +++ b/indra/llui/lltoolbarview.h @@ -29,6 +29,7 @@ #define LL_LLTOOLBARVIEW_H #include "lluictrl.h" +#include "lltoolbar.h" class LLUICtrlFactory; @@ -38,7 +39,10 @@ class LLToolBarView : public LLUICtrl { public: struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> {}; + virtual ~LLToolBarView(); + /*virtual*/ BOOL postBuild(); + virtual void draw(); // valid children for LLToolBarView are stored in this registry @@ -51,7 +55,9 @@ protected: void initFromParams(const Params&); private: - LLHandle<LLView> mSnapView; + LLToolBar* mToolbarLeft; + LLToolBar* mToolbarRight; + LLToolBar* mToolbarBottom; }; extern LLToolBarView* gToolBarView; |