From f443f3e84725d01d47b96a3385ee9ccc494ede89 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 25 Mar 2011 19:13:32 -0700 Subject: SOCIAL-717 FIX Artwork for click to move hint updated resize logic for hint popups to accomodate image size --- indra/newview/llhints.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index c4dcaf11f9..97f0e36a0c 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -191,6 +191,8 @@ BOOL LLHintPopup::postBuild() LLRect text_bounds = hint_text.getTextBoundingRect(); S32 delta_height = text_bounds.getHeight() - hint_text.getRect().getHeight(); reshape(getRect().getWidth(), getRect().getHeight() + delta_height); + hint_text.reshape(hint_text.getRect().getWidth(), hint_text.getRect().getHeight() + delta_height); + hint_text.translate(0, -delta_height); return TRUE; } @@ -211,6 +213,18 @@ void LLHintPopup::draw() alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f); } + LLIconCtrl& hint_icon = getChildRef("hint_image"); + + LLUIImagePtr hint_image = hint_icon.getImage(); + S32 image_height = hint_image.isNull() ? 0 : hint_image->getHeight(); + S32 image_width = hint_image.isNull() ? 0 : hint_image->getWidth(); + + S32 delta_height = image_height - hint_icon.getRect().getHeight(); + hint_icon.getParent()->reshape(image_width, image_height); + + LLRect hint_rect = getLocalRect(); + reshape(hint_rect.getWidth(), hint_rect.getHeight() + delta_height); + { LLViewDrawContext context(alpha); if (mTarget.empty()) -- cgit v1.2.3 From 760e672e80de881c0a501dd0b44cfac1342b11c2 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 1 Apr 2011 00:10:05 -0700 Subject: SOCIAL-822 FIX UI and Sizing issues with hints in Basic and Advanced modes --- indra/newview/llhints.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 97f0e36a0c..722d67caf9 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -192,7 +192,7 @@ BOOL LLHintPopup::postBuild() S32 delta_height = text_bounds.getHeight() - hint_text.getRect().getHeight(); reshape(getRect().getWidth(), getRect().getHeight() + delta_height); hint_text.reshape(hint_text.getRect().getWidth(), hint_text.getRect().getHeight() + delta_height); - hint_text.translate(0, -delta_height); +// hint_text.translate(0, -delta_height); return TRUE; } @@ -219,8 +219,10 @@ void LLHintPopup::draw() S32 image_height = hint_image.isNull() ? 0 : hint_image->getHeight(); S32 image_width = hint_image.isNull() ? 0 : hint_image->getWidth(); - S32 delta_height = image_height - hint_icon.getRect().getHeight(); - hint_icon.getParent()->reshape(image_width, image_height); + S32 delta_height = image_height - hint_icon.getParent()->getParent()->getRect().getHeight(); + hint_icon.getParent()->reshape(image_width, hint_icon.getParent()->getRect().getHeight()); + hint_icon.getParent()->getParent()->reshape(hint_icon.getParent()->getParent()->getRect().getWidth(), image_height); + hint_icon.getParent()->getParent()->translate(0, -delta_height); LLRect hint_rect = getLocalRect(); reshape(hint_rect.getWidth(), hint_rect.getHeight() + delta_height); -- cgit v1.2.3 From 453b0c700a8712f7ff79434772296a487d38184a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 1 Apr 2011 16:42:30 -0700 Subject: SOCIAL-822 FIX UI and Sizing issues with hints in Basic and Advanced modes fixed crash for advanced mode --- indra/newview/llhints.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 722d67caf9..b5e676e626 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -213,19 +213,22 @@ void LLHintPopup::draw() alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f); } - LLIconCtrl& hint_icon = getChildRef("hint_image"); + LLIconCtrl* hint_icon = findChild("hint_image"); - LLUIImagePtr hint_image = hint_icon.getImage(); - S32 image_height = hint_image.isNull() ? 0 : hint_image->getHeight(); - S32 image_width = hint_image.isNull() ? 0 : hint_image->getWidth(); + if (hint_icon) + { + LLUIImagePtr hint_image = hint_icon.getImage(); + S32 image_height = hint_image.isNull() ? 0 : hint_image->getHeight(); + S32 image_width = hint_image.isNull() ? 0 : hint_image->getWidth(); - S32 delta_height = image_height - hint_icon.getParent()->getParent()->getRect().getHeight(); - hint_icon.getParent()->reshape(image_width, hint_icon.getParent()->getRect().getHeight()); - hint_icon.getParent()->getParent()->reshape(hint_icon.getParent()->getParent()->getRect().getWidth(), image_height); - hint_icon.getParent()->getParent()->translate(0, -delta_height); + S32 delta_height = image_height - hint_icon.getParent()->getParent()->getRect().getHeight(); + hint_icon.getParent()->reshape(image_width, hint_icon.getParent()->getRect().getHeight()); + hint_icon.getParent()->getParent()->reshape(hint_icon.getParent()->getParent()->getRect().getWidth(), image_height); + hint_icon.getParent()->getParent()->translate(0, -delta_height); - LLRect hint_rect = getLocalRect(); - reshape(hint_rect.getWidth(), hint_rect.getHeight() + delta_height); + LLRect hint_rect = getLocalRect(); + reshape(hint_rect.getWidth(), hint_rect.getHeight() + delta_height); + } { LLViewDrawContext context(alpha); -- cgit v1.2.3 From 81ae3c5fc984a5175f1bd0fc277f8493dc895d94 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 1 Apr 2011 18:15:07 -0700 Subject: SOCIAL-822 FIX UI and Sizing issues with hints in Basic and Advanced modes fixed crash for advanced mode --- indra/newview/llhints.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index b5e676e626..e15862e2a4 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -217,14 +217,15 @@ void LLHintPopup::draw() if (hint_icon) { - LLUIImagePtr hint_image = hint_icon.getImage(); + LLUIImagePtr hint_image = hint_icon->getImage(); S32 image_height = hint_image.isNull() ? 0 : hint_image->getHeight(); S32 image_width = hint_image.isNull() ? 0 : hint_image->getWidth(); - S32 delta_height = image_height - hint_icon.getParent()->getParent()->getRect().getHeight(); - hint_icon.getParent()->reshape(image_width, hint_icon.getParent()->getRect().getHeight()); - hint_icon.getParent()->getParent()->reshape(hint_icon.getParent()->getParent()->getRect().getWidth(), image_height); - hint_icon.getParent()->getParent()->translate(0, -delta_height); + LLView* layout_stack = hint_icon->getParent()->getParent(); + S32 delta_height = image_height - layout_stack->getRect().getHeight(); + hint_icon->getParent()->reshape(image_width, hint_icon->getParent()->getRect().getHeight()); + layout_stack->reshape(layout_stack->getRect().getWidth(), image_height); + layout_stack->translate(0, -delta_height); LLRect hint_rect = getLocalRect(); reshape(hint_rect.getWidth(), hint_rect.getHeight() + delta_height); -- cgit v1.2.3