summaryrefslogtreecommitdiff
path: root/indra/llui/llbutton.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2009-12-11 13:48:35 -0800
committerJames Cook <james@lindenlab.com>2009-12-11 13:48:35 -0800
commitfce0d168ae3e2e4380dc9aebbd5f68cd1f465f11 (patch)
tree0815e7a45872e30208151ae1bd51951466c7ff26 /indra/llui/llbutton.cpp
parentae9ca1be630e47e2314eabf9b8edb16eadda9828 (diff)
EXT-3233 Button label vertical placement cannot be adjusted via xml
Added bottom_pad attribute to widgets/button.xml and removed old LLBUTTON_VPAD global and ButtonVPad saved setting. Reviewed with Richard.
Diffstat (limited to 'indra/llui/llbutton.cpp')
-rw-r--r--indra/llui/llbutton.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 7721137e29..e9f6288f44 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -63,7 +63,6 @@ template class LLButton* LLView::getChild<class LLButton>(
// globals loaded from settings.xml
S32 LLBUTTON_H_PAD = 0;
-S32 LLBUTTON_V_PAD = 0;
S32 BTN_HEIGHT_SMALL= 0;
S32 BTN_HEIGHT = 0;
@@ -93,6 +92,7 @@ LLButton::Params::Params()
flash_color("flash_color"),
pad_right("pad_right", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")),
pad_left("pad_left", LLUI::sSettingGroups["config"]->getS32("ButtonHPad")),
+ pad_bottom("pad_bottom"),
click_callback("click_callback"),
mouse_down_callback("mouse_down_callback"),
mouse_up_callback("mouse_up_callback"),
@@ -148,6 +148,7 @@ LLButton::LLButton(const LLButton::Params& p)
mHAlign(p.font_halign),
mLeftHPad(p.pad_left),
mRightHPad(p.pad_right),
+ mBottomVPad(p.pad_bottom),
mHoverGlowStrength(p.hover_glow_amount),
mCommitOnReturn(p.commit_on_return),
mFadeWhenDisabled(FALSE),
@@ -839,7 +840,9 @@ void LLButton::draw()
// LLFontGL::render expects S32 max_chars variable but process in a separate way -1 value.
// Due to U32_MAX is equal to S32 -1 value I have rest this value for non-ellipses mode.
// Not sure if it is really needed. Probably S32_MAX should be always passed as max_chars.
- mLastDrawCharsCount = mGLFont->render(label, 0, (F32)x, (F32)(LLBUTTON_V_PAD + y_offset),
+ mLastDrawCharsCount = mGLFont->render(label, 0,
+ (F32)x,
+ (F32)(mBottomVPad + y_offset),
label_color % alpha,
mHAlign, LLFontGL::BOTTOM,
LLFontGL::NORMAL,