summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/lltextbase.cpp11
-rw-r--r--indra/newview/llstatusbar.cpp17
-rw-r--r--indra/newview/skins/default/textures/textures.xml2
-rw-r--r--indra/newview/skins/default/textures/widgets/buy_off.pngbin54754 -> 399 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/buy_over.pngbin54772 -> 415 bytes
-rw-r--r--indra/newview/skins/default/textures/widgets/buy_press.pngbin54861 -> 461 bytes
-rw-r--r--indra/newview/skins/default/xui/en/panel_status_bar.xml34
7 files changed, 33 insertions, 31 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 55dbf50fd7..d86709c448 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1101,7 +1101,7 @@ S32 LLTextBase::getLeftOffset(S32 width)
case LLFontGL::LEFT:
return mHPad;
case LLFontGL::HCENTER:
- return mHPad + (mVisibleTextRect.getWidth() - width - mHPad) / 2;
+ return mHPad + llmax(0, (mVisibleTextRect.getWidth() - width - mHPad) / 2);
case LLFontGL::RIGHT:
return mVisibleTextRect.getWidth() - width;
default:
@@ -1207,11 +1207,6 @@ void LLTextBase::reflow()
// grow line height as necessary based on reported height of this segment
line_height = llmax(line_height, segment_height);
remaining_pixels -= segment_width;
- if (remaining_pixels < 0)
- {
- // getNumChars() and getDimensions() should return consistent results
- remaining_pixels = 0;
- }
seg_offset += character_count;
@@ -1893,7 +1888,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round,
{
// Figure out which line we're nearest to.
LLRect visible_region = getVisibleDocumentRect();
-
+
// binary search for line that starts before local_y
line_list_t::const_iterator line_iter = std::lower_bound(mLineInfoList.begin(), mLineInfoList.end(), local_y - mVisibleTextRect.mBottom + visible_region.mBottom, compare_bottom());
@@ -1903,7 +1898,7 @@ S32 LLTextBase::getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round,
}
S32 pos = getLength();
- S32 start_x = mVisibleTextRect.mLeft + line_iter->mRect.mLeft;
+ S32 start_x = mVisibleTextRect.mLeft + line_iter->mRect.mLeft - visible_region.mLeft;
segment_set_t::iterator line_seg_iter;
S32 line_seg_offset;
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.png
index 961ad071d4..ee5979046f 100644
--- a/indra/newview/skins/default/textures/widgets/buy_off.png
+++ b/indra/newview/skins/default/textures/widgets/buy_off.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/buy_over.png b/indra/newview/skins/default/textures/widgets/buy_over.png
index 0be19f8a31..93adb68c86 100644
--- a/indra/newview/skins/default/textures/widgets/buy_over.png
+++ b/indra/newview/skins/default/textures/widgets/buy_over.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/widgets/buy_press.png b/indra/newview/skins/default/textures/widgets/buy_press.png
index d6f587464d..3f442d6eaa 100644
--- a/indra/newview/skins/default/textures/widgets/buy_press.png
+++ b/indra/newview/skins/default/textures/widgets/buy_press.png
Binary files differ
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"