summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Nelson <richard@lindenlab.com>2011-10-12 16:17:24 -0700
committerRichard Nelson <richard@lindenlab.com>2011-10-12 16:17:24 -0700
commit3594853d0ef166c98d04c015b1217f2a437f8872 (patch)
tree591e927a45b317a8e8b9eb5f30154c71dd2c8b08
parent9ca4b8219f1a18b11d457d6f18d3c695aba9aed2 (diff)
don't highlight toolbar buttons during drag and drop
added mVisibleWhenMinimized to floaters
-rw-r--r--indra/llui/llfloater.cpp22
-rw-r--r--indra/llui/llfloater.h4
-rw-r--r--indra/llui/lltoolbar.cpp5
3 files changed, 25 insertions, 6 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 16fe3b8ca6..1e6c8b4a71 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1407,6 +1407,17 @@ void LLFloater::removeDependentFloater(LLFloater* floaterp)
floaterp->mDependeeHandle = LLHandle<LLFloater>();
}
+void LLFloater::setVisibleWhenMinimized(bool visible)
+{
+ mVisibleWhenMinimized = visible;
+ if (visible && isMinimized())
+ {
+ // restack in minimized stack
+ setMinimized(FALSE);
+ setMinimized(TRUE);
+ }
+}
+
BOOL LLFloater::offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButton index)
{
if( mButtonsEnabled[index] )
@@ -1783,11 +1794,14 @@ void LLFloater::draw()
}
if (isMinimized())
{
- for (S32 i = 0; i < BUTTON_COUNT; i++)
+ if (mVisibleWhenMinimized)
{
- drawChild(mButtons[i]);
+ for (S32 i = 0; i < BUTTON_COUNT; i++)
+ {
+ drawChild(mButtons[i]);
+ }
+ drawChild(mDragHandle);
}
- drawChild(mDragHandle);
}
else
{
@@ -2442,7 +2456,7 @@ void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom)
{
// Examine minimized children.
LLFloater* floater = (LLFloater*)((LLView*)*child_it);
- if(floater->isMinimized())
+ if(floater->isMinimized() && floater->getVisibleWhenMinimized())
{
LLRect r = floater->getRect();
if((r.mBottom < (row + floater_header_size))
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index c94aa0207e..5e3d3aefc9 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -213,7 +213,9 @@ public:
void addDependentFloater(LLHandle<LLFloater> dependent_handle, BOOL reposition = TRUE);
LLFloater* getDependee() { return (LLFloater*)mDependeeHandle.get(); }
void removeDependentFloater(LLFloater* dependent);
- BOOL isMinimized() const { return mMinimized; }
+ BOOL isMinimized() const { return mMinimized; }
+ void setVisibleWhenMinimized(bool visible);
+ bool getVisibleWhenMinimized() const { return mVisibleWhenMinimized;}
/// isShown() differs from getVisible() in that isShown() also considers
/// isMinimized(). isShown() is true only if visible and not minimized.
bool isShown() const;
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index a1ea4ba18b..02970bc969 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -871,7 +871,10 @@ void LLToolBarButton::onMouseEnter(S32 x, S32 y, MASK mask)
LLUICtrl::onMouseEnter(x, y, mask);
// Always highlight toolbar buttons, even if they are disabled
- mNeedsHighlight = TRUE;
+ if (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() != this)
+ {
+ mNeedsHighlight = TRUE;
+ }
}
void LLToolBarButton::onMouseCaptureLost()