From 4813b8b99ff83b3a72f9e7f35d20809b4452ca32 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 15 Jan 2010 10:06:40 -0800 Subject: EXT-4304 Clicking on "Buy L$" in nav bar does nothing Now it buys currency. Also fixes EXT-4176, same issue Reviewed with Richard. --- indra/newview/llstatusbar.cpp | 21 ++++++++++++--------- indra/newview/llstatusbar.h | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index b3b2b9ee5d..0c9c6eaebe 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -122,7 +122,6 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mTextTime(NULL), mSGBandwidth(NULL), mSGPacketLoss(NULL), - mBtnBuyCurrency(NULL), mBtnVolume(NULL), mBalance(0), mHealth(100), @@ -153,8 +152,10 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mTextHealth = getChild("HealthText" ); mTextTime = getChild("TimeText" ); - mBtnBuyCurrency = getChild( "buycurrency" ); - mBtnBuyCurrency->setClickedCallback( onClickBuyCurrency, this ); + getChild("buycurrency")->setCommitCallback( + boost::bind(&LLStatusBar::onClickBuyCurrency, this)); + getChild("buyL")->setCommitCallback( + boost::bind(&LLStatusBar::onClickBuyCurrency, this)); mBtnVolume = getChild( "volume_btn" ); mBtnVolume->setClickedCallback( onClickVolume, this ); @@ -362,7 +363,8 @@ void LLStatusBar::refresh() void LLStatusBar::setVisibleForMouselook(bool visible) { mTextTime->setVisible(visible); - mBtnBuyCurrency->setVisible(visible); + getChild("buycurrency")->setVisible(visible); + getChild("buyL")->setVisible(visible); mSGBandwidth->setVisible(visible); mSGPacketLoss->setVisible(visible); setBackgroundVisible(visible); @@ -382,17 +384,18 @@ void LLStatusBar::setBalance(S32 balance) { std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); + LLButton* btn_buy_currency = getChild("buycurrency"); LLStringUtil::format_map_t string_args; string_args["[AMT]"] = llformat("%s", money_str.c_str()); std::string labe_str = getString("buycurrencylabel", string_args); - mBtnBuyCurrency->setLabel(labe_str); + btn_buy_currency->setLabel(labe_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. { - S32 saved_right = mBtnBuyCurrency->getRect().mRight; - mBtnBuyCurrency->autoResize(); - mBtnBuyCurrency->translate(saved_right - mBtnBuyCurrency->getRect().mRight, 0); + S32 saved_right = btn_buy_currency->getRect().mRight; + btn_buy_currency->autoResize(); + btn_buy_currency->translate(saved_right - btn_buy_currency->getRect().mRight, 0); } if (mBalance && (fabs((F32)(mBalance - balance)) > gSavedSettings.getF32("UISndMoneyChangeThreshold"))) @@ -497,7 +500,7 @@ S32 LLStatusBar::getSquareMetersLeft() const return mSquareMetersCredit - mSquareMetersCommitted; } -static void onClickBuyCurrency(void* data) +void LLStatusBar::onClickBuyCurrency() { LLFloaterBuyCurrency::buyCurrency(); } diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 0e98da0fe4..21a98dd753 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -91,6 +91,7 @@ private: // simple method to setup the part that holds the date void setupDate(); + void onClickBuyCurrency(); void onVolumeChanged(const LLSD& newvalue); static void onMouseEnterVolume(LLUICtrl* ctrl); @@ -103,7 +104,6 @@ private: LLStatGraph *mSGBandwidth; LLStatGraph *mSGPacketLoss; - LLButton *mBtnBuyCurrency; LLButton *mBtnVolume; S32 mBalance; -- cgit v1.2.3 From aaef23d7eb1c17ea744fe5737af91b1ed228d416 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 15 Jan 2010 10:12:05 -0800 Subject: EXT-3741 Viewer menus need outlines or dropshadows Set drop_shadow="true" in menu.xml --- indra/newview/skins/default/xui/en/widgets/menu.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/widgets/menu.xml b/indra/newview/skins/default/xui/en/widgets/menu.xml index 53034afa61..58543338f6 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu.xml @@ -1,7 +1,7 @@ -- cgit v1.2.3 From 9d7108e8f1f3d27743dc735669ad34318858464b Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 15 Jan 2010 11:23:01 -0800 Subject: Fix linux build - missed unused function declaration --- indra/newview/llstatusbar.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 0c9c6eaebe..24895e7a35 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -107,7 +107,6 @@ const F32 ICON_TIMER_EXPIRY = 3.f; // How long the balance and health icons sho const F32 ICON_FLASH_FREQUENCY = 2.f; const S32 TEXT_HEIGHT = 18; -static void onClickBuyCurrency(void*); static void onClickHealth(void*); static void onClickScriptDebug(void*); static void onClickVolume(void*); -- cgit v1.2.3 From 3f83c05f7c71887825c907b0e148d81cd7de5324 Mon Sep 17 00:00:00 2001 From: James Cook Date: Fri, 15 Jan 2010 12:01:34 -0800 Subject: EXT-4341 "Create> New" and "rename" text presents malaligned Fixed size and position of renamer line editor Reviewed with Richard --- indra/newview/llfolderview.cpp | 11 +++++------ indra/newview/llfolderviewitem.cpp | 1 + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 9aed403991..afde543ca8 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -78,7 +78,7 @@ ///---------------------------------------------------------------------------- const S32 RENAME_WIDTH_PAD = 4; -const S32 RENAME_HEIGHT_PAD = 2; +const S32 RENAME_HEIGHT_PAD = 1; const S32 AUTO_OPEN_STACK_DEPTH = 16; const S32 MIN_ITEM_WIDTH_VISIBLE = LLFolderViewItem::ICON_WIDTH + LLFolderViewItem::ICON_PAD @@ -2221,10 +2221,9 @@ void LLFolderView::updateRenamerPosition() { if(mRenameItem) { - LLFontGL* font = getLabelFontForStyle(mLabelStyle); - - S32 x = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD - 1 + mRenameItem->getIndentation(); - S32 y = llfloor(mRenameItem->getRect().getHeight() - font->getLineHeight()-2); + // See also LLFolderViewItem::draw() + S32 x = ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mRenameItem->getIndentation(); + S32 y = mRenameItem->getRect().getHeight() - mRenameItem->getItemHeight() - RENAME_HEIGHT_PAD; mRenameItem->localPointToScreen( x, y, &x, &y ); screenPointToLocal( x, y, &x, &y ); mRenamer->setOrigin( x, y ); @@ -2236,7 +2235,7 @@ void LLFolderView::updateRenamerPosition() } S32 width = llmax(llmin(mRenameItem->getRect().getWidth() - x, scroller_rect.getWidth() - x - getRect().mLeft), MINIMUM_RENAMER_WIDTH); - S32 height = llfloor(font->getLineHeight() + RENAME_HEIGHT_PAD); + S32 height = mRenameItem->getItemHeight() - RENAME_HEIGHT_PAD; mRenamer->reshape( width, height, TRUE ); } } diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 2363f51d80..4b48626b22 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -855,6 +855,7 @@ void LLFolderViewItem::draw() ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, arrow_image->getImage(), sFgColor); } + // See also LLFolderView::updateRenamerPosition() F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation); LLFontGL* font = getLabelFontForStyle(mLabelStyle); -- cgit v1.2.3 From cf2beaeea6d4ccd8a0a0448660ddd120aeed5823 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 15 Jan 2010 13:16:58 -0800 Subject: EXT-4380 - LLTextEditor: line_spacing.multiple option doesn't work well with "widgeted" text partial fix reviewed by Leyla --- indra/llui/lltextbase.cpp | 14 +++++++------- .../skins/default/xui/en/widgets/chat_history.xml | 22 ++++++++++++---------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 5ebf49c488..17aecaf32f 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -346,7 +346,8 @@ void LLTextBase::drawSelectionBackground() S32 segment_line_start = segmentp->getStart() + segment_offset; S32 segment_line_end = llmin(segmentp->getEnd(), line_iter->mDocIndexEnd); - S32 segment_width, segment_height; + S32 segment_width = 0; + S32 segment_height = 0; // if selection after beginning of segment if(selection_left >= segment_line_start) @@ -433,7 +434,8 @@ void LLTextBase::drawCursor() if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) { - S32 segment_width, segment_height; + S32 segment_width = 0; + S32 segment_height = 0; segmentp->getDimensions(mCursorPos - segmentp->getStart(), 1, segment_width, segment_height); S32 width = llmax(CURSOR_THICKNESS, segment_width); cursor_rect.mRight = cursor_rect.mLeft + width; @@ -2443,10 +2445,12 @@ void LLNormalTextSegment::setToolTip(const std::string& tooltip) bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { - height = mFontHeight; + height = 0; + width = 0; bool force_newline = false; if (num_chars > 0) { + height = mFontHeight; LLWString text = mEditor.getWText(); // if last character is a newline, then return true, forcing line break llwchar last_char = text[mStart + first_char + num_chars - 1]; @@ -2461,10 +2465,6 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); } } - else - { - width = 0; - } LLUIImagePtr image = mStyle->getImage(); if( image.notNull()) diff --git a/indra/newview/skins/default/xui/en/widgets/chat_history.xml b/indra/newview/skins/default/xui/en/widgets/chat_history.xml index 8785dff2ae..f6d1992c8e 100644 --- a/indra/newview/skins/default/xui/en/widgets/chat_history.xml +++ b/indra/newview/skins/default/xui/en/widgets/chat_history.xml @@ -1,23 +1,25 @@ +enabledcontrol \ No newline at end of file -- cgit v1.2.3