summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAlexei Arabadji <aarabadji@productengine.com>2009-12-26 12:04:55 +0200
committerAlexei Arabadji <aarabadji@productengine.com>2009-12-26 12:04:55 +0200
commit5383fb70c3a3b4abd1262825a5323cce5fb1a1e0 (patch)
tree541bf23470c70eac48d8be554d3577cb43a0477a /indra/llui
parentbed1ec4525f0bcfe634c4677feb29dbbdc3442c8 (diff)
Implemented EXT-1627 “Nearby Chat window behavior needs clarification”,
made non-unique docked floaters docks without dock tongue; --HG-- branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lldockablefloater.h11
-rw-r--r--indra/llui/lldockcontrol.cpp26
2 files changed, 35 insertions, 2 deletions
diff --git a/indra/llui/lldockablefloater.h b/indra/llui/lldockablefloater.h
index 2c0a484cc8..ae4f99e205 100644
--- a/indra/llui/lldockablefloater.h
+++ b/indra/llui/lldockablefloater.h
@@ -50,6 +50,16 @@ public:
LOG_CLASS(LLDockableFloater);
LLDockableFloater(LLDockControl* dockControl, const LLSD& key,
const Params& params = getDefaultParams());
+
+ /**
+ * Constructor.
+ * @param dockControl a pointer to the doc control instance
+ * @param uniqueDocking - a flag defines is docking should work as tab(at one
+ * moment only one docked floater can be shown), also this flag defines is dock
+ * tongue should be used.
+ * @params key a floater key.
+ * @params params a floater parameters
+ */
LLDockableFloater(LLDockControl* dockControl, bool uniqueDocking,
const LLSD& key, const Params& params = getDefaultParams());
virtual ~LLDockableFloater();
@@ -93,6 +103,7 @@ public:
virtual bool overlapsScreenChannel() { return mOverlapsScreenChannel && getVisible() && isDocked(); }
virtual void setOverlapsScreenChannel(bool overlaps) { mOverlapsScreenChannel = overlaps; }
+ bool getUniqueDocking() { return mUniqueDocking; }
private:
/**
* Provides unique of dockable floater.
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp
index 456a2925a3..1c3c8449c5 100644
--- a/indra/llui/lldockcontrol.cpp
+++ b/indra/llui/lldockcontrol.cpp
@@ -182,6 +182,14 @@ void LLDockControl::moveDockable()
LLRect rootRect;
mGetAllowedRectCallback(rootRect);
+ bool unique_docking = false;
+ LLDockableFloater* dockable_floater =
+ dynamic_cast<LLDockableFloater*> (mDockableFloater);
+ if (dockable_floater != NULL)
+ {
+ unique_docking = dockable_floater->getUniqueDocking();
+ }
+
LLRect dockableRect = mDockableFloater->calcScreenRect();
S32 x = 0;
S32 y = 0;
@@ -208,7 +216,13 @@ void LLDockControl::moveDockable()
case TOP:
x = dockRect.getCenterX() - dockableRect.getWidth() / 2;
- y = dockRect.mTop + mDockTongue->getHeight() + dockableRect.getHeight();
+ y = dockRect.mTop + dockableRect.getHeight();
+ // unique docking used with dock tongue, so add tongue height o the Y coordinate
+ if (unique_docking)
+ {
+ y += mDockTongue->getHeight();
+ }
+
// check is dockable inside root view rect
if (x < rootRect.mLeft)
{
@@ -273,7 +287,15 @@ void LLDockControl::forceRecalculatePosition()
void LLDockControl::drawToungue()
{
- if (mEnabled)
+ bool unique_docking = false;
+ LLDockableFloater* dockable_floater =
+ dynamic_cast<LLDockableFloater*> (mDockableFloater);
+ if (dockable_floater != NULL)
+ {
+ unique_docking = dockable_floater->getUniqueDocking();
+ }
+
+ if (mEnabled && unique_docking)
{
mDockTongue->draw(mDockTongueX, mDockTongueY);
}