summaryrefslogtreecommitdiff
path: root/indra/newview/llnavigationbar.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-08-12 01:12:27 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-08-12 01:12:27 +0000
commit0bf4b5f2222ffb8171be094613363427f3b8470a (patch)
tree4b742d6815f44a85c98113e9c5a3017eafc5968d /indra/newview/llnavigationbar.cpp
parent8d7e56f219d0915e2c4a19baf2809dbc6ede7fa5 (diff)
merge https://svn.aws.productengine.com/secondlife/export-from-ll@1277 https://svn.aws.productengine.com/secondlife/pe/stable-1@1297 -> viewer-2-0
Fixes: EXT 208 EXT 366 EXT-211 EXT-245 EXT-246 EXT-278 EXT-279 EXT-280 EXT-298 EXT-301 EXT-304 EXT-311 EXT-317 EXT-318 EXT-319 EXT-339 EXT-343 EXT-344 EXT-346 EXT-349 EXT-350 EXT-351 EXT-354 EXT-355 EXT-358 EXT-360 EXT-362 EXT-369 EXT-372 EXT-374 EXT-381 EXT-382 EXT-383 EXT-395 EXT-396 EXT-412 Other changes: Movement & Caemra controls work Profile and Me panel refactoring Notification refactoring
Diffstat (limited to 'indra/newview/llnavigationbar.cpp')
-rw-r--r--indra/newview/llnavigationbar.cpp140
1 files changed, 140 insertions, 0 deletions
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index b980490434..0f719f29e9 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -56,6 +56,7 @@
#include "llworldmap.h"
#include "llappviewer.h"
#include "llviewercontrol.h"
+#include "llfavoritesbar.h"
//-- LLTeleportHistoryMenuItem -----------------------------------------------
@@ -200,6 +201,9 @@ LLNavigationBar::LLNavigationBar()
// set a listener function for LoginComplete event
LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLNavigationBar::handleLoginComplete, this));
+
+ // Necessary for focus movement among child controls
+ setFocusRoot(TRUE);
}
LLNavigationBar::~LLNavigationBar()
@@ -246,6 +250,9 @@ BOOL LLNavigationBar::postBuild()
return FALSE;
}
+ mDefaultNbRect = getRect();
+ mDefaultFpRect = getChild<LLFavoritesBarCtrl>("favorite")->getRect();
+
// we'll be notified on teleport history changes
LLTeleportHistory::getInstance()->setHistoryChangedCallback(
boost::bind(&LLNavigationBar::onTeleportHistoryChanged, this));
@@ -278,6 +285,11 @@ BOOL LLNavigationBar::handleRightMouseUp(S32 x, S32 y, MASK mask)
{
mLocationContextMenu->buildDrawLabels();
mLocationContextMenu->updateParent(LLMenuGL::sMenuContainer);
+ LLLineEditor* textEntry =mCmbLocation->getTextEntry();
+ if(textEntry && !textEntry->hasSelection() ){
+ textEntry->setText(gAgent.getUnescapedSLURL());
+ textEntry->selectAll();
+ }
LLMenuGL::showPopup(this, mLocationContextMenu, x, y);
}
return TRUE;
@@ -605,3 +617,131 @@ void LLNavigationBar::clearHistoryCache()
lh->save();
mPurgeTPHistoryItems= true;
}
+
+void LLNavigationBar::showNavigationPanel(BOOL visible)
+{
+ bool fpVisible = gSavedSettings.getBOOL("ShowNavbarFavoritesPanel");
+
+ LLFavoritesBarCtrl* fb = getChild<LLFavoritesBarCtrl>("favorite");
+ LLPanel* navPanel = getChild<LLPanel>("navigation_panel");
+
+ LLRect nbRect(getRect());
+ LLRect fbRect(fb->getRect());
+
+ navPanel->setVisible(visible);
+
+ if (visible)
+ {
+ if (fpVisible)
+ {
+ // Navigation Panel must be shown. Favorites Panel is visible.
+
+ nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), mDefaultNbRect.getHeight());
+ fbRect.setLeftTopAndSize(fbRect.mLeft, mDefaultFpRect.mTop, fbRect.getWidth(), fbRect.getHeight());
+
+ // this is duplicated in 'else' section because it should be called BEFORE fb->reshape
+ reshape(nbRect.getWidth(), nbRect.getHeight());
+ setRect(nbRect);
+
+ fb->reshape(fbRect.getWidth(), fbRect.getHeight());
+ fb->setRect(fbRect);
+ }
+ else
+ {
+ // Navigation Panel must be shown. Favorites Panel is hidden.
+
+ S32 height = mDefaultNbRect.getHeight() - mDefaultFpRect.getHeight();
+ nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), height);
+
+ reshape(nbRect.getWidth(), nbRect.getHeight());
+ setRect(nbRect);
+ }
+ }
+ else
+ {
+ if (fpVisible)
+ {
+ // Navigation Panel must be hidden. Favorites Panel is visible.
+
+ nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), fbRect.getHeight());
+ fbRect.setLeftTopAndSize(fbRect.mLeft, fbRect.getHeight(), fbRect.getWidth(), fbRect.getHeight());
+
+ // this is duplicated in 'else' section because it should be called BEFORE fb->reshape
+ reshape(nbRect.getWidth(), nbRect.getHeight());
+ setRect(nbRect);
+
+ fb->reshape(fbRect.getWidth(), fbRect.getHeight());
+ fb->setRect(fbRect);
+ }
+ else
+ {
+ // Navigation Panel must be hidden. Favorites Panel is hidden.
+
+ nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), 0);
+
+ reshape(nbRect.getWidth(), nbRect.getHeight());
+ setRect(nbRect);
+ }
+ }
+}
+
+void LLNavigationBar::showFavoritesPanel(BOOL visible)
+{
+ bool npVisible = gSavedSettings.getBOOL("ShowNavbarNavigationPanel");
+
+ LLFavoritesBarCtrl* fb = getChild<LLFavoritesBarCtrl>("favorite");
+
+ LLRect nbRect(getRect());
+ LLRect fbRect(fb->getRect());
+
+ if (visible)
+ {
+ if (npVisible)
+ {
+ // Favorites Panel must be shown. Navigation Panel is visible.
+
+ S32 fbHeight = fbRect.getHeight();
+ S32 newHeight = nbRect.getHeight() + fbHeight;
+
+ nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), newHeight);
+ fbRect.setLeftTopAndSize(mDefaultFpRect.mLeft, mDefaultFpRect.mTop, fbRect.getWidth(), fbRect.getHeight());
+ }
+ else
+ {
+ // Favorites Panel must be shown. Navigation Panel is hidden.
+
+ S32 fpHeight = mDefaultFpRect.getHeight();
+ nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), fpHeight);
+ fbRect.setLeftTopAndSize(fbRect.mLeft, fpHeight, fbRect.getWidth(), fpHeight);
+ }
+
+ reshape(nbRect.getWidth(), nbRect.getHeight());
+ setRect(nbRect);
+
+ fb->reshape(fbRect.getWidth(), fbRect.getHeight());
+ fb->setRect(fbRect);
+ }
+ else
+ {
+ if (npVisible)
+ {
+ // Favorites Panel must be hidden. Navigation Panel is visible.
+
+ S32 fbHeight = fbRect.getHeight();
+ S32 newHeight = nbRect.getHeight() - fbHeight;
+
+ nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), newHeight);
+ }
+ else
+ {
+ // Favorites Panel must be hidden. Navigation Panel is hidden.
+
+ nbRect.setLeftTopAndSize(nbRect.mLeft, nbRect.mTop, nbRect.getWidth(), 0);
+ }
+
+ reshape(nbRect.getWidth(), nbRect.getHeight());
+ setRect(nbRect);
+ }
+
+ fb->setVisible(visible);
+}