diff options
| author | Richard Nelson <none@none> | 2010-06-04 14:25:51 -0700 | 
|---|---|---|
| committer | Richard Nelson <none@none> | 2010-06-04 14:25:51 -0700 | 
| commit | 46e1253ee11cd2aca41314ec4e9c053bddd7a0b4 (patch) | |
| tree | f6e2475827ea71cda040c7a4b353c84909ca37eb /indra/newview | |
| parent | fbee0d8ef1cfd97c2ef52398d19d038c145bae67 (diff) | |
DEV-50015 FIX Implement changes to the Buy L$ button in the top bar of the viewer
reviewed by Mani
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llstatusbar.cpp | 17 | ||||
| -rw-r--r-- | indra/newview/skins/default/textures/textures.xml | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/textures/widgets/buy_off.png | bin | 54754 -> 399 bytes | |||
| -rw-r--r-- | indra/newview/skins/default/textures/widgets/buy_over.png | bin | 54772 -> 415 bytes | |||
| -rw-r--r-- | indra/newview/skins/default/textures/widgets/buy_press.png | bin | 54861 -> 461 bytes | |||
| -rw-r--r-- | indra/newview/skins/default/xui/en/panel_status_bar.xml | 34 | 
6 files changed, 30 insertions, 23 deletions
| diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 5628205dd4..ac419d8dc7 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -394,18 +394,21 @@ void LLStatusBar::setBalance(S32 balance)  {  	std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); -	LLButton* btn_buy_currency = getChild<LLButton>("buycurrency"); +	LLTextBox* balance_box = getChild<LLTextBox>("balance");  	LLStringUtil::format_map_t string_args;  	string_args["[AMT]"] = llformat("%s", money_str.c_str());  	std::string label_str = getString("buycurrencylabel", string_args); -	btn_buy_currency->setLabel(label_str); +	balance_box->setValue(label_str); -	// Resize the balance button so that the label fits it, and the button expands to the left. -	// *TODO: LLButton should have an option where to expand. +	// Resize the L$ balance background to be wide enough for your balance plus the buy button  	{ -		S32 saved_right = btn_buy_currency->getRect().mRight; -		btn_buy_currency->autoResize(); -		btn_buy_currency->translate(saved_right - btn_buy_currency->getRect().mRight, 0); +		const S32 HPAD = 24; +		LLRect balance_rect = balance_box->getTextBoundingRect(); +		LLRect buy_rect = getChildView("buyL")->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() + balance_rect.getWidth() + HPAD); +		balance_bg_view->setShape(balance_bg_rect);  	}  	if (mBalance && (fabs((F32)(mBalance - balance)) > gSavedSettings.getF32("UISndMoneyChangeThreshold"))) diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 93c805f724..1a05dbacd2 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -667,7 +667,7 @@ with the same filename but different name    <texture name="Progress_11" file_name="icons/Progress_11.png" preload="true" />    <texture name="Progress_12" file_name="icons/Progress_12.png" preload="true" /> -  <texture name="bevel_background" file_name="widgets/bevel_background.png" preload="true" scale.left="12" scale.top="15" scale.right="120" scale.bottom="2"/> +  <texture name="bevel_background" file_name="widgets/bevel_background.png" preload="true" scale.left="12" scale.top="15" scale.right="108" scale.bottom="2"/>    <texture name="buy_off" file_name="widgets/buy_off.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>    <texture name="buy_over" file_name="widgets/buy_over.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/>    <texture name="buy_press" file_name="widgets/buy_press.png" preload="true" scale.left="2" scale.top="15" scale.right="67" scale.bottom="4"/> diff --git a/indra/newview/skins/default/textures/widgets/buy_off.png b/indra/newview/skins/default/textures/widgets/buy_off.pngBinary files differ index 961ad071d4..ee5979046f 100644 --- a/indra/newview/skins/default/textures/widgets/buy_off.png +++ b/indra/newview/skins/default/textures/widgets/buy_off.png diff --git a/indra/newview/skins/default/textures/widgets/buy_over.png b/indra/newview/skins/default/textures/widgets/buy_over.pngBinary files differ index 0be19f8a31..93adb68c86 100644 --- a/indra/newview/skins/default/textures/widgets/buy_over.png +++ b/indra/newview/skins/default/textures/widgets/buy_over.png diff --git a/indra/newview/skins/default/textures/widgets/buy_press.png b/indra/newview/skins/default/textures/widgets/buy_press.pngBinary files differ index d6f587464d..3f442d6eaa 100644 --- a/indra/newview/skins/default/textures/widgets/buy_press.png +++ b/indra/newview/skins/default/textures/widgets/buy_press.png diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 008aa1acc0..43513e1ab6 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -41,32 +41,35 @@       name="buycurrencylabel">          L$ [AMT]      </panel.string> -    <button +  <panel +    height="18" +    left="-315" +    width="95" +    top="1" +    follows="right|top"  +    name="balance_bg"  +    bg_visible="true" +    background_opaque="true"  +    bg_opaque_image="bevel_background"> +    <text       auto_resize="true"       halign="center" -	 enabled="false"       font="SansSerifSmall" -     follows="right|top" -     image_overlay="" -     image_selected="bevel_background" -     image_unselected="bevel_background" -     image_pressed="bevel_background" +     follows="all"       height="18" -     right="-275" -     label_shadow="false" -     name="buycurrency" -     label_color_disabled="ButtonLabelColor" -     image_color_disabled="White" +     left="0"  +     name="balance"       tool_tip="My Balance" -     pad_left="12" -     pad_right="12"  +     v_pad="4"       top="0" +     wrap="false"  +     value="L$20"        width="40" />      <button       auto_resize="true"       halign="center"       font="SansSerifSmall" -     follows="right|top" +     follows="right|top|bottom"       image_hover_unselected="buy_over"       image_unselected="buy_off"       image_pressed="buy_press" @@ -81,6 +84,7 @@       tool_tip="Click to buy more L$"       top="0"       width="55" /> +  </panel>      <text       type="string"       font="SansSerifSmall" | 
