summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-02-08 18:14:57 +0000
committerTofu Linden <tofu.linden@lindenlab.com>2010-02-08 18:14:57 +0000
commit3ab0c3238bec95863784850d2a95e9c09afce539 (patch)
tree86e5788c95caf5553a0015e152bcf0a6c5d5cd1b /indra/llui
parentac59a7c130f3fcbbb8f228bdf69c44ffa09f07a2 (diff)
parent6b92b866e49408622ed02b85a0518b01cdbcf7a9 (diff)
PE merge.
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llbutton.cpp14
-rw-r--r--indra/llui/llbutton.h18
-rw-r--r--indra/llui/lltabcontainer.cpp4
3 files changed, 16 insertions, 20 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 14b77925f2..1d4dc35cee 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -81,10 +81,9 @@ LLButton::Params::Params()
image_pressed_selected("image_pressed_selected"),
image_overlay("image_overlay"),
image_overlay_alignment("image_overlay_alignment", std::string("center")),
- image_left_pad("image_left_pad"),
- image_right_pad("image_right_pad"),
image_top_pad("image_top_pad"),
image_bottom_pad("image_bottom_pad"),
+ imgoverlay_label_space("imgoverlay_label_space", 1),
label_color("label_color"),
label_color_selected("label_color_selected"), // requires is_toggle true
label_color_disabled("label_color_disabled"),
@@ -144,10 +143,9 @@ LLButton::LLButton(const LLButton::Params& p)
mImageOverlay(p.image_overlay()),
mImageOverlayColor(p.image_overlay_color()),
mImageOverlayAlignment(LLFontGL::hAlignFromName(p.image_overlay_alignment)),
- mImageOverlayLeftPad(p.image_left_pad),
- mImageOverlayRightPad(p.image_right_pad),
mImageOverlayTopPad(p.image_top_pad),
mImageOverlayBottomPad(p.image_bottom_pad),
+ mImgOverlayLabelSpace(p.imgoverlay_label_space),
mIsToggle(p.is_toggle),
mScaleImage(p.scale_image),
mDropShadowedText(p.label_shadow),
@@ -783,9 +781,9 @@ void LLButton::draw()
switch(mImageOverlayAlignment)
{
case LLFontGL::LEFT:
- text_left += overlay_width + 1;
+ text_left += overlay_width + mImgOverlayLabelSpace;
mImageOverlay->draw(
- mImageOverlayLeftPad,
+ mLeftHPad,
center_y - (overlay_height / 2),
overlay_width,
overlay_height,
@@ -800,9 +798,9 @@ void LLButton::draw()
overlay_color);
break;
case LLFontGL::RIGHT:
- text_right -= overlay_width + 1;
+ text_right -= overlay_width + mImgOverlayLabelSpace;
mImageOverlay->draw(
- getRect().getWidth() - mImageOverlayRightPad - overlay_width,
+ getRect().getWidth() - mRightHPad - overlay_width,
center_y - (overlay_height / 2),
overlay_width,
overlay_height,
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h
index 8e5f19602f..8f35db1007 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -107,11 +107,14 @@ public:
Optional<S32> pad_bottom; // under text label
//image overlay paddings
- Optional<S32> image_left_pad;
- Optional<S32> image_right_pad;
Optional<S32> image_top_pad;
Optional<S32> image_bottom_pad;
+ /**
+ * Space between image_overlay and label
+ */
+ Optional<S32> imgoverlay_label_space;
+
// callbacks
Optional<CommitCallbackParam> click_callback, // alias -> commit_callback
mouse_down_callback,
@@ -192,10 +195,6 @@ public:
void setLeftHPad( S32 pad ) { mLeftHPad = pad; }
void setRightHPad( S32 pad ) { mRightHPad = pad; }
- void setImageOverlayLeftPad( S32 pad ) { mImageOverlayLeftPad = pad; }
- S32 getImageOverlayLeftPad() const { return mImageOverlayLeftPad; }
- void setImageOverlayRightPad( S32 pad ) { mImageOverlayRightPad = pad; }
- S32 getImageOverlayRightPad() const { return mImageOverlayRightPad; }
void setImageOverlayTopPad( S32 pad ) { mImageOverlayTopPad = pad; }
S32 getImageOverlayTopPad() const { return mImageOverlayTopPad; }
void setImageOverlayBottomPad( S32 pad ) { mImageOverlayBottomPad = pad; }
@@ -328,11 +327,14 @@ private:
S32 mRightHPad;
S32 mBottomVPad; // under text label
- S32 mImageOverlayLeftPad;
- S32 mImageOverlayRightPad;
S32 mImageOverlayTopPad;
S32 mImageOverlayBottomPad;
+ /*
+ * Space between image_overlay and label
+ */
+ S32 mImgOverlayLabelSpace;
+
F32 mHoverGlowStrength;
F32 mCurGlowStrength;
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index 19408989a5..ef9d195a19 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1628,15 +1628,11 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon)
void LLTabContainer::reshapeTuple(LLTabTuple* tuple)
{
static LLUICachedControl<S32> tab_padding ("UITabPadding", 0);
- static LLUICachedControl<S32> image_left_padding ("UIButtonImageLeftPadding", 4);
- static LLUICachedControl<S32> image_right_padding ("UIButtonImageRightPadding", 4);
static LLUICachedControl<S32> image_top_padding ("UIButtonImageTopPadding", 2);
static LLUICachedControl<S32> image_bottom_padding ("UIButtonImageBottomPadding", 2);
if (!mIsVertical)
{
- tuple->mButton->setImageOverlayLeftPad(image_left_padding);
- tuple->mButton->setImageOverlayRightPad(image_right_padding);
tuple->mButton->setImageOverlayTopPad(image_top_padding);
tuple->mButton->setImageOverlayBottomPad(image_bottom_padding);