summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorangela <angela@lindenlab.com>2009-11-16 20:46:40 +0800
committerangela <angela@lindenlab.com>2009-11-16 20:46:40 +0800
commit1baf1d218644ac5dc00d9b41119a1ef168c709a2 (patch)
tree1ddea72957ea597b655c51d144bc83cfbb32d774 /indra/llui
parent6b47e36b159a0e036beb442b82b1356aa756f152 (diff)
fix chat format for /me
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llstyle.cpp29
-rw-r--r--indra/llui/llstyle.h5
-rw-r--r--indra/llui/lltextbase.cpp11
3 files changed, 37 insertions, 8 deletions
diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp
index 71511f69a4..92c0b7c1b4 100644
--- a/indra/llui/llstyle.cpp
+++ b/indra/llui/llstyle.cpp
@@ -44,7 +44,10 @@ LLStyle::Params::Params()
color("color", LLColor4::black),
font("font", LLFontGL::getFontMonospace()),
image("image"),
- link_href("href")
+ link_href("href"),
+ italic("italic", false ),
+ bold("bold", false),
+ underline("bold", false)
{}
@@ -55,7 +58,10 @@ LLStyle::LLStyle(const LLStyle::Params& p)
mFont(p.font()),
mLink(p.link_href),
mDropShadow(p.drop_shadow),
- mImagep(p.image())
+ mImagep(p.image()),
+ mItalic(p.italic()),
+ mBold(p.bold),
+ mUnderline(p.underline)
{}
void LLStyle::setFont(const LLFontGL* font)
@@ -69,6 +75,25 @@ const LLFontGL* LLStyle::getFont() const
return mFont;
}
+const S32 LLStyle::getFontStyle() const
+{
+ S32 ret = 0;
+ if (mBold)
+ {
+ ret |= LLFontGL::BOLD;
+ }
+ if (mItalic)
+ {
+ ret |= LLFontGL::ITALIC;
+ }
+ if (mUnderline)
+ {
+ ret |= LLFontGL::UNDERLINE;
+ }
+ return ret;
+}
+
+
void LLStyle::setLinkHREF(const std::string& href)
{
mLink = href;
diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h
index ee9ca730e9..cc72011903 100644
--- a/indra/llui/llstyle.h
+++ b/indra/llui/llstyle.h
@@ -51,12 +51,17 @@ public:
Optional<const LLFontGL*> font;
Optional<LLUIImage*> image;
Optional<std::string> link_href;
+ Optional<bool> italic;
+ Optional<bool> bold;
+ Optional<bool> underline;
Params();
};
LLStyle(const Params& p = Params());
public:
const LLColor4& getColor() const { return mColor; }
void setColor(const LLColor4 &color) { mColor = color; }
+
+ const S32 getFontStyle() const;
const LLColor4& getReadOnlyColor() const { return mReadOnlyColor; }
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 7b1aaac35c..d7697ac7cc 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1506,9 +1506,8 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c
LLStyle::Params link_params = style_params;
link_params.color = match.getColor();
// apply font name from requested style_params
- std::string font_name = LLFontGL::nameFromFont(style_params.font());
- link_params.font.name.setIfNotProvided(font_name);
- link_params.font.style = "UNDERLINE";
+ std::string font_name = LLFontGL::nameFromFont(style_params.font());
+ link_params.underline = true;
link_params.link_href = match.getUrl();
// output the text before the Url
@@ -2251,7 +2250,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
rect.mLeft, rect.mTop,
color,
LLFontGL::LEFT, LLFontGL::TOP,
- 0,
+ mStyle->getFontStyle(),
mStyle->getShadowType(),
length, rect.getWidth(),
&right_x,
@@ -2270,7 +2269,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
rect.mLeft, rect.mTop,
LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ),
LLFontGL::LEFT, LLFontGL::TOP,
- 0,
+ mStyle->getFontStyle(),
LLFontGL::NO_SHADOW,
length, rect.mRight,
&right_x,
@@ -2287,7 +2286,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
rect.mLeft, rect.mTop,
color,
LLFontGL::LEFT, LLFontGL::TOP,
- 0,
+ mStyle->getFontStyle(),
mStyle->getShadowType(),
length, rect.mRight,
&right_x,