From 4514b57126b2dae295602778589217f6e22451b8 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 18 Feb 2010 10:29:56 -0800 Subject: Backed out changeset: 744bd7c535fa --- indra/llui/llfloater.cpp | 15 +++++--- indra/llui/llresizehandle.cpp | 81 ++++++++++++++++++++++-------------------- indra/newview/llbottomtray.cpp | 5 --- 3 files changed, 52 insertions(+), 49 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 194325cc20..a17e306325 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2360,7 +2360,7 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out LLRect::tCoordType screen_width = getSnapRect().getWidth(); LLRect::tCoordType screen_height = getSnapRect().getHeight(); - + // only automatically resize non-minimized, resizable floaters if( floater->isResizable() && !floater->isMinimized() ) { @@ -2385,11 +2385,16 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out new_width = llmax(new_width, min_width); new_height = llmax(new_height, min_height); - LLRect new_rect; - new_rect.setLeftTopAndSize(view_rect.mTop,view_rect.mLeft,new_width, new_height); - floater->reshape( new_width, new_height, TRUE ); - floater->setRect(new_rect); + if (floater->followsRight()) + { + floater->translate(old_width - new_width, 0); + } + + if (floater->followsTop()) + { + floater->translate(0, old_height - new_height); + } } } diff --git a/indra/llui/llresizehandle.cpp b/indra/llui/llresizehandle.cpp index 3df09d124a..6239a8f721 100644 --- a/indra/llui/llresizehandle.cpp +++ b/indra/llui/llresizehandle.cpp @@ -124,7 +124,7 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) { // Make sure the mouse in still over the application. We don't want to make the parent // so big that we can't see the resize handle any more. - + S32 screen_x; S32 screen_y; localPointToScreen(x, y, &screen_x, &screen_y); @@ -146,61 +146,68 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) LLRect scaled_rect = orig_rect; S32 delta_x = screen_x - mDragLastScreenX; S32 delta_y = screen_y - mDragLastScreenY; - - if(delta_x == 0 && delta_y == 0) - return FALSE; - LLCoordGL mouse_dir; // use hysteresis on mouse motion to preserve user intent when mouse stops moving mouse_dir.mX = (screen_x == mLastMouseScreenX) ? mLastMouseDir.mX : screen_x - mLastMouseScreenX; mouse_dir.mY = (screen_y == mLastMouseScreenY) ? mLastMouseDir.mY : screen_y - mLastMouseScreenY; - mLastMouseScreenX = screen_x; mLastMouseScreenY = screen_y; mLastMouseDir = mouse_dir; - S32 new_width = orig_rect.getWidth(); - S32 new_height = orig_rect.getHeight(); + S32 x_multiple = 1; + S32 y_multiple = 1; + switch( mCorner ) + { + case LEFT_TOP: + x_multiple = -1; + y_multiple = 1; + break; + case LEFT_BOTTOM: + x_multiple = -1; + y_multiple = -1; + break; + case RIGHT_TOP: + x_multiple = 1; + y_multiple = 1; + break; + case RIGHT_BOTTOM: + x_multiple = 1; + y_multiple = -1; + break; + } - S32 new_pos_x = orig_rect.mLeft; - S32 new_pos_y = orig_rect.mTop; + S32 new_width = orig_rect.getWidth() + x_multiple * delta_x; + if( new_width < mMinWidth ) + { + new_width = mMinWidth; + delta_x = x_multiple * (mMinWidth - orig_rect.getWidth()); + } + + S32 new_height = orig_rect.getHeight() + y_multiple * delta_y; + if( new_height < mMinHeight ) + { + new_height = mMinHeight; + delta_y = y_multiple * (mMinHeight - orig_rect.getHeight()); + } switch( mCorner ) { - case LEFT_TOP: - new_width-=delta_x; - new_height+=delta_y; - new_pos_x+=delta_x; - new_pos_y+=delta_y; + case LEFT_TOP: + scaled_rect.translate(delta_x, 0); break; case LEFT_BOTTOM: - new_width-=delta_x; - new_height-=delta_y; - new_pos_x+=delta_x; + scaled_rect.translate(delta_x, delta_y); break; case RIGHT_TOP: - new_width+=delta_x; - new_height+=delta_y; - new_pos_y+=delta_y; break; case RIGHT_BOTTOM: - new_width+=delta_x; - new_height-=delta_y; + scaled_rect.translate(0, delta_y); break; } - new_width = llmax(new_width,mMinWidth); - new_height = llmax(new_height,mMinHeight); - - LLRect::tCoordType screen_width = resizing_view->getParent()->getSnapRect().getWidth(); - LLRect::tCoordType screen_height = resizing_view->getParent()->getSnapRect().getHeight(); - - new_width = llmin(new_width, screen_width); - new_height = llmin(new_height, screen_height); - // temporarily set new parent rect - scaled_rect.setLeftTopAndSize(new_pos_x,new_pos_y,new_width,new_height); - + scaled_rect.mRight = scaled_rect.mLeft + new_width; + scaled_rect.mTop = scaled_rect.mBottom + new_height; resizing_view->setRect(scaled_rect); LLView* snap_view = NULL; @@ -251,11 +258,7 @@ BOOL LLResizeHandle::handleHover(S32 x, S32 y, MASK mask) resizing_view->setRect(orig_rect); // translate and scale to new shape - resizing_view->reshape(scaled_rect.getWidth(),scaled_rect.getHeight()); - resizing_view->setRect(scaled_rect); - //set shape to handle dependent floaters... - resizing_view->handleReshape(scaled_rect, false); - + resizing_view->setShape(scaled_rect, true); // update last valid mouse cursor position based on resized view's actual size LLRect new_rect = resizing_view->getRect(); diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index bbdaf5449f..8a7ed23b59 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -325,11 +325,6 @@ void LLBottomTray::setVisible(BOOL visible) } } } - - if(visible) - gFloaterView->setSnapOffsetBottom(getRect().getHeight()); - else - gFloaterView->setSnapOffsetBottom(0); } void LLBottomTray::showBottomTrayContextMenu(S32 x, S32 y, MASK mask) -- cgit v1.2.3 From 876a764c4f8c71ad8858d07a04e05943583020e1 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 18 Feb 2010 12:49:31 -0800 Subject: EXT-5535 - Resize handles will move floater when reaching minimum size --- indra/llui/llfloater.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 342c0684da..53296fc7a1 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2373,7 +2373,11 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out new_width = llmax(new_width, min_width); new_height = llmax(new_height, min_height); - floater->reshape( new_width, new_height, TRUE ); + LLRect new_rect; + new_rect.setLeftTopAndSize(view_rect.mLeft,view_rect.mTop,new_width, new_height); + + floater->setShape(new_rect); + if (floater->followsRight()) { floater->translate(old_width - new_width, 0); -- cgit v1.2.3 From 3af609b55c591ecc572c0872ba1b3013885d8ac9 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 18 Feb 2010 12:57:05 -0800 Subject: fixed some spacing munged by merge --- indra/newview/llbottomtray.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 463add9f4b..459a61dec3 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -117,7 +117,7 @@ public: if (gAgent.cameraMouselook()) { LLBottomTray::getInstance()->setVisible(FALSE); -} + } } LLNearbyChatBar* mNearbyChatBar; @@ -319,7 +319,7 @@ void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, b } void LLBottomTray::onMouselookModeOut() - { +{ mIsInLiteMode = false; mBottomTrayLite->setVisible(FALSE); mNearbyChatBar->getChatBox()->setText(mBottomTrayLite->mNearbyChatBar->getChatBox()->getText()); @@ -350,10 +350,10 @@ void LLBottomTray::setVisible(BOOL visible) { mBottomTrayLite->setVisible(visible); } - else - { + else + { LLPanel::setVisible(visible); - } + } if(visible) gFloaterView->setSnapOffsetBottom(getRect().getHeight()); else @@ -566,7 +566,7 @@ void LLBottomTray::reshape(S32 width, S32 height, BOOL called_from_parent) { BOOL saved_anim = mToolbarStack->getAnimate(); // Set chiclet panel to be autoresized by default. - mToolbarStack->updatePanelAutoResize(PANEL_CHICLET_NAME, TRUE); + mToolbarStack->updatePanelAutoResize(PANEL_CHICLET_NAME, TRUE); // Disable animation to prevent layout updating in several frames. mToolbarStack->setAnimate(FALSE); // Force the updating of layout to reset panels collapse factor. @@ -1208,10 +1208,10 @@ bool LLBottomTray::setVisibleAndFitWidths(EResizeState object_type, bool visible // Nothing can be done, give up... return false; } - } + } if (result_width != current_width) - { + { cur_panel->reshape(result_width, cur_panel->getRect().getHeight()); current_width = result_width; } -- cgit v1.2.3