summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-08-01 20:29:33 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-08-01 20:29:33 +0300
commitaf4329dbdabff4eb2bf7b93d42f44334f00904ea (patch)
tree01bac9e032be9585694b56598f818027cc086ca8
parent757de2a77bd84af089961d0d729d64f8c667a8ca (diff)
SL-11666 Fixed the search menu button being over Linden dollar balance
-rw-r--r--indra/newview/llstatusbar.cpp35
-rw-r--r--indra/newview/llstatusbar.h3
2 files changed, 25 insertions, 13 deletions
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index f3c270a97b..c4e09b6767 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -243,16 +243,24 @@ BOOL LLStatusBar::postBuild()
mPanelNearByMedia->setFollows(FOLLOWS_TOP|FOLLOWS_RIGHT);
mPanelNearByMedia->setVisible(FALSE);
+ updateBalancePanelPosition();
+
// Hook up and init for filtering
mFilterEdit = getChild<LLSearchEditor>( "search_menu_edit" );
mSearchPanel = getChild<LLPanel>( "menu_search_panel" );
- mSearchPanel->setVisible(gSavedSettings.getBOOL("MenuSearch"));
+ BOOL search_panel_visible = gSavedSettings.getBOOL("MenuSearch");
+ mSearchPanel->setVisible(search_panel_visible);
mFilterEdit->setKeystrokeCallback(boost::bind(&LLStatusBar::onUpdateFilterTerm, this));
mFilterEdit->setCommitCallback(boost::bind(&LLStatusBar::onUpdateFilterTerm, this));
collectSearchableItems();
gSavedSettings.getControl("MenuSearch")->getCommitSignal()->connect(boost::bind(&LLStatusBar::updateMenuSearchVisibility, this, _2));
+ if (search_panel_visible)
+ {
+ updateMenuSearchPosition();
+ }
+
return TRUE;
}
@@ -361,17 +369,7 @@ void LLStatusBar::setBalance(S32 balance)
std::string label_str = getString("buycurrencylabel", string_args);
mBoxBalance->setValue(label_str);
- // Resize the L$ balance background to be wide enough for your balance plus the buy button
- {
- const S32 HPAD = 24;
- LLRect balance_rect = mBoxBalance->getTextBoundingRect();
- LLRect buy_rect = getChildView("buyL")->getRect();
- LLRect shop_rect = getChildView("goShop")->getRect();
- LLView* balance_bg_view = getChildView("balance_bg");
- LLRect balance_bg_rect = balance_bg_view->getRect();
- balance_bg_rect.mLeft = balance_bg_rect.mRight - (buy_rect.getWidth() + shop_rect.getWidth() + balance_rect.getWidth() + HPAD);
- balance_bg_view->setShape(balance_bg_rect);
- }
+ updateBalancePanelPosition();
// If the search panel is shown, move this according to the new balance width. Parcel text will reshape itself in setParcelInfoText
if (mSearchPanel && mSearchPanel->getVisible())
@@ -659,6 +657,19 @@ void LLStatusBar::updateMenuSearchPosition()
mSearchPanel->setShape( searchRect );
}
+void LLStatusBar::updateBalancePanelPosition()
+{
+ // Resize the L$ balance background to be wide enough for your balance plus the buy button
+ const S32 HPAD = 24;
+ LLRect balance_rect = mBoxBalance->getTextBoundingRect();
+ LLRect buy_rect = getChildView("buyL")->getRect();
+ LLRect shop_rect = getChildView("goShop")->getRect();
+ LLView* balance_bg_view = getChildView("balance_bg");
+ LLRect balance_bg_rect = balance_bg_view->getRect();
+ balance_bg_rect.mLeft = balance_bg_rect.mRight - (buy_rect.getWidth() + shop_rect.getWidth() + balance_rect.getWidth() + HPAD);
+ balance_bg_view->setShape(balance_bg_rect);
+}
+
// Implements secondlife:///app/balance/request to request a L$ balance
// update via UDP message system. JC
diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h
index 403d590aca..cad877f799 100644
--- a/indra/newview/llstatusbar.h
+++ b/indra/newview/llstatusbar.h
@@ -114,7 +114,8 @@ private:
std::unique_ptr< ll::statusbar::SearchData > mSearchData;
void collectSearchableItems();
void updateMenuSearchVisibility( const LLSD& data );
- void updateMenuSearchPosition();
+ void updateMenuSearchPosition(); // depends onto balance position
+ void updateBalancePanelPosition();
private:
LLTextBox *mTextTime;