summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2011-10-24 18:12:11 -0700
committerMerov Linden <merov@lindenlab.com>2011-10-24 18:12:11 -0700
commit71bc6007471f3303c0ddf4ab7fd8f57ec52b3f56 (patch)
tree0732cbe87cffb1e39329af0c7cce341fc64affdd
parent94d34aef5b2862a587095a664b6d6f33079dcd93 (diff)
parent338914bd7d7e776d3ca5a4eb9a579fcbe53cf1b9 (diff)
Pull from paulgproductengine/exp-1400
-rw-r--r--indra/llui/lldockablefloater.cpp15
-rw-r--r--indra/llui/lldockablefloater.h2
-rw-r--r--indra/llui/lldockcontrol.cpp43
-rw-r--r--indra/llui/lldockcontrol.h1
-rw-r--r--indra/newview/llimview.cpp19
-rw-r--r--indra/newview/llimview.h5
-rw-r--r--indra/newview/skins/default/textures/windows/Flyout_Left.pngbin0 -> 271 bytes
-rw-r--r--indra/newview/skins/default/textures/windows/Flyout_Right.pngbin0 -> 280 bytes
-rw-r--r--indra/newview/skins/default/xui/en/floater_outgoing_call.xml1
9 files changed, 66 insertions, 20 deletions
diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp
index aea58be12a..0fcd937361 100644
--- a/indra/llui/lldockablefloater.cpp
+++ b/indra/llui/lldockablefloater.cpp
@@ -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;
}
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index 1484ea3978..89c9852f4a 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -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)
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp
index 6397bbd0de..8cb2e57b98 100644
--- a/indra/llui/lldockcontrol.cpp
+++ b/indra/llui/lldockcontrol.cpp
@@ -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 = dockRect.mLeft - dockableRect.getWidth();
+ y = dockRect.getCenterY() + dockableRect.getHeight() / 2;
+
+ if (use_tongue)
{
- x = rootRect.mLeft;
+ x -= mDockTongue->getWidth();
}
- if (x + dockableRect.getWidth() > rootRect.mRight)
+
+ mDockTongueX = dockableRect.mRight;
+ mDockTongueY = dockableRect.getCenterY() - mDockTongue->getHeight() / 2;
+
+ break;
+
+ case RIGHT:
+
+ x = dockRect.mRight;
+ y = dockRect.getCenterY() + dockableRect.getHeight() / 2;
+
+ if (use_tongue)
{
- x = rootRect.mRight - dockableRect.getWidth();
+ x += mDockTongue->getWidth();
}
-
- mDockTongueX = x + dockableRect.getWidth()/2 - mDockTongue->getWidth() / 2;
-
- mDockTongueY = dockRect.mTop;
+
+ 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);
+ mDockableFloater->getParent()->screenRectToLocal(dockableRect, &localDocableParentRect);
+ mDockableFloater->setRect(localDocableParentRect);
+ mDockableFloater->screenPointToLocal(mDockTongueX, mDockTongueY, &mDockTongueX, &mDockTongueY);
}
diff --git a/indra/llui/lldockcontrol.h b/indra/llui/lldockcontrol.h
index 2e7359245f..463223fafd 100644
--- a/indra/llui/lldockcontrol.h
+++ b/indra/llui/lldockcontrol.h
@@ -43,6 +43,7 @@ public:
{
TOP,
LEFT,
+ RIGHT,
BOTTOM
};
diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp
index 33c6b2218c..c751394455 100644
--- a/indra/newview/llimview.cpp
+++ b/indra/newview/llimview.cpp
@@ -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())
diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h
index 93b604d36a..33c7ae9e54 100644
--- a/indra/newview/llimview.h
+++ b/indra/newview/llimview.h
@@ -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
diff --git a/indra/newview/skins/default/textures/windows/Flyout_Left.png b/indra/newview/skins/default/textures/windows/Flyout_Left.png
new file mode 100644
index 0000000000..6ac9fe2efd
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/Flyout_Left.png
Binary files differ
diff --git a/indra/newview/skins/default/textures/windows/Flyout_Right.png b/indra/newview/skins/default/textures/windows/Flyout_Right.png
new file mode 100644
index 0000000000..aa1f0625aa
--- /dev/null
+++ b/indra/newview/skins/default/textures/windows/Flyout_Right.png
Binary files differ
diff --git a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml
index 9db6568ee3..ffbb6aa28b 100644
--- a/indra/newview/skins/default/xui/en/floater_outgoing_call.xml
+++ b/indra/newview/skins/default/xui/en/floater_outgoing_call.xml
@@ -8,6 +8,7 @@
layout="topleft"
name="outgoing call"
help_topic="outgoing_call"
+ save_dock_state="true"
title="CALLING"
width="410">
<floater.string