diff options
author | Richard Linden <none@none> | 2012-02-07 19:29:10 -0800 |
---|---|---|
committer | Richard Linden <none@none> | 2012-02-07 19:29:10 -0800 |
commit | 4e08461f8ad23fb75ca8587c781c2cf65351b1ab (patch) | |
tree | c6f48cdffa3c3436d517b808b3d432f095eee159 /indra/llui/llfloater.cpp | |
parent | d56be1f1751f66bff09f0d223ed4712974e69e09 (diff) |
EXP-1181 WIP as a designer I would like to specify default floater positions using realtive coordinates
changed over to new convert() method
added LLCoordFloater
Diffstat (limited to 'indra/llui/llfloater.cpp')
-rw-r--r-- | indra/llui/llfloater.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index cef5ba3fe7..6274caa97f 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -270,6 +270,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mMinimizeSignal(NULL) // mNotificationContext(NULL) { + mPosition.setFloater(*this); // mNotificationContext = new LLFloaterNotificationContext(getHandle()); // Clicks stop here. @@ -3271,3 +3272,45 @@ void LLFloater::stackWith(LLFloater& other) setShape(next_rect); } +LLCoordFloater::LLCoordFloater(F32 x, F32 y, LLFloater& floater) +: coord_t(x, y) +{ + mFloater = floater.getHandle(); +} + + +LLCoordFloater::LLCoordFloater(const LLCoordCommon& other, LLFloater& floater) +{ + mFloater = floater.getHandle(); + convertFromCommon(other); +} + +LLCoordFloater& LLCoordFloater::operator=(const LLCoordFloater& other) +{ + mFloater = other.mFloater; + coord_t::operator =(other); + return *this; +} + +void LLCoordFloater::setFloater(LLFloater& floater) +{ + mFloater = floater.getHandle(); +} + +bool LLCoordFloater::operator==(const LLCoordFloater& other) const +{ + return mX == other.mX && mY == other.mY && mFloater == other.mFloater; +} + +LLCoordCommon LL_COORD_FLOATER::convertToCommon() const +{ + const LLCoordFloater& self = static_cast<const LLCoordFloater&>(*this); + return LLCoordCommon(self.mX, self.mY); +} + +void LL_COORD_FLOATER::convertFromCommon(const LLCoordCommon& from) +{ + LLCoordFloater& self = static_cast<LLCoordFloater&>(*this); + self.mX = from.mX; + self.mY = from.mY; +} |