Disable floater reposition code for testing
parent
ac7a978f27
commit
61da565230
|
|
@ -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;
|
||||
// <FS:Ansariel> 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;
|
||||
//// <FS:Ansariel> Prevent floaters being dragged under main chat bar
|
||||
//S32 delta_bottom_chatbar = mMainChatbarRect.notEmpty() ? mMainChatbarRect.mTop - floater_rect.mTop : 0;
|
||||
|
||||
// <FS:Ansariel> Fix floater relocation for vertical toolbars; Only header guarantees that floater can be dragged!
|
||||
S32 header_height = floater->getHeaderHeight();
|
||||
//// <FS:Ansariel> 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();
|
||||
}
|
||||
// <FS:Ansariel> 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)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
floater->translate(delta_left, 0);
|
||||
}
|
||||
// <FS:Ansariel> 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
|
||||
)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
floater->translate(0, delta_bottom);
|
||||
}
|
||||
// <FS:Ansariel> 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)
|
||||
// </FS:Ansariel>
|
||||
{
|
||||
floater->translate(delta_right, 0);
|
||||
}
|
||||
// <FS:Ansariel> 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)
|
||||
//// </FS:Ansariel>
|
||||
//{
|
||||
// floater->translate(delta_left, 0);
|
||||
//}
|
||||
//// <FS:Ansariel> 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
|
||||
// )
|
||||
//// </FS:Ansariel>
|
||||
//{
|
||||
// floater->translate(0, delta_bottom);
|
||||
//}
|
||||
//// <FS:Ansariel> 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)
|
||||
//// </FS:Ansariel>
|
||||
//{
|
||||
// floater->translate(delta_right, 0);
|
||||
//}
|
||||
//// <FS:Ansariel> 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);
|
||||
//}
|
||||
// </FS:Ansariel>
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1979,24 +1979,24 @@ void LLViewerWindow::initBase()
|
|||
|
||||
// Constrain floaters to inside the menu and status bar regions.
|
||||
gFloaterView = main_view->getChild<LLFloaterView>("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<LLView>("floater_snap_region")->getHandle());
|
||||
gSnapshotFloaterView = main_view->getChild<LLSnapshotFloaterView>("Snapshot Floater View");
|
||||
|
||||
// <FS:Ansariel> Prevent floaters being dragged under main chat bar
|
||||
LLLayoutPanel* chatbar_panel = dynamic_cast<LLLayoutPanel*>(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<LLLayoutPanel*>(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());
|
||||
//}
|
||||
// </FS:Ansariel>
|
||||
|
||||
// optionally forward warnings to chat console/chat floater
|
||||
|
|
|
|||
Loading…
Reference in New Issue