From 6b0f0a89fd6a8285f91c13699327182f513efbd5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 1 Mar 2012 13:23:01 -0800 Subject: CHUI-55 FIX Floaters that have set positions from old viewer versions can appear off screen until user repositions the floaters manually --- indra/llui/llfloater.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index f49b4edb98..d058b4ae44 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -884,22 +884,24 @@ bool LLFloater::applyRectControl() } } - if (!mPosXControl.empty() && !mPosYControl.empty()) - { - LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl); - LLControlVariablePtr y_control = getControlGroup()->getControl(mPosYControl); - if (x_control.notNull() - && y_control.notNull() - && !x_control->isDefault() - && !y_control->isDefault()) - { - mPosition.mX = x_control->getValue().asReal(); - mPosition.mY = y_control->getValue().asReal(); - mPositioning = LLFloaterEnums::POSITIONING_RELATIVE; - applyRelativePosition(); + LLControlVariablePtr x_control = getControlGroup()->getControl(mPosXControl); + LLControlVariablePtr y_control = getControlGroup()->getControl(mPosYControl); + if (x_control.notNull() + && y_control.notNull() + && !x_control->isDefault() + && !y_control->isDefault()) + { + mPosition.mX = x_control->getValue().asReal(); + mPosition.mY = y_control->getValue().asReal(); + mPositioning = LLFloaterEnums::POSITIONING_RELATIVE; + applyRelativePosition(); - saved_rect = true; - } + saved_rect = true; + } + else + { + LLRect screen_rect = calcScreenRect(); + mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert(); } } @@ -929,7 +931,6 @@ void LLFloater::applyPositioning(LLFloater* other, bool on_open) break; case LLFloaterEnums::POSITIONING_SPECIFIED: - //translateIntoRect(gFloaterView->getSnapRect()); break; case LLFloaterEnums::POSITIONING_CASCADE_GROUP: @@ -955,7 +956,6 @@ void LLFloater::applyPositioning(LLFloater* other, bool on_open) translate(snap_rect.mLeft, snap_rect.mBottom); } - //mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED; setFollows(FOLLOWS_TOP | FOLLOWS_LEFT); } break; -- cgit v1.2.3 From 6c60f214fd4959c9cd71df566edbfe0dc902496f Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 5 Mar 2012 20:10:17 -0800 Subject: CHUI-55 FIX Floaters that have set positions from old viewer versions can appear off screen until user repositions the floaters manually --- indra/llui/llfloater.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d058b4ae44..b091a4a1f7 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -933,8 +933,13 @@ void LLFloater::applyPositioning(LLFloater* other, bool on_open) case LLFloaterEnums::POSITIONING_SPECIFIED: break; - case LLFloaterEnums::POSITIONING_CASCADE_GROUP: case LLFloaterEnums::POSITIONING_CASCADING: + if (!on_open) + { + applyRelativePosition(); + } + // fall through + case LLFloaterEnums::POSITIONING_CASCADE_GROUP: if (on_open) { if (other != NULL && other != this) @@ -3286,7 +3291,7 @@ void LLFloater::stackWith(LLFloater& other) setShape(next_rect); - //other.mPositioning = LLFloaterEnums::POSITIONING_SPECIFIED; + other.mPositioning = LLFloaterEnums::POSITIONING_CASCADE_GROUP; other.setFollows(FOLLOWS_LEFT | FOLLOWS_TOP); } -- cgit v1.2.3 From 93aa231a18b9b5c9b3ab2ff162fa4928ac60d62b Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 6 Mar 2012 16:49:58 -0800 Subject: EXP-1767 WIP Received Items panel state does not persist between sessions ensure that layout stack has updated its layout before manually resizing one of its elements (which was causing the manual resize to be stomped on by the newly triggered layout update) made layout stack animation occur even when layout stack not visible (inventory will appear in proper open/closed state) LLView::setShape() now only calls handleReshape() when dimensions change removed extraneous calls to LLLayoutStack::updateClass() so that it should be called only once per frame now, allowing it to limit animation updates to layout stacks to one per frame. fixed rendering glitches arising from reshaping LLFolderView while in the middle of its draw() method --- indra/llui/lllayoutstack.cpp | 52 ++++++++++++++++++++++++++++---------------- indra/llui/llview.cpp | 5 ++++- 2 files changed, 37 insertions(+), 20 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index ae262f794e..988595f72a 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -172,12 +172,15 @@ void LLLayoutPanel::handleReshape(const LLRect& new_rect, bool by_user) LLLayoutStack* stackp = dynamic_cast(getParent()); if (stackp) { - stackp->mNeedsLayout = true; if (by_user) - { - // tell layout stack to account for new shape + { // tell layout stack to account for new shape + + // make sure that panels have already been auto resized + stackp->updateLayout(); + // now apply requested size to panel stackp->updatePanelRect(this, new_rect); } + stackp->mNeedsLayout = true; } LLPanel::handleReshape(new_rect, by_user); } @@ -241,7 +244,6 @@ void LLLayoutStack::draw() drawChild(panelp, 0, 0, !clip_rect.isEmpty()); } } - mAnimatedThisFrame = false; } void LLLayoutStack::removeChild(LLView* view) @@ -310,7 +312,7 @@ void LLLayoutStack::updateLayout() if (!mNeedsLayout) return; - bool animation_in_progress = animatePanels(); + bool continue_animating = animatePanels(); F32 total_visible_fraction = 0.f; S32 space_to_distribute = (mOrientation == HORIZONTAL) ? getRect().getWidth() @@ -415,7 +417,7 @@ void LLLayoutStack::updateLayout() // clear animation flag at end, since panel resizes will set it // and leave it set if there is any animation in progress - mNeedsLayout = animation_in_progress; + mNeedsLayout = continue_animating; } // end LLLayoutStack::updateLayout LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const @@ -488,6 +490,7 @@ void LLLayoutStack::updateClass() for (instance_iter it = beginInstances(); it != endInstances(); ++it) { it->updateLayout(); + it->mAnimatedThisFrame = false; } } @@ -557,7 +560,7 @@ void LLLayoutStack::normalizeFractionalSizes() bool LLLayoutStack::animatePanels() { - bool animation_in_progress = false; + bool continue_animating = false; // // animate visibility @@ -577,14 +580,15 @@ bool LLLayoutStack::animatePanels() } } - animation_in_progress = true; + mAnimatedThisFrame = true; + continue_animating = true; } else { if (panelp->mVisibleAmt != 1.f) { panelp->mVisibleAmt = 1.f; - animation_in_progress = true; + mAnimatedThisFrame = true; } } } @@ -601,14 +605,15 @@ bool LLLayoutStack::animatePanels() } } - animation_in_progress = true; + continue_animating = true; + mAnimatedThisFrame = true; } else { if (panelp->mVisibleAmt != 0.f) { panelp->mVisibleAmt = 0.f; - animation_in_progress = true; + mAnimatedThisFrame = true; } } } @@ -616,22 +621,31 @@ bool LLLayoutStack::animatePanels() F32 collapse_state = panelp->mCollapsed ? 1.f : 0.f; if (panelp->mCollapseAmt != collapse_state) { - if (!mAnimatedThisFrame) + if (mAnimate) { - panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); - } - animation_in_progress = true; + if (!mAnimatedThisFrame) + { + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, collapse_state, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + } - if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f) + if (llabs(panelp->mCollapseAmt - collapse_state) < 0.001f) + { + panelp->mCollapseAmt = collapse_state; + } + + mAnimatedThisFrame = true; + continue_animating = true; + } + else { panelp->mCollapseAmt = collapse_state; + mAnimatedThisFrame = true; } } } - mAnimatedThisFrame = true; - - return animation_in_progress; + if (mAnimatedThisFrame) mNeedsLayout = true; + return continue_animating; } void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& new_rect ) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 356d5c31d1..54843227b7 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1835,7 +1835,10 @@ const LLCtrlQuery & LLView::getFocusRootsQuery() void LLView::setShape(const LLRect& new_rect, bool by_user) { - handleReshape(new_rect, by_user); + if (new_rect != getRect()) + { + handleReshape(new_rect, by_user); + } } void LLView::handleReshape(const LLRect& new_rect, bool by_user) -- cgit v1.2.3 From bea2dfbc22bb2d80755dcf9daf810e1ea0329c2d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 6 Mar 2012 16:59:11 -0800 Subject: EXP-1767 WIP Received Items panel state does not persist between sessions added get/setTargetDim() for managing layout_panel size even if its collapsed/invisible/etc --- indra/llui/lllayoutstack.cpp | 21 ++++++++++++++++++++- indra/llui/lllayoutstack.h | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 988595f72a..4c730286da 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -113,7 +113,26 @@ S32 LLLayoutPanel::getLayoutDim() const ? getRect().getWidth() : getRect().getHeight())); } - + +S32 LLLayoutPanel::getTargetDim() const +{ + return mTargetDim; +} + +void LLLayoutPanel::setTargetDim(S32 value) +{ + LLRect new_rect(getRect()); + if (mOrientation == LLLayoutStack::HORIZONTAL) + { + new_rect.mRight = new_rect.mLeft + value; + } + else + { + new_rect.mTop = new_rect.mBottom + value; + } + setShape(new_rect, true); +} + S32 LLLayoutPanel::getVisibleDim() const { F32 min_dim = getRelevantMinDim(); diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index d32caec5f9..648cd5fdce 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -155,6 +155,8 @@ public: void setVisible(BOOL visible); S32 getLayoutDim() const; + S32 getTargetDim() const; + void setTargetDim(S32 value); S32 getMinDim() const { return llmax(0, mMinDim); } void setMinDim(S32 value) { mMinDim = value; } -- cgit v1.2.3 From b9521a38f11dd9f44f216adb7d02263d25272572 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 14 Mar 2012 15:00:48 -0700 Subject: CHUI-59 FIX Floater stacking offset only occurs first time a floater is opened changed stacking logic to attempt to stack against any floater that is cascade head *or* in a cascade group --- indra/llui/llfloaterreg.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index ef55e74166..3d124cf885 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -96,7 +96,9 @@ LLFloater* LLFloaterReg::getLastFloaterCascading() { LLFloater* inst = *iter; - if (inst->getVisible() && inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADING)) + if (inst->getVisible() + && (inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADING) + || inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADE_GROUP))) { if (candidate_rect.mTop > inst->getRect().mTop) { -- cgit v1.2.3 From 34c599858bd64b7fbda767ff9c9f7d8bcd2c2c25 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 16 Mar 2012 01:08:20 +0200 Subject: CHUI-53 FIXED vertical scroll bar in inventory floater to appear when horizontal scroll bar hides last item in folder view. Added a scroll container which provides the information about the height of currently displayed folder view contents. It is used for updating vertical scroll bar visibility in inventory panel. --- indra/llui/llscrollcontainer.cpp | 15 +++++++++++---- indra/llui/llscrollcontainer.h | 6 ++++-- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index 20bed050ad..9b7e30bb04 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -389,10 +389,17 @@ void LLScrollContainer::calcVisibleSize( S32 *visible_width, S32 *visible_height { *show_h_scrollbar = TRUE; *visible_height -= scrollbar_size; - // Note: Do *not* recompute *show_v_scrollbar here because with - // the (- scrollbar_size) we just did we will always add a vertical scrollbar - // even if the height of the items is actually less than the visible size. - // Fear not though: there's enough calcVisibleSize() calls to add a vertical slider later. + + // The view inside the scroll container should not be extended + // to container's full height to ensure the correct computation + // of *show_v_scrollbar after subtracting horizontal scrollbar_size. + + // Must retest now that visible_height has changed + if( !*show_v_scrollbar && ((doc_height - *visible_height) > 1) ) + { + *show_v_scrollbar = TRUE; + *visible_width -= scrollbar_size; + } } } } diff --git a/indra/llui/llscrollcontainer.h b/indra/llui/llscrollcontainer.h index 3aa79cc255..d87c95b3d7 100644 --- a/indra/llui/llscrollcontainer.h +++ b/indra/llui/llscrollcontainer.h @@ -91,7 +91,7 @@ public: void setReserveScrollCorner( BOOL b ) { mReserveScrollCorner = b; } LLRect getVisibleContentRect(); LLRect getContentWindowRect(); - const LLRect& getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; } + virtual const LLRect getScrolledViewRect() const { return mScrolledView ? mScrolledView->getRect() : LLRect::null; } void pageUp(S32 overlap = 0); void pageDown(S32 overlap = 0); void goToTop(); @@ -116,6 +116,9 @@ public: bool autoScroll(S32 x, S32 y); +protected: + LLView* mScrolledView; + private: // internal scrollbar handlers virtual void scrollHorizontal( S32 new_pos ); @@ -124,7 +127,6 @@ private: void calcVisibleSize( S32 *visible_width, S32 *visible_height, BOOL* show_h_scrollbar, BOOL* show_v_scrollbar ) const; LLScrollbar* mScrollbar[SCROLLBAR_COUNT]; - LLView* mScrolledView; S32 mSize; BOOL mIsOpaque; LLUIColor mBackgroundColor; -- cgit v1.2.3