From e854db064547ae20a87bbeac399295a924cf1c8f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 3 Feb 2012 19:04:36 -0800 Subject: EXP-1513 FIX Underscore ( _ ) fails to show in first chat entry in Local Chat EXP-1854 FIX Text positioning in mini inspector a couple pixels too low --- indra/llrender/llfontgl.cpp | 3 - indra/llui/lltextbase.cpp | 51 ++++++- indra/llui/lltooltip.cpp | 10 +- indra/newview/llviewermedia.cpp | 2 +- indra/newview/skins/default/xui/en/floater_aaa.xml | 158 ++++++++++++--------- .../skins/default/xui/en/floater_about_land.xml | 6 +- .../default/xui/en/floater_merchant_outbox.xml | 6 +- .../skins/default/xui/en/floater_model_preview.xml | 86 +++++------ .../xui/en/floater_test_text_vertical_aligment.xml | 112 +++++++++++++++ .../skins/default/xui/en/floater_toybox.xml | 4 +- .../skins/default/xui/en/panel_chat_header.xml | 6 +- .../skins/default/xui/en/panel_chat_item.xml | 4 +- .../skins/default/xui/en/widgets/tab_container.xml | 2 +- 13 files changed, 319 insertions(+), 131 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/floater_test_text_vertical_aligment.xml diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 4519c5e789..6e6d02177d 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -185,9 +185,6 @@ S32 LLFontGL::render(const LLWString &wstr, S32 begin_offset, F32 x, F32 y, cons //gGL.translateUI(-pixel_offset_x, -pixel_offset_y, 0.f); LLVector2 origin(floorf(sCurOrigin.mX*sScaleX), floorf(sCurOrigin.mY*sScaleY)); - // snap the text origin to a pixel grid to start with - origin.mV[VX] -= llround((F32)sCurOrigin.mX) - (sCurOrigin.mX); - origin.mV[VY] -= llround((F32)sCurOrigin.mY) - (sCurOrigin.mY); // Depth translation, so that floating text appears 'inworld' // and is correclty occluded. diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 7e5974bf0e..5fe90e1ee3 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -2395,10 +2395,21 @@ void LLTextBase::updateRects() } mTextBoundingRect.mTop += mVPad; - //// subtract a pixel off the bottom to deal with rounding errors in measuring font height - //mTextBoundingRect.mBottom -= 1; - S32 delta_pos = -mTextBoundingRect.mBottom; + S32 delta_pos = 0; + + switch(mVAlign) + { + case LLFontGL::TOP: + delta_pos = llmax(mVisibleTextRect.mTop - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom); + break; + case LLFontGL::VCENTER: + delta_pos = (llmax(mVisibleTextRect.mTop - mTextBoundingRect.mTop, -mTextBoundingRect.mBottom) + (mVisibleTextRect.mBottom - mTextBoundingRect.mBottom)) / 2; + break; + case LLFontGL::BOTTOM: + delta_pos = mVisibleTextRect.mBottom - mTextBoundingRect.mBottom; + break; + } // move line segments to fit new document rect for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it) { @@ -2408,8 +2419,9 @@ void LLTextBase::updateRects() } // update document container dimensions according to text contents - LLRect doc_rect = mTextBoundingRect; + LLRect doc_rect; // use old mVisibleTextRect constraint document to width of viewable region + doc_rect.mBottom = llmin(mVisibleTextRect.mBottom, mTextBoundingRect.mBottom); doc_rect.mLeft = 0; // allow horizontal scrolling? @@ -2419,11 +2431,22 @@ void LLTextBase::updateRects() doc_rect.mRight = mScroller ? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight) : mVisibleTextRect.getWidth(); + doc_rect.mTop = llmax(mVisibleTextRect.mTop, mTextBoundingRect.mTop); if (!mScroller) { // push doc rect to top of text widget - doc_rect.translate(0, mVisibleTextRect.getHeight() - doc_rect.mTop); + switch(mVAlign) + { + case LLFontGL::TOP: + doc_rect.translate(0, mVisibleTextRect.getHeight() - doc_rect.mTop); + break; + case LLFontGL::VCENTER: + doc_rect.translate(0, (mVisibleTextRect.getHeight() - doc_rect.mTop) / 2); + case LLFontGL::BOTTOM: + default: + break; + } } mDocumentView->setShape(doc_rect); @@ -2444,9 +2467,27 @@ void LLTextBase::updateRects() } // update document container again, using new mVisibleTextRect (that has scrollbars enabled as needed) + doc_rect.mBottom = llmin(mVisibleTextRect.mBottom, mTextBoundingRect.mBottom); + doc_rect.mLeft = 0; doc_rect.mRight = mScroller ? llmax(mVisibleTextRect.getWidth(), mTextBoundingRect.mRight) : mVisibleTextRect.getWidth(); + doc_rect.mTop = llmax(mVisibleTextRect.mTop, mTextBoundingRect.mTop); + if (!mScroller) + { + // push doc rect to top of text widget + switch(mVAlign) + { + case LLFontGL::TOP: + doc_rect.translate(0, mVisibleTextRect.getHeight() - doc_rect.mTop); + break; + case LLFontGL::VCENTER: + doc_rect.translate(0, (mVisibleTextRect.getHeight() - doc_rect.mTop) / 2); + case LLFontGL::BOTTOM: + default: + break; + } + } mDocumentView->setShape(doc_rect); } diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 23cdd9ad9a..f737d48abf 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -180,6 +180,7 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) params.font = p.font; params.use_ellipses = true; params.wrap = p.wrap; + params.font_valign = LLFontGL::VCENTER; params.parse_urls = false; // disallow hyperlinks in tooltips, as they want to spawn their own explanatory tooltips mTextBox = LLUICtrlFactory::create (params); addChild(mTextBox); @@ -190,7 +191,6 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) { LLButton::Params icon_params; icon_params.name = "tooltip_info"; - icon_params.label(""); // provid label but set to empty so name does not overwrite it -angela LLRect icon_rect; LLUIImage* imagep = p.image; TOOLTIP_ICON_SIZE = (imagep ? imagep->getWidth() : 16); @@ -291,6 +291,12 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) S32 text_width = llmin(p.max_width(), mTextBox->getTextPixelWidth()); S32 text_height = mTextBox->getTextPixelHeight(); mTextBox->reshape(text_width, text_height); + if (mInfoButton) + { + LLRect text_rect = mTextBox->getRect(); + LLRect icon_rect = mInfoButton->getRect(); + mTextBox->translate(0, icon_rect.getCenterY() - text_rect.getCenterY()); + } // reshape tooltip panel to fit text box LLRect tooltip_rect = calcBoundingRect(); @@ -299,6 +305,8 @@ void LLToolTip::initFromParams(const LLToolTip::Params& p) tooltip_rect.mBottom = 0; tooltip_rect.mLeft = 0; + mTextBox->reshape(mTextBox->getRect().getWidth(), llmax(mTextBox->getRect().getHeight(), tooltip_rect.getHeight() - 2 * mPadding)); + setShape(tooltip_rect); } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 046360e9e9..d7e79351c2 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1901,7 +1901,7 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ } } - LL_WARNS_ONCE("Plugin") << "plugin intialization failed for mime type: " << media_type << LL_ENDL; + LL_WARNS_ONCE("Plugin") << "plugin initialization failed for mime type: " << media_type << LL_ENDL; LLSD args; args["MIME_TYPE"] = media_type; LLNotificationsUtil::add("NoPlugin", args); diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index 930bbaa8cb..d11373ce1d 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -1,6 +1,5 @@ - Nudge 1 - This string CHANGE2 is extracted. - Just a test. changes. - - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - Really long line that is long enough to wrap once with jyg descenders. - + width="650"> + +this +is +some +text +that +is +top +aligned + +this +is +some +text +that +is +center +aligned + +this +is +some +text +that +is +bottom +aligned + +this +is +some +text +that +is +top +aligned + + +this +is +some +text +that +is +center +aligned + + +this +is +some +text +that +is +bottom +aligned + diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 28538f7852..e05b2150a1 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -197,7 +197,7 @@ left_pad="2" valign="center" name="ContentRatingText" - top_delta="0" + top_delta="-2" width="250"> Adult @@ -209,7 +209,7 @@ layout="topleft" left="10" name="Owner:" - top_pad="1" + top_pad="3" width="100"> Owner: @@ -736,7 +736,7 @@ height="16" layout="topleft" left_pad="10" - top_delta="-3" + top_delta="-1" mouse_opaque="false" name="region_maturity_text" valign="center" diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml index 498a9b6ce0..b01e5852dc 100644 --- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml +++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml @@ -99,7 +99,7 @@ halign="center" font="SansSerifMedium" font_shadow="hard" - valign="bottom"> + valign="top"> Drag items here to create folders @@ -114,8 +114,8 @@ height="20" wrap="true" halign="left" - valign="bottom" - font="SansSerif" /> + valign="center" + font="SansSerif"/>