diff options
Diffstat (limited to 'indra/newview/llnavigationbar.cpp')
-rw-r--r-- | indra/newview/llnavigationbar.cpp | 38 |
1 files changed, 23 insertions, 15 deletions
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index e63daac4af..17b712bc5e 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -50,8 +50,9 @@ #include "llslurl.h" #include "llurlsimstring.h" #include "llviewerinventory.h" +#include "llviewermenu.h" #include "llviewerparcelmgr.h" -#include "llworldmap.h" +#include "llworldmapmessage.h" #include "llappviewer.h" #include "llviewercontrol.h" #include "llfloatermediabrowser.h" @@ -173,8 +174,6 @@ LLNavigationBar::LLNavigationBar() mSearchComboBox(NULL), mPurgeTPHistoryItems(false) { - setIsChrome(TRUE); - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_navigation_bar.xml"); // set a listener function for LoginComplete event @@ -271,6 +270,18 @@ void LLNavigationBar::draw() LLPanel::draw(); } +BOOL LLNavigationBar::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + BOOL handled = childrenHandleRightMouseDown( x, y, mask) != NULL; + if(!handled && !gMenuHolder->hasVisibleMenu()) + { + show_navbar_context_menu(this,x,y); + handled = true; + } + + return handled; +} + void LLNavigationBar::onBackButtonClicked() { LLTeleportHistory::getInstance()->goBack(); @@ -382,14 +393,13 @@ void LLNavigationBar::onLocationSelection() // Resolve the region name to its global coordinates. // If resolution succeeds we'll teleport. - LLWorldMap::url_callback_t cb = boost::bind( + LLWorldMapMessage::url_callback_t cb = boost::bind( &LLNavigationBar::onRegionNameResponse, this, typed_location, region_name, local_coords, _1, _2, _3, _4); // connect the callback each time, when user enter new location to get real location of agent after teleport mTeleportFinishConnection = LLViewerParcelMgr::getInstance()-> setTeleportFinishedCallback(boost::bind(&LLNavigationBar::onTeleportFinished, this, _1,typed_location)); - - LLWorldMap::getInstance()->sendNamedRegionRequest(region_name, cb, std::string("unused"), false); + LLWorldMapMessage::getInstance()->sendNamedRegionRequest(region_name, cb, std::string("unused"), false); } void LLNavigationBar::onTeleportFinished(const LLVector3d& global_agent_pos, const std::string& typed_location) @@ -576,6 +586,8 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) // this is duplicated in 'else' section because it should be called BEFORE fb->reshape reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + // propagate size to parent container + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); fb->reshape(fbRect.getWidth(), fbRect.getHeight()); fb->setRect(fbRect); @@ -589,6 +601,7 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } } else @@ -603,6 +616,7 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) // this is duplicated in 'else' section because it should be called BEFORE fb->reshape reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); fb->reshape(fbRect.getWidth(), fbRect.getHeight()); fb->setRect(fbRect); @@ -615,16 +629,12 @@ void LLNavigationBar::showNavigationPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } } childSetVisible("bg_icon", fpVisible); childSetVisible("bg_icon_no_fav", !fpVisible); - - if(LLSideTray::instanceCreated()) - { - LLSideTray::getInstance()->resetPanelRect(); - } } void LLNavigationBar::showFavoritesPanel(BOOL visible) @@ -659,6 +669,7 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); fb->reshape(fbRect.getWidth(), fbRect.getHeight()); fb->setRect(fbRect); @@ -683,14 +694,11 @@ void LLNavigationBar::showFavoritesPanel(BOOL visible) reshape(nbRect.getWidth(), nbRect.getHeight()); setRect(nbRect); + getParent()->reshape(nbRect.getWidth(), nbRect.getHeight()); } childSetVisible("bg_icon", visible); childSetVisible("bg_icon_no_fav", !visible); fb->setVisible(visible); - if(LLSideTray::instanceCreated()) - { - LLSideTray::getInstance()->resetPanelRect(); - } } |