summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2011-10-10 17:52:37 -0700
committerRichard Nelson <richard@lindenlab.com>2011-10-10 17:52:37 -0700
commit6a570a9bdc2660e4db87e8e7a65b724e1ad8d1b2 (patch)
tree9ae19a2dbcc4e314eedfe3c6372834b666cd6078 /indra/llui
parent068035959804d6a16a41ddb2ef62da00dceb2689 (diff)
fixed icons moving when clicking on icon-only toolbars
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llbutton.cpp2
-rw-r--r--indra/llui/lltoolbar.cpp5
-rw-r--r--indra/llui/lltoolbar.h2
3 files changed, 8 insertions, 1 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 68cb5164b6..ba3748a573 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -1002,7 +1002,7 @@ void LLButton::resize(LLUIString label)
if (mImageOverlay)
{
S32 overlay_width = mImageOverlay->getWidth();
- F32 scale_factor = getRect().getHeight() / (F32)mImageOverlay->getHeight();
+ F32 scale_factor = (getRect().getHeight() - (mImageOverlayBottomPad + mImageOverlayTopPad)) / (F32)mImageOverlay->getHeight();
overlay_width = llround((F32)overlay_width * scale_factor);
switch(mImageOverlayAlignment)
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 6332b2674a..5ba54edf1c 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -852,3 +852,8 @@ void LLToolBarButton::onMouseCaptureLost()
{
mIsDragged = false;
}
+
+void LLToolBarButton::reshape(S32 width, S32 height, BOOL called_from_parent)
+{
+ LLButton::reshape(mWidthRange.clamp(width), height, called_from_parent);
+}
diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h
index 84fa7ec0df..a81a5fdb39 100644
--- a/indra/llui/lltoolbar.h
+++ b/indra/llui/lltoolbar.h
@@ -62,6 +62,8 @@ public:
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
BOOL handleHover(S32 x, S32 y, MASK mask);
+ void reshape(S32 width, S32 height, BOOL called_from_parent = true);
+
void setCommandId(const LLCommandId& id) { mId = id; }
void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; }