EXP-1400 FIXED (Call request docking icon overlays other toolbar buttons when speak button in side toolbar)

- LLDockableFloater::getDockTongue to init dock tongue with proper image depending on floater dock side, also added images for left and right tongues.

- Added proper call floater positioning relatively to the speak button
meow-7.2.2
Paul ProductEngine 2011-10-24 14:17:15 +02:00
parent 443d1b08b2
commit 338914bd7d
9 changed files with 69 additions and 23 deletions

View File

@ -239,8 +239,21 @@ void LLDockableFloater::setDockControl(LLDockControl* dockControl)
setDocked(isDocked());
}
const LLUIImagePtr& LLDockableFloater::getDockTongue()
const LLUIImagePtr& LLDockableFloater::getDockTongue(LLDockControl::DocAt dock_side)
{
switch(dock_side)
{
case LLDockControl::LEFT:
mDockTongue = LLUI::getUIImage("windows/Flyout_Left.png");
break;
case LLDockControl::RIGHT:
mDockTongue = LLUI::getUIImage("windows/Flyout_Right.png");
break;
default:
mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png");
break;
}
return mDockTongue;
}

View File

@ -124,7 +124,7 @@ private:
protected:
void setDockControl(LLDockControl* dockControl);
const LLUIImagePtr& getDockTongue();
const LLUIImagePtr& getDockTongue(LLDockControl::DocAt dock_side = LLDockControl::TOP);
// Checks if docking should be forced.
// It may be useful e.g. if floater created in mouselook mode (see EXT-5609)

View File

@ -203,21 +203,33 @@ void LLDockControl::moveDockable()
switch (mDockAt)
{
case LEFT:
x = dockRect.mLeft;
y = dockRect.mTop + mDockTongue->getHeight() + dockableRect.getHeight();
// check is dockable inside root view rect
if (x < rootRect.mLeft)
{
x = rootRect.mLeft;
}
if (x + dockableRect.getWidth() > rootRect.mRight)
{
x = rootRect.mRight - dockableRect.getWidth();
}
x = dockRect.mLeft - dockableRect.getWidth();
y = dockRect.getCenterY() + dockableRect.getHeight() / 2;
mDockTongueX = x + dockableRect.getWidth()/2 - mDockTongue->getWidth() / 2;
if (use_tongue)
{
x -= mDockTongue->getWidth();
}
mDockTongueX = dockableRect.mRight;
mDockTongueY = dockableRect.getCenterY() - mDockTongue->getHeight() / 2;
mDockTongueY = dockRect.mTop;
break;
case RIGHT:
x = dockRect.mRight;
y = dockRect.getCenterY() + dockableRect.getHeight() / 2;
if (use_tongue)
{
x += mDockTongue->getWidth();
}
mDockTongueX = dockRect.mRight;
mDockTongueY = dockableRect.getCenterY() - mDockTongue->getHeight() / 2;
break;
case TOP:
@ -315,13 +327,12 @@ void LLDockControl::moveDockable()
dockableRect.setLeftTopAndSize(x, y, dockableRect.getWidth(),
dockableRect.getHeight());
}
LLRect localDocableParentRect;
mDockableFloater->getParent()->screenRectToLocal(dockableRect,
&localDocableParentRect);
mDockableFloater->setRect(localDocableParentRect);
mDockableFloater->screenPointToLocal(mDockTongueX, mDockTongueY,
&mDockTongueX, &mDockTongueY);
LLRect localDocableParentRect;
mDockableFloater->getParent()->screenRectToLocal(dockableRect, &localDocableParentRect);
mDockableFloater->setRect(localDocableParentRect);
mDockableFloater->screenPointToLocal(mDockTongueX, mDockTongueY, &mDockTongueX, &mDockTongueY);
}

View File

@ -43,6 +43,7 @@ public:
{
TOP,
LEFT,
RIGHT,
BOTTOM
};

View File

@ -1681,7 +1681,8 @@ BOOL LLCallDialog::postBuild()
return FALSE;
LLView *anchor_panel = gToolBarView->findChildView("speak");
setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(), LLDockControl::TOP));
LLDockControl::DocAt dock_pos = getDockControlPos();
setDockControl(new LLDockControl(anchor_panel, this, getDockTongue(dock_pos), dock_pos));
setUseTongue(anchor_panel);
@ -1751,6 +1752,22 @@ void LLCallDialog::setIcon(const LLSD& session_id, const LLSD& participant_id)
}
}
LLDockControl::DocAt LLCallDialog::getDockControlPos()
{
LLToolBar* tool_bar = NULL;
if((tool_bar = gToolBarView->getChild<LLToolBar>("toolbar_left")) && tool_bar->hasChild("speak", true))
{
return LLDockControl::RIGHT; // Speak button in the left toolbar so the call floater should be to the right of the speak button
}
else if((tool_bar = gToolBarView->getChild<LLToolBar>("toolbar_right")) && tool_bar->hasChild("speak", true))
{
return LLDockControl::LEFT; // Speak button in the right toolbar so the call floater should be to the left of the speak button
}
return LLDockControl::TOP;
}
bool LLCallDialog::lifetimeHasExpired()
{
if (mLifetimeTimer.getStarted())

View File

@ -491,7 +491,7 @@ class LLCallDialog : public LLDockableFloater
{
public:
LLCallDialog(const LLSD& payload);
~LLCallDialog();
virtual ~LLCallDialog();
virtual BOOL postBuild();
@ -519,6 +519,9 @@ protected:
void setIcon(const LLSD& session_id, const LLSD& participant_id);
LLSD mPayload;
private:
LLDockControl::DocAt getDockControlPos();
};
class LLIncomingCallDialog : public LLCallDialog

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 B

View File

@ -8,6 +8,7 @@
layout="topleft"
name="outgoing call"
help_topic="outgoing_call"
save_dock_state="true"
title="CALLING"
width="410">
<floater.string