From 61da565230c90f6053ca9608ec5cf7e327ddc70b Mon Sep 17 00:00:00 2001 From: Ansariel Date: Thu, 20 Feb 2014 08:29:49 +0100 Subject: [PATCH] Disable floater reposition code for testing --- indra/llui/llfloater.cpp | 84 ++++++++++++++++---------------- indra/newview/llviewerwindow.cpp | 28 +++++------ 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 07f24c2c04..1b30f12ad2 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2941,19 +2941,19 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } } - const LLRect& left_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_LEFT]; - const LLRect& bottom_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_BOTTOM]; - const LLRect& right_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_RIGHT]; - const LLRect& floater_rect = floater->getRect(); + //const LLRect& left_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_LEFT]; + //const LLRect& bottom_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_BOTTOM]; + //const LLRect& right_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_RIGHT]; + //const LLRect& floater_rect = floater->getRect(); - S32 delta_left = left_toolbar_rect.notEmpty() ? left_toolbar_rect.mRight - floater_rect.mRight : 0; - S32 delta_bottom = bottom_toolbar_rect.notEmpty() ? bottom_toolbar_rect.mTop - floater_rect.mTop : 0; - S32 delta_right = right_toolbar_rect.notEmpty() ? right_toolbar_rect.mLeft - floater_rect.mLeft : 0; - // Prevent floaters being dragged under main chat bar - S32 delta_bottom_chatbar = mMainChatbarRect.notEmpty() ? mMainChatbarRect.mTop - floater_rect.mTop : 0; + //S32 delta_left = left_toolbar_rect.notEmpty() ? left_toolbar_rect.mRight - floater_rect.mRight : 0; + //S32 delta_bottom = bottom_toolbar_rect.notEmpty() ? bottom_toolbar_rect.mTop - floater_rect.mTop : 0; + //S32 delta_right = right_toolbar_rect.notEmpty() ? right_toolbar_rect.mLeft - floater_rect.mLeft : 0; + //// Prevent floaters being dragged under main chat bar + //S32 delta_bottom_chatbar = mMainChatbarRect.notEmpty() ? mMainChatbarRect.mTop - floater_rect.mTop : 0; - // Fix floater relocation for vertical toolbars; Only header guarantees that floater can be dragged! - S32 header_height = floater->getHeaderHeight(); + //// Fix floater relocation for vertical toolbars; Only header guarantees that floater can be dragged! + //S32 header_height = floater->getHeaderHeight(); // move window fully onscreen if (floater->translateIntoRect( snap_in_toolbars ? getSnapRect() : gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) @@ -2961,37 +2961,37 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out floater->clearSnapTarget(); } // Fix floater relocation for vertical toolbars; Only header guarantees that floater can be dragged! - //else if (delta_left > 0 && floater_rect.mTop < left_toolbar_rect.mTop && floater_rect.mBottom > left_toolbar_rect.mBottom) - else if (delta_left > 0 && floater_rect.mTop < left_toolbar_rect.mTop && (floater_rect.mTop - header_height) > left_toolbar_rect.mBottom) - // - { - floater->translate(delta_left, 0); - } - // Prevent floaters being dragged under main chat bar - //else if (delta_bottom > 0 && floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mRight < bottom_toolbar_rect.mRight) - else if (delta_bottom > 0 && ((floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mRight < bottom_toolbar_rect.mRight) // floater completely within toolbar rect - || (floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mLeft < bottom_toolbar_rect.mRight && bottom_toolbar_rect.mRight > gFloaterView->getRect().mRight) // floater partially within toolbar rect, toolbar bound to right side - || (delta_bottom_chatbar > 0 && floater_rect.mLeft < mMainChatbarRect.mRight && floater_rect.mRight > bottom_toolbar_rect.mLeft && bottom_toolbar_rect.mLeft <= mMainChatbarRect.mRight)) // floater within chatbar and toolbar rect - ) - // - { - floater->translate(0, delta_bottom); - } - // Fix floater relocation for vertical toolbars; Only header guarantees that floater can be dragged! - //else if (delta_right < 0 && floater_rect.mTop < right_toolbar_rect.mTop && floater_rect.mBottom > right_toolbar_rect.mBottom) - else if (delta_right < 0 && floater_rect.mTop < right_toolbar_rect.mTop && (floater_rect.mTop - header_height) > right_toolbar_rect.mBottom) - // - { - floater->translate(delta_right, 0); - } - // Prevent floaters being dragged under main chat bar - else if (delta_bottom_chatbar > 0 && ((floater_rect.mLeft > mMainChatbarRect.mLeft && floater_rect.mRight < mMainChatbarRect.mRight) // floater completely within chatbar rect - || (floater_rect.mRight > mMainChatbarRect.mLeft && floater_rect.mRight < mMainChatbarRect.mRight && mMainChatbarRect.mLeft < gFloaterView->getRect().mLeft) // floater partially within chatbar rect, chatbar bound to left side - || (delta_bottom > 0 && floater_rect.mRight > bottom_toolbar_rect.mLeft && floater_rect.mLeft < mMainChatbarRect.mRight && bottom_toolbar_rect.mLeft <= mMainChatbarRect.mRight)) // floater within chatbar and toolbar rect - ) - { - floater->translate(0, delta_bottom_chatbar); - } + ////else if (delta_left > 0 && floater_rect.mTop < left_toolbar_rect.mTop && floater_rect.mBottom > left_toolbar_rect.mBottom) + //else if (delta_left > 0 && floater_rect.mTop < left_toolbar_rect.mTop && (floater_rect.mTop - header_height) > left_toolbar_rect.mBottom) + //// + //{ + // floater->translate(delta_left, 0); + //} + //// Prevent floaters being dragged under main chat bar + ////else if (delta_bottom > 0 && floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mRight < bottom_toolbar_rect.mRight) + //else if (delta_bottom > 0 && ((floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mRight < bottom_toolbar_rect.mRight) // floater completely within toolbar rect + // || (floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mLeft < bottom_toolbar_rect.mRight && bottom_toolbar_rect.mRight > gFloaterView->getRect().mRight) // floater partially within toolbar rect, toolbar bound to right side + // || (delta_bottom_chatbar > 0 && floater_rect.mLeft < mMainChatbarRect.mRight && floater_rect.mRight > bottom_toolbar_rect.mLeft && bottom_toolbar_rect.mLeft <= mMainChatbarRect.mRight)) // floater within chatbar and toolbar rect + // ) + //// + //{ + // floater->translate(0, delta_bottom); + //} + //// Fix floater relocation for vertical toolbars; Only header guarantees that floater can be dragged! + ////else if (delta_right < 0 && floater_rect.mTop < right_toolbar_rect.mTop && floater_rect.mBottom > right_toolbar_rect.mBottom) + //else if (delta_right < 0 && floater_rect.mTop < right_toolbar_rect.mTop && (floater_rect.mTop - header_height) > right_toolbar_rect.mBottom) + //// + //{ + // floater->translate(delta_right, 0); + //} + //// Prevent floaters being dragged under main chat bar + //else if (delta_bottom_chatbar > 0 && ((floater_rect.mLeft > mMainChatbarRect.mLeft && floater_rect.mRight < mMainChatbarRect.mRight) // floater completely within chatbar rect + // || (floater_rect.mRight > mMainChatbarRect.mLeft && floater_rect.mRight < mMainChatbarRect.mRight && mMainChatbarRect.mLeft < gFloaterView->getRect().mLeft) // floater partially within chatbar rect, chatbar bound to left side + // || (delta_bottom > 0 && floater_rect.mRight > bottom_toolbar_rect.mLeft && floater_rect.mLeft < mMainChatbarRect.mRight && bottom_toolbar_rect.mLeft <= mMainChatbarRect.mRight)) // floater within chatbar and toolbar rect + // ) + //{ + // floater->translate(0, delta_bottom_chatbar); + //} // } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 06cf34caba..819b9a6b7f 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1979,24 +1979,24 @@ void LLViewerWindow::initBase() // Constrain floaters to inside the menu and status bar regions. gFloaterView = main_view->getChild("Floater View"); - for (S32 i = 0; i < LLToolBarEnums::TOOLBAR_COUNT; ++i) - { - LLToolBar * toolbarp = gToolBarView->getToolbar((LLToolBarEnums::EToolBarLocation)i); - if (toolbarp) - { - toolbarp->getCenterLayoutPanel()->setReshapeCallback(boost::bind(&LLFloaterView::setToolbarRect, gFloaterView, _1, _2)); - } - } + //for (S32 i = 0; i < LLToolBarEnums::TOOLBAR_COUNT; ++i) + //{ + // LLToolBar * toolbarp = gToolBarView->getToolbar((LLToolBarEnums::EToolBarLocation)i); + // if (toolbarp) + // { + // toolbarp->getCenterLayoutPanel()->setReshapeCallback(boost::bind(&LLFloaterView::setToolbarRect, gFloaterView, _1, _2)); + // } + //} gFloaterView->setFloaterSnapView(main_view->getChild("floater_snap_region")->getHandle()); gSnapshotFloaterView = main_view->getChild("Snapshot Floater View"); // Prevent floaters being dragged under main chat bar - LLLayoutPanel* chatbar_panel = dynamic_cast(gToolBarView->getChildView("default_chat_bar")->getParent()); - if (chatbar_panel) - { - chatbar_panel->setReshapeCallback(boost::bind(&LLFloaterView::setMainChatbarRect, gFloaterView, _1, _2)); - gFloaterView->setMainChatbarRect(chatbar_panel, chatbar_panel->getRect()); - } + //LLLayoutPanel* chatbar_panel = dynamic_cast(gToolBarView->getChildView("default_chat_bar")->getParent()); + //if (chatbar_panel) + //{ + // chatbar_panel->setReshapeCallback(boost::bind(&LLFloaterView::setMainChatbarRect, gFloaterView, _1, _2)); + // gFloaterView->setMainChatbarRect(chatbar_panel, chatbar_panel->getRect()); + //} // // optionally forward warnings to chat console/chat floater