diff options
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r-- | indra/llui/llfloater.cpp | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 14f75a2352..4f664a1ccc 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1326,7 +1326,7 @@ void LLFloater::setMinimized(BOOL minimize) } mMinimized = FALSE; - + setFrontmost(); // Reshape *after* setting mMinimized reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE ); } @@ -1575,6 +1575,7 @@ BOOL LLFloater::handleMouseDown(S32 x, S32 y, MASK mask) if(offerClickToButton(x, y, mask, BUTTON_TEAR_OFF)) return TRUE; if(offerClickToButton(x, y, mask, BUTTON_DOCK)) return TRUE; + setFrontmost(TRUE, FALSE); // Otherwise pass to drag handle for movement return mDragHandle->handleMouseDown(x, y, mask); } @@ -1649,7 +1650,7 @@ void LLFloater::setVisibleAndFrontmost(BOOL take_focus,const LLSD& key) } } -void LLFloater::setFrontmost(BOOL take_focus) +void LLFloater::setFrontmost(BOOL take_focus, BOOL restore) { LLMultiFloater* hostp = getHost(); if (hostp) @@ -1665,7 +1666,7 @@ void LLFloater::setFrontmost(BOOL take_focus) LLFloaterView * parent = dynamic_cast<LLFloaterView*>( getParent() ); if (parent) { - parent->bringToFront(this, take_focus); + parent->bringToFront(this, take_focus, restore); } // Make sure to set the appropriate transparency type (STORM-732). @@ -2262,7 +2263,7 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { LLView* viewp = *child_it; - LLFloater* floaterp = (LLFloater*)viewp; + LLFloater* floaterp = dynamic_cast<LLFloater*>(viewp); if (floaterp->isDependent()) { // dependents are moved with their "dependee" @@ -2317,10 +2318,14 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) void LLFloaterView::restoreAll() { // make sure all subwindows aren't minimized - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) + child_list_t child_list = *(getChildList()); + for (child_list_const_iter_t child_it = child_list.begin(); child_it != child_list.end(); ++child_it) { - LLFloater* floaterp = (LLFloater*)*child_it; - floaterp->setMinimized(FALSE); + LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it); + if (floaterp) + { + floaterp->setMinimized(FALSE); + } } // *FIX: make sure dependents are restored @@ -2394,7 +2399,7 @@ LLRect LLFloaterView::findNeighboringPosition( LLFloater* reference_floater, LLF } -void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus) +void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus, BOOL restore) { if (!child) return; @@ -2478,7 +2483,12 @@ void LLFloaterView::bringToFront(LLFloater* child, BOOL give_focus) { sendChildToFront(child); } - child->setMinimized(FALSE); + + if(restore) + { + child->setMinimized(FALSE); + } + if (give_focus && !gFocusMgr.childHasKeyboardFocus(child)) { child->setFocus(TRUE); @@ -2591,7 +2601,7 @@ void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) ++child_it) //loop floaters { // Examine minimized children. - LLFloater* floater = (LLFloater*)((LLView*)*child_it); + LLFloater* floater = dynamic_cast<LLFloater*>(*child_it); if(floater->isMinimized()) { LLRect r = floater->getRect(); @@ -2644,7 +2654,7 @@ void LLFloaterView::closeAllChildren(bool app_quitting) continue; } - LLFloater* floaterp = (LLFloater*)viewp; + LLFloater* floaterp = dynamic_cast<LLFloater*>(viewp); // Attempt to close floater. This will cause the "do you want to save" // dialogs to appear. @@ -2710,8 +2720,7 @@ BOOL LLFloaterView::allChildrenClosed() // by setting themselves invisible) for (child_list_const_iter_t it = getChildList()->begin(); it != getChildList()->end(); ++it) { - LLView* viewp = *it; - LLFloater* floaterp = (LLFloater*)viewp; + LLFloater* floaterp = dynamic_cast<LLFloater*>(*it); if (floaterp->getVisible() && !floaterp->isDead() && floaterp->isCloseable()) { @@ -2947,7 +2956,7 @@ void LLFloaterView::syncFloaterTabOrder() // otherwise, make sure the focused floater is in the front of the child list for ( child_list_const_reverse_iter_t child_it = getChildList()->rbegin(); child_it != getChildList()->rend(); ++child_it) { - LLFloater* floaterp = (LLFloater*)*child_it; + LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it); if (gFocusMgr.childHasKeyboardFocus(floaterp)) { bringToFront(floaterp, FALSE); @@ -2969,7 +2978,7 @@ LLFloater* LLFloaterView::getParentFloater(LLView* viewp) const if (parentp == this) { - return (LLFloater*)viewp; + return dynamic_cast<LLFloater*>(viewp); } return NULL; |