From 5cc44523f79b6cf495d2649fce9bf9e5181787e8 Mon Sep 17 00:00:00 2001 From: Aaron Brashears Date: Fri, 9 Feb 2007 23:35:12 +0000 Subject: Result of svn merge -r57350:57790 svn+ssh://svn/svn/linden/branches/os-patches.001 into release. --- indra/llui/llfloater.cpp | 63 ++++++++++++++++++++++++++++++----------- indra/llui/llscrolllistctrl.cpp | 2 +- 2 files changed, 47 insertions(+), 18 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index f6eb1e8bf8..5d4711ef10 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -765,8 +765,6 @@ void LLFloater::setMinimized(BOOL minimize) if (minimize) { - mMinimized = TRUE; - mPreviousRect = mRect; reshape( MINIMIZED_WIDTH, LLFLOATER_HEADER_SIZE, TRUE); @@ -812,6 +810,8 @@ void LLFloater::setMinimized(BOOL minimize) ++dependent_it; } + mMinimized = TRUE; + // Lose keyboard focus when minimized releaseFocus(); } @@ -2000,23 +2000,52 @@ void LLFloaterView::focusFrontFloater() void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) { - // count the number of minimized children - S32 count = 0; - for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) - { - LLView* viewp = *child_it; - LLFloater *floater = (LLFloater *)viewp; - if (floater->isMinimized()) - { - count++; - } + S32 col = 0; + LLRect snap_rect_local = getSnapRect(); + snap_rect_local.translate(-mRect.mLeft, -mRect.mBottom); + for(S32 row = snap_rect_local.mBottom; + row < snap_rect_local.getHeight() - LLFLOATER_HEADER_SIZE; + row += LLFLOATER_HEADER_SIZE ) //loop rows + { + for(col = snap_rect_local.mLeft; + col < snap_rect_local.getWidth() - MINIMIZED_WIDTH; + col += MINIMIZED_WIDTH) + { + bool foundGap = TRUE; + for(child_list_const_iter_t child_it = getChildList()->begin(); + child_it != getChildList()->end(); + ++child_it) //loop floaters + { + // Examine minimized children. + LLFloater* floater = (LLFloater*)((LLView*)*child_it); + if(floater->isMinimized()) + { + LLRect r = floater->getRect(); + if((r.mBottom < (row + LLFLOATER_HEADER_SIZE)) + && (r.mBottom > (row - LLFLOATER_HEADER_SIZE)) + && (r.mLeft < (col + MINIMIZED_WIDTH)) + && (r.mLeft > (col - MINIMIZED_WIDTH))) + { + // needs the check for off grid. can't drag, + // but window resize makes them off + foundGap = FALSE; + break; + } + } + } //done floaters + if(foundGap) + { + *left = col; + *bottom = row; + return; //done + } + } //done this col } - // space over for that many and up if necessary - S32 tiles_per_row = mRect.getWidth() / MINIMIZED_WIDTH; - - *left = (count % tiles_per_row) * MINIMIZED_WIDTH; - *bottom = (count / tiles_per_row) * LLFLOATER_HEADER_SIZE; + // crude - stack'em all at 0,0 when screen is full of minimized + // floaters. + *left = snap_rect_local.mLeft; + *bottom = snap_rect_local.mBottom; } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index d263c25c72..2b7cbe5cef 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -76,7 +76,7 @@ protected: // LLScrollListIcon // LLScrollListIcon::LLScrollListIcon(LLImageGL* icon, S32 width, LLUUID image_id) : -mIcon(icon), mImageUUID(image_id.getString()) +mIcon(icon), mImageUUID(image_id.asString()) { if (width) { -- cgit v1.2.3