SL-11666 Fixed the search menu button being over Linden dollar balance

master
andreykproductengine 2019-08-01 20:29:33 +03:00
parent 757de2a77b
commit af4329dbda
2 changed files with 25 additions and 13 deletions

View File

@ -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

View File

@ -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;