From e3199b98be55c7d3355258e836b6cab522922cfa Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 26 Sep 2011 15:19:04 -0700 Subject: EXP-1207 : Display toolbars only after login, use correct position (temporary), follow resize correctly, store pointers to toolbars, debug display (temporary) --- indra/llui/lltoolbarview.cpp | 35 +++++++++++++------ indra/llui/lltoolbarview.h | 8 ++++- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llviewerwindow.cpp | 12 +++++-- .../skins/default/xui/en/panel_toolbar_view.xml | 40 +++++++++++----------- 5 files changed, 62 insertions(+), 35 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 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("toolbar_left"); + mToolbarRight = getChild("toolbar_right"); + mToolbarBottom = getChild("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("toolbar_bottom"); - LLToolBar* toolbar_left = getChild("toolbar_left"); - LLToolBar* toolbar_right = getChild("toolbar_right"); LLPanel* sizer_left = getChild("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 {}; + 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 mSnapView; + LLToolBar* mToolbarLeft; + LLToolBar* mToolbarRight; + LLToolBar* mToolbarBottom; }; extern LLToolBarView* gToolBarView; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f1db72e5cc..9a06423422 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1858,7 +1858,7 @@ Type Boolean Value - 1 + 0 Cursor3D diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 947f0ec184..34ee893594 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1779,7 +1779,7 @@ void LLViewerWindow::initBase() mHintHolder = main_view->getChild("hint_holder")->getHandle(); mLoginPanelHolder = main_view->getChild("login_panel_holder")->getHandle(); - // Update the toolbar global holder + // Create the toolbar view // *TODO: Eventually, suppress the existence of this debug setting and turn toolbar FUI on permanently if (gSavedSettings.getBOOL("DebugToolbarFUI")) { @@ -1787,8 +1787,8 @@ void LLViewerWindow::initBase() LLPanel* panel_holder = main_view->getChild("toolbar_view_holder"); // Load the toolbar view from file gToolBarView = LLUICtrlFactory::getInstance()->createFromFile("panel_toolbar_view.xml", panel_holder, LLDefaultChildRegistry::instance()); - // Attach it to the toolbar view holder - //panel_holder->addChild(gToolBarView); + // Hide the toolbars for the moment: we'll make them visible after logging in world (see LLViewerWindow::initWorldUI()) + gToolBarView->setVisible(FALSE); } // Constrain floaters to inside the menu and status bar regions. @@ -1953,6 +1953,12 @@ void LLViewerWindow::initWorldUI() buttons_panel->setShape(buttons_panel_container->getLocalRect()); buttons_panel->setFollowsAll(); buttons_panel_container->addChild(buttons_panel); + + // Make the toolbars visible + if (gToolBarView) + { + gToolBarView->setVisible(TRUE); + } } // Destroy the UI diff --git a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml index 6701266887..7503da1d36 100644 --- a/indra/newview/skins/default/xui/en/panel_toolbar_view.xml +++ b/indra/newview/skins/default/xui/en/panel_toolbar_view.xml @@ -3,18 +3,32 @@ follows="all" layout="topleft" name="toolbar view" - height="500" + height="716" width="1024" left="0" top="0" mouse_opaque="false" tab_stop="false" visible="true"> + @@ -36,25 +50,11 @@ follows="top|bottom|right" layout="topleft" name="toolbar_right" - height="500" + height="686" width="30" left="994" top="0" side="right" button_display_mode="icons_only" visible="true" /> - -- cgit v1.2.3