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 | |
| parent | 16fead6429eba35bdfb8ef01610780a508e062df (diff) | |
EXP-1207 : Display toolbars only after login, use correct position (temporary), follow resize correctly, store pointers to toolbars, debug display (temporary)
| -rw-r--r-- | indra/llui/lltoolbarview.cpp | 35 | ||||
| -rw-r--r-- | indra/llui/lltoolbarview.h | 8 | ||||
| -rw-r--r-- | indra/newview/app_settings/settings.xml | 2 | ||||
| -rw-r--r-- | indra/newview/llviewerwindow.cpp | 12 | ||||
| -rw-r--r-- | indra/newview/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<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; 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 @@      <key>Type</key>      <string>Boolean</string>      <key>Value</key> -    <integer>1</integer> +    <integer>0</integer>    </map>      <key>Cursor3D</key>      <map> 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<LLView>("hint_holder")->getHandle();  	mLoginPanelHolder = main_view->getChild<LLView>("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<LLPanel>("toolbar_view_holder");  		// Load the toolbar view from file   		gToolBarView = LLUICtrlFactory::getInstance()->createFromFile<LLToolBarView>("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"> + <panel +  follows="top|bottom|left" +  layout="topleft" +  name="sizer_left" +  height="686" +  width="30" +  left="0" +  top="0"  +  background_opaque="false" +  border_visible="false" +  background_visible="true" +  bg_opaque_image="Toast_Over" +  bg_alpha_image="Toast_Background" +  visible="true" />   <toolbar    follows="top|bottom|left"    layout="topleft"    name="toolbar_left" -  height="500" +  height="686"    width="30"    left="0"    top="0"  @@ -26,9 +40,9 @@    layout="topleft"    name="toolbar_bottom"    height="30" -  width="964" -  left="30" -  top="470"  +  width="1024" +  left="0" +  top="686"     side="bottom"    button_display_mode="icons_with_text"    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" /> - <panel -  follows="top|bottom|left" -  layout="topleft" -  name="sizer_left" -  height="500" -  width="30" -  left="0" -  top="0"  -  background_opaque="false" -  border_visible="false" -  background_visible="true" -  bg_opaque_image="Toast_Over" -  bg_alpha_image="Toast_Background" -  visible="true" />  </toolbar_view> | 
