summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRichard Linden <none@none>2010-07-01 19:48:39 -0700
committerRichard Linden <none@none>2010-07-01 19:48:39 -0700
commit187a4b638d8648977fa148bd409750096542fad2 (patch)
tree34199a47cda7b45ccb8b6e0db29e5645d12af14d /indra/llui
parente21143ef5d40b03df3ee864566dadc4cde77cd74 (diff)
EXT-7654 - About Land Floater> Icons missing
fixed layout of embedded icons in text labels
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp23
-rw-r--r--indra/llui/lltextbase.h1
-rw-r--r--indra/llui/lluictrl.h8
3 files changed, 15 insertions, 17 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 17e41d9e24..ccd22ee050 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -193,6 +193,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p)
mHPad(p.h_pad),
mVPad(p.v_pad),
mHAlign(p.font_halign),
+ mVAlign(p.font_valign),
mLineSpacingMult(p.line_spacing.multiple),
mLineSpacingPixels(p.line_spacing.pixels),
mClipPartial(p.clip_partial && !p.allow_scroll),
@@ -482,9 +483,9 @@ void LLTextBase::drawCursor()
text_color = mFgColor.get();
fontp = mDefaultFont;
}
- fontp->render(text, mCursorPos, cursor_rect.mLeft, cursor_rect.mTop,
+ fontp->render(text, mCursorPos, cursor_rect,
LLColor4(1.f - text_color.mV[VRED], 1.f - text_color.mV[VGREEN], 1.f - text_color.mV[VBLUE], alpha),
- LLFontGL::LEFT, LLFontGL::TOP,
+ LLFontGL::LEFT, mVAlign,
LLFontGL::NORMAL,
LLFontGL::NO_SHADOW,
1);
@@ -2435,12 +2436,12 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
S32 end = llmin( selection_start, seg_end );
S32 length = end - start;
font->render(text, start,
- rect.mLeft, rect.mTop,
+ rect,
color,
- LLFontGL::LEFT, LLFontGL::TOP,
+ LLFontGL::LEFT, mEditor.mVAlign,
LLFontGL::NORMAL,
mStyle->getShadowType(),
- length, rect.getWidth(),
+ length,
&right_x,
mEditor.getUseEllipses());
}
@@ -2454,12 +2455,12 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
S32 length = end - start;
font->render(text, start,
- rect.mLeft, rect.mTop,
+ rect,
LLColor4( 1.f - color.mV[0], 1.f - color.mV[1], 1.f - color.mV[2], 1.f ),
- LLFontGL::LEFT, LLFontGL::TOP,
+ LLFontGL::LEFT, mEditor.mVAlign,
LLFontGL::NORMAL,
LLFontGL::NO_SHADOW,
- length, rect.getWidth(),
+ length,
&right_x,
mEditor.getUseEllipses());
}
@@ -2471,12 +2472,12 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele
S32 end = seg_end;
S32 length = end - start;
font->render(text, start,
- rect.mLeft, rect.mTop,
+ rect,
color,
- LLFontGL::LEFT, LLFontGL::TOP,
+ LLFontGL::LEFT, mEditor.mVAlign,
LLFontGL::NORMAL,
mStyle->getShadowType(),
- length, rect.getWidth(),
+ length,
&right_x,
mEditor.getUseEllipses());
}
diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h
index fe8ebb1b80..ff63cc26f5 100644
--- a/indra/llui/lltextbase.h
+++ b/indra/llui/lltextbase.h
@@ -357,6 +357,7 @@ protected:
S32 mHPad; // padding on left of text
S32 mVPad; // padding above text
LLFontGL::HAlign mHAlign;
+ LLFontGL::VAlign mVAlign;
F32 mLineSpacingMult; // multiple of line height used as space for a single line of text (e.g. 1.5 to get 50% padding)
S32 mLineSpacingPixels; // padding between lines
const LLFontGL* mDefaultFont; // font that is used when none specified
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index b9a4f61e15..1f9d2c9049 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -47,14 +47,10 @@
const BOOL TAKE_FOCUS_YES = TRUE;
const BOOL TAKE_FOCUS_NO = FALSE;
-// NOTE: the LLFocusableElement class declaration has been moved from here to llfocusmgr.h.
-
class LLUICtrl
: public LLView, public boost::signals2::trackable
{
public:
-
-
typedef boost::function<void (LLUICtrl* ctrl, const LLSD& param)> commit_callback_t;
typedef boost::signals2::signal<void (LLUICtrl* ctrl, const LLSD& param)> commit_signal_t;
// *TODO: add xml support for this type of signal in the future
@@ -111,8 +107,8 @@ public:
commit_callback;
Optional<EnableCallbackParam> validate_callback;
- Optional<CommitCallbackParam> mouseenter_callback;
- Optional<CommitCallbackParam> mouseleave_callback;
+ Optional<CommitCallbackParam> mouseenter_callback,
+ mouseleave_callback;
Optional<std::string> control_name;
Optional<EnableControls> enabled_controls;