diff options
author | Oz Linden <oz@lindenlab.com> | 2010-11-15 07:27:50 -0500 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2010-11-15 07:27:50 -0500 |
commit | 0cd40b4409b237093a771b28933ac2a33fa9f266 (patch) | |
tree | 6aec2ccf66265722f4cb6f16774b54a7fa3eca49 /indra/newview/llcolorswatch.cpp | |
parent | ef46e7037ca59224dfcdf3745e165ee97b086a69 (diff) | |
parent | 5cbbb565f1bba870ec6db0b266e8768ecbdb7826 (diff) |
merge fix for STORM-579
Diffstat (limited to 'indra/newview/llcolorswatch.cpp')
-rw-r--r-- | indra/newview/llcolorswatch.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index c9a526a3be..e7634ff0f4 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -53,6 +53,7 @@ LLColorSwatchCtrl::Params::Params() alpha_background_image("alpha_background_image"), border_color("border_color"), label_width("label_width", -1), + label_height("label_height", -1), caption_text("caption_text"), border("border") { @@ -68,17 +69,20 @@ LLColorSwatchCtrl::LLColorSwatchCtrl(const Params& p) mOnCancelCallback(p.cancel_callback()), mOnSelectCallback(p.select_callback()), mBorderColor(p.border_color()), - mLabelWidth(p.label_width) + mLabelWidth(p.label_width), + mLabelHeight(p.label_height) { LLTextBox::Params tp = p.caption_text; + // use custom label height if it is provided + mLabelHeight = mLabelHeight != -1 ? mLabelHeight : BTN_HEIGHT_SMALL; // label_width is specified, not -1 if(mLabelWidth!= -1) { - tp.rect(LLRect( 0, BTN_HEIGHT_SMALL, mLabelWidth, 0 )); + tp.rect(LLRect( 0, mLabelHeight, mLabelWidth, 0 )); } else { - tp.rect(LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 )); + tp.rect(LLRect( 0, mLabelHeight, getRect().getWidth(), 0 )); } tp.initial_value(p.label()); @@ -88,7 +92,7 @@ LLColorSwatchCtrl::LLColorSwatchCtrl(const Params& p) LLRect border_rect = getLocalRect(); border_rect.mTop -= 1; border_rect.mRight -=1; - border_rect.mBottom += BTN_HEIGHT_SMALL; + border_rect.mBottom += mLabelHeight; LLViewBorder::Params params = p.border; params.rect(border_rect); @@ -194,7 +198,7 @@ void LLColorSwatchCtrl::draw() F32 alpha = getDrawContext().mAlpha; mBorder->setKeyboardFocusHighlight(hasFocus()); // Draw border - LLRect border( 0, getRect().getHeight(), getRect().getWidth(), BTN_HEIGHT_SMALL ); + LLRect border( 0, getRect().getHeight(), getRect().getWidth(), mLabelHeight ); gl_rect_2d( border, mBorderColor.get(), FALSE ); LLRect interior = border; |