From c8726aba303bcf1207b730a344536e25491420bc Mon Sep 17 00:00:00 2001
From: Oz Linden <oz@lindenlab.com>
Date: Tue, 10 Nov 2015 09:48:56 -0500
Subject: remove execute permission from many files that should not have it

---
 indra/newview/llnavigationbar.cpp | 0
 1 file changed, 0 insertions(+), 0 deletions(-)
 mode change 100755 => 100644 indra/newview/llnavigationbar.cpp

(limited to 'indra/newview/llnavigationbar.cpp')

diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
old mode 100755
new mode 100644
-- 
cgit v1.2.3


From e5d827bbe9ccca26490f07f69aa467af57e6eeaf Mon Sep 17 00:00:00 2001
From: Mnikolenko ProductEngine <mnikolenko@productengine.com>
Date: Thu, 4 Feb 2016 11:49:37 +0200
Subject: MAINT-1537 Size of navigation/favourites bars is not saved after
 restart of viewer

---
 indra/newview/llnavigationbar.cpp | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

(limited to 'indra/newview/llnavigationbar.cpp')

diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index 8c4849d28d..84a2cd8be1 100755
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -44,6 +44,7 @@
 #include "lllocationinputctrl.h"
 #include "llpaneltopinfobar.h"
 #include "llteleporthistory.h"
+#include "llresizebar.h"
 #include "llsearchcombobox.h"
 #include "llslurl.h"
 #include "llurlregistry.h"
@@ -267,7 +268,10 @@ LLNavigationBar::LLNavigationBar()
 	mBtnForward(NULL),
 	mBtnHome(NULL),
 	mCmbLocation(NULL),
-	mSaveToLocationHistory(false)
+	mSaveToLocationHistory(false),
+	mNavigationPanel(NULL),
+	mFavoritePanel(NULL),
+	mNavPanWidth(0)
 {
 	buildFromFile( "panel_navigation_bar.xml");
 
@@ -286,7 +290,7 @@ BOOL LLNavigationBar::postBuild()
 	mBtnBack	= getChild<LLPullButton>("back_btn");
 	mBtnForward	= getChild<LLPullButton>("forward_btn");
 	mBtnHome	= getChild<LLButton>("home_btn");
-	
+
 	mCmbLocation= getChild<LLLocationInputCtrl>("location_combo");
 
 	mBtnBack->setEnabled(FALSE);
@@ -318,6 +322,11 @@ BOOL LLNavigationBar::postBuild()
 
 	LLHints::registerHintTarget("nav_bar", getHandle());
 
+	mNavigationPanel = getChild<LLLayoutPanel>("navigation_layout_panel");
+	mFavoritePanel = getChild<LLLayoutPanel>("favorites_layout_panel");
+	mNavigationPanel->getResizeBar()->setResizeListener(boost::bind(&LLNavigationBar::onNavbarResized, this));
+	mFavoritePanel->getResizeBar()->setResizeListener(boost::bind(&LLNavigationBar::onNavbarResized, this));
+
 	return TRUE;
 }
 
@@ -356,7 +365,6 @@ BOOL LLNavigationBar::handleRightMouseDown(S32 x, S32 y, MASK mask)
 		show_navbar_context_menu(this,x,y);
 		handled = true;
 	}
-					
 	return handled;
 }
 
@@ -365,6 +373,18 @@ void LLNavigationBar::onBackButtonClicked()
 	LLTeleportHistory::getInstance()->goBack();
 }
 
+void LLNavigationBar::onNavbarResized()
+{
+	S32 new_nav_pan_width = mNavigationPanel->getRect().getWidth();
+	if(mNavPanWidth != new_nav_pan_width)
+	{
+		S32 new_stack_width = new_nav_pan_width + mFavoritePanel->getRect().getWidth();
+		F32 ratio = (F32)new_nav_pan_width / (F32)new_stack_width;
+		gSavedPerAccountSettings.setF32("NavigationBarRatio", ratio);
+		mNavPanWidth = new_nav_pan_width;
+	}
+}
+
 void LLNavigationBar::onBackOrForwardButtonHeldDown(LLUICtrl* ctrl, const LLSD& param)
 {
 	if (param["count"].asInteger() == 0)
@@ -667,8 +687,18 @@ void LLNavigationBar::handleLoginComplete()
 	LLTeleportHistory::getInstance()->handleLoginComplete();
 	LLPanelTopInfoBar::instance().handleLoginComplete();
 	mCmbLocation->handleLoginComplete();
+	resizeLayoutPanel();
 }
 
+void LLNavigationBar::resizeLayoutPanel()
+{
+	LLRect nav_bar_rect = mNavigationPanel->getRect();
+
+	S32 nav_panel_width = (nav_bar_rect.getWidth() + mFavoritePanel->getRect().getWidth()) * gSavedPerAccountSettings.getF32("NavigationBarRatio");
+
+	nav_bar_rect.setLeftTopAndSize(nav_bar_rect.mLeft, nav_bar_rect.mTop, nav_panel_width, nav_bar_rect.getHeight());
+	mNavigationPanel->handleReshape(nav_bar_rect,true);
+}
 void LLNavigationBar::invokeSearch(std::string search_text)
 {
 	LLFloaterReg::showInstance("search", LLSD().with("category", "all").with("query", LLSD(search_text)));
-- 
cgit v1.2.3