From d56be1f1751f66bff09f0d223ed4712974e69e09 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 7 Feb 2012 12:31:48 -0800 Subject: EXP-1181 WIP as a designer I would like to specify default floater positions using realtive coordinates refactored LLCoord code to be templated, ultimately to support arbitrary conversions --- indra/llui/llfloater.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra/llui/llfloater.h') diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 59b35d206f..1eb8c964f9 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -82,6 +82,9 @@ namespace LLInitParam }; } +struct LL_COORD_FLOATER; + +typedef LLCoord LLCoordFloater; class LLFloater : public LLPanel, public LLInstanceTracker { -- cgit v1.2.3 From 4e08461f8ad23fb75ca8587c781c2cf65351b1ab Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 7 Feb 2012 19:29:10 -0800 Subject: 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 --- indra/llui/llfloater.h | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'indra/llui/llfloater.h') diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 1eb8c964f9..a7cc9ae961 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -82,9 +82,37 @@ namespace LLInitParam }; } -struct LL_COORD_FLOATER; +struct LL_COORD_FLOATER +{ + typedef F32 value_t; + + LLCoordCommon convertToCommon() const; + void convertFromCommon(const LLCoordCommon& from); +protected: + LLHandle mFloater; +}; + +struct LLCoordFloater : LLCoord +{ + typedef LLCoord coord_t; -typedef LLCoord LLCoordFloater; + LLCoordFloater() {} + LLCoordFloater(F32 x, F32 y, LLFloater& floater); + LLCoordFloater(const LLCoordCommon& other, LLFloater& floater); + + LLCoordFloater& operator=(const LLCoordCommon& other) + { + convertFromCommon(other); + return *this; + } + + LLCoordFloater& operator=(const LLCoordFloater& other); + + bool operator==(const LLCoordFloater& other) const; + bool operator!=(const LLCoordFloater& other) const { return !(*this == other); } + + void setFloater(LLFloater& floater); +}; class LLFloater : public LLPanel, public LLInstanceTracker { @@ -187,7 +215,7 @@ public: bool initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node = NULL); /*virtual*/ void handleReshape(const LLRect& new_rect, bool by_user = false); - /*virtual*/ BOOL canSnapTo(const LLView* other_view); + /*virtual*/ BOOL canSnapTo(const LLView* other_view); /*virtual*/ void setSnappedTo(const LLView* snap_view); /*virtual*/ void setFocus( BOOL b ); /*virtual*/ void setIsChrome(BOOL is_chrome); @@ -428,6 +456,7 @@ private: LLFloaterEnums::EOpenPositioning mOpenPositioning; S32 mSpecifiedLeft; S32 mSpecifiedBottom; + LLCoordFloater mPosition; S32 mMinWidth; S32 mMinHeight; -- cgit v1.2.3 From 0fc6c5df969681659b1cc20bf06e9b1f8708d7a4 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 24 Feb 2012 16:54:54 -0800 Subject: EXP-1181 FIX As a designer, I would like to specify default floater positions using relative coordinates floaters given specified positions will stay in that location floaters that stack will treat that as a specified position moving any floater will switch to relative positioning mode cleaned up some XUI where widgets were relying on a default height of 10 pixels --- indra/llui/llfloater.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'indra/llui/llfloater.h') diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index a7cc9ae961..9b26adde40 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -64,7 +64,7 @@ namespace LLFloaterEnums { enum EOpenPositioning { - OPEN_POSITIONING_NONE, + OPEN_POSITIONING_RELATIVE, OPEN_POSITIONING_CASCADING, OPEN_POSITIONING_CASCADE_GROUP, OPEN_POSITIONING_CENTERED, @@ -163,10 +163,7 @@ public: can_dock, show_title; - Optional open_positioning; - Optional specified_left; - Optional specified_bottom; - + Optional positioning; Optional header_height, legacy_header_height; // HACK see initFromXML() @@ -355,7 +352,7 @@ public: void enableResizeCtrls(bool enable, bool width = true, bool height = true); - bool isPositioning(LLFloaterEnums::EOpenPositioning p) const { return (p == mOpenPositioning); } + bool isPositioning(LLFloaterEnums::EOpenPositioning p) const { return (p == mPositioning); } protected: void applyControlsAndPosition(LLFloater* other); @@ -453,9 +450,7 @@ private: BOOL mDragOnLeft; BOOL mResizable; - LLFloaterEnums::EOpenPositioning mOpenPositioning; - S32 mSpecifiedLeft; - S32 mSpecifiedBottom; + LLFloaterEnums::EOpenPositioning mPositioning; LLCoordFloater mPosition; S32 mMinWidth; -- cgit v1.2.3 From 0c7e91205f9b2fc8fe55e5a65f4bfa908d105c37 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 24 Feb 2012 16:57:12 -0800 Subject: EXP-1181 FIX As a designer, I would like to specify default floater positions using relative coordinates fixed bug where resizing window would cause stacked floaters to move relative to each other renamed positioning enums to reflect the fact that they apply all the time now, not just when opening floaters --- indra/llui/llfloater.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llui/llfloater.h') diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 9b26adde40..48dc290a93 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -64,12 +64,12 @@ namespace LLFloaterEnums { enum EOpenPositioning { - OPEN_POSITIONING_RELATIVE, - OPEN_POSITIONING_CASCADING, - OPEN_POSITIONING_CASCADE_GROUP, - OPEN_POSITIONING_CENTERED, - OPEN_POSITIONING_SPECIFIED, - OPEN_POSITIONING_COUNT + POSITIONING_RELATIVE, + POSITIONING_CASCADING, + POSITIONING_CASCADE_GROUP, + POSITIONING_CENTERED, + POSITIONING_SPECIFIED, + POSITIONING_COUNT }; } -- cgit v1.2.3 From fbfad41587a8ba723348eb848a7366f02da87052 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 27 Feb 2012 13:06:10 -0800 Subject: EXP-1181 FIX As a designer, I would like to specify default floater positions using relative coordinates store and load floater relative positions --- indra/llui/llfloater.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/llui/llfloater.h') diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 48dc290a93..4aa663d57e 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -269,8 +269,6 @@ public: BOOL isResizable() const { return mResizable; } void setResizeLimits( S32 min_width, S32 min_height ); void getResizeLimits( S32* min_width, S32* min_height ) { *min_width = mMinWidth; *min_height = mMinHeight; } - LLRect getSavedRect() const; - bool hasSavedRect() const; static std::string getControlName(const std::string& name, const LLSD& key); static LLControlGroup* getControlGroup(); @@ -361,6 +359,8 @@ protected: virtual bool applyRectControl(); bool applyDockState(); void applyPositioning(LLFloater* other); + void applyRelativePosition(); + void storeRectControl(); void storeVisibilityControl(); void storeDockStateControl(); @@ -424,7 +424,10 @@ public: commit_signal_t* mMinimizeSignal; protected: + bool mSaveRect; std::string mRectControl; + std::string mPosXControl; + std::string mPosYControl; std::string mVisibilityControl; std::string mDocStateControl; LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg -- cgit v1.2.3 From 80f2548371328f6fa1936ecc03a85a09f1b19508 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 28 Feb 2012 13:45:36 -0800 Subject: EXP-1918 FIX Floaters that are stacked are not offset EXP-1919 FIX Resizing viewer window with minimized floaters can result in floaters appearing off screen when un-minimized --- indra/llui/llfloater.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llui/llfloater.h') diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 4aa663d57e..64d6dcea04 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -358,7 +358,7 @@ protected: virtual bool applyRectControl(); bool applyDockState(); - void applyPositioning(LLFloater* other); + void applyPositioning(LLFloater* other, bool on_open); void applyRelativePosition(); void storeRectControl(); -- cgit v1.2.3