summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-10-12 17:50:03 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-10-12 17:50:03 -0700
commit1181e7c75747361e1a57f083cf82c63ef152bfc5 (patch)
tree03d41962e61ccbbe40d3dac843a0bfe74a81a3b4 /indra/llui
parent20358ea89dc9823ac0b539030fdf03268dbdf4e9 (diff)
parent3e55263e33fde4ab1ff19e8cfcb55125ee42b70d (diff)
Merge
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llbutton.cpp2
-rw-r--r--indra/llui/llfloater.cpp69
-rw-r--r--indra/llui/llfloater.h14
-rw-r--r--indra/llui/lltoolbar.cpp5
4 files changed, 82 insertions, 8 deletions
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index 0a7584a576..4f0c0d31bd 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -548,7 +548,7 @@ void LLButton::setHighlight(bool b)
BOOL LLButton::handleHover(S32 x, S32 y, MASK mask)
{
if (isInEnabledChain()
- && (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() != this))
+ && (!gFocusMgr.getMouseCapture() || gFocusMgr.getMouseCapture() == this))
mNeedsHighlight = TRUE;
if (!childrenHandleHover(x, y, mask))
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 984b710b9d..81b14aac17 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -252,6 +252,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p)
mHeaderHeight(p.header_height),
mLegacyHeaderHeight(p.legacy_header_height),
mMinimized(FALSE),
+ mVisibleWhenMinimized(TRUE),
mForeground(FALSE),
mFirstLook(TRUE),
mButtonScale(1.0f),
@@ -1432,6 +1433,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] )
@@ -1808,11 +1820,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
{
@@ -2467,7 +2482,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))
@@ -2532,6 +2547,52 @@ void LLFloaterView::closeAllChildren(bool app_quitting)
}
}
+void LLFloaterView::hiddenFloaterClosed(LLFloater* floater)
+{
+ for (hidden_floaters_t::iterator it = mHiddenFloaters.begin(), end_it = mHiddenFloaters.end();
+ it != end_it;
+ ++it)
+ {
+ if (it->first.get() == floater)
+ {
+ it->second.disconnect();
+ mHiddenFloaters.erase(it);
+ break;
+ }
+ }
+}
+
+void LLFloaterView::hideAllFloaters()
+{
+ child_list_t child_list = *(getChildList());
+
+ for (child_list_iter_t it = child_list.begin(); it != child_list.end(); ++it)
+ {
+ LLFloater* floaterp = dynamic_cast<LLFloater*>(*it);
+ if (floaterp && floaterp->getVisible())
+ {
+ floaterp->setVisible(false);
+ boost::signals2::connection connection = floaterp->mCloseSignal.connect(boost::bind(&LLFloaterView::hiddenFloaterClosed, this, floaterp));
+ mHiddenFloaters.push_back(std::make_pair(floaterp->getHandle(), connection));
+ }
+ }
+}
+
+void LLFloaterView::showHiddenFloaters()
+{
+ for (hidden_floaters_t::iterator it = mHiddenFloaters.begin(), end_it = mHiddenFloaters.end();
+ it != end_it;
+ ++it)
+ {
+ LLFloater* floaterp = it->first.get();
+ if (floaterp)
+ {
+ floaterp->setVisible(true);
+ }
+ it->second.disconnect();
+ }
+ mHiddenFloaters.clear();
+}
BOOL LLFloaterView::allChildrenClosed()
{
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index b094c76168..7cfec09e5f 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -35,6 +35,7 @@
#include "lluuid.h"
//#include "llnotificationsutil.h"
#include <set>
+#include <boost/signals2.hpp>
class LLDragHandle;
class LLResizeHandle;
@@ -216,6 +217,8 @@ public:
LLFloater* getDependee() { return (LLFloater*)mDependeeHandle.get(); }
void removeDependentFloater(LLFloater* dependent);
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;
@@ -426,6 +429,7 @@ private:
S32 mLegacyHeaderHeight;// HACK see initFloaterXML()
BOOL mMinimized;
+ bool mVisibleWhenMinimized;
BOOL mForeground;
LLHandle<LLFloater> mDependeeHandle;
@@ -461,8 +465,6 @@ private:
typedef std::map<LLHandle<LLFloater>, LLFloater*>::iterator handle_map_iter_t;
static handle_map_t sFloaterMap;
- std::vector<LLHandle<LLView> > mMinimizedHiddenChildren;
-
BOOL mHasBeenDraggedWhileMinimized;
S32 mPreviousMinimizedBottom;
S32 mPreviousMinimizedLeft;
@@ -516,6 +518,10 @@ public:
BOOL allChildrenClosed();
void shiftFloaters(S32 x_offset, S32 y_offset);
+ void hideAllFloaters();
+ void showHiddenFloaters();
+
+
LLFloater* getFrontmost() const;
LLFloater* getBackmost() const;
LLFloater* getParentFloater(LLView* viewp) const;
@@ -530,11 +536,15 @@ public:
void setFloaterSnapView(LLHandle<LLView> snap_view) {mSnapView = snap_view; }
private:
+ void hiddenFloaterClosed(LLFloater* floater);
+
LLHandle<LLView> mSnapView;
BOOL mFocusCycleMode;
S32 mSnapOffsetBottom;
S32 mSnapOffsetRight;
S32 mMinimizePositionVOffset;
+ typedef std::vector<std::pair<LLHandle<LLFloater>, boost::signals2::connection> > hidden_floaters_t;
+ hidden_floaters_t mHiddenFloaters;
};
//
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index 1320f03a25..541e01fb99 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -872,7 +872,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()