From e16c1f6fdd300f284f0b39b76b4e82f7366b5cdb Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Thu, 12 Aug 2010 10:08:39 -0700 Subject: forgot some files --- indra/newview/llhints.cpp | 250 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 indra/newview/llhints.cpp (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp new file mode 100644 index 0000000000..a8c3183301 --- /dev/null +++ b/indra/newview/llhints.cpp @@ -0,0 +1,250 @@ +/** + * @file llhints.cpp + * @brief Hint popups for displaying context sensitive help in a UI overlay + * + * $LicenseInfo:firstyear=2000&license=viewergpl$ + * + * Copyright (c) 2000-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + + +#include "llviewerprecompiledheaders.h" // must be first include + +#include "llhints.h" + +#include "llbutton.h" +#include "lltextbox.h" +#include "llviewerwindow.h" +#include "llsdparam.h" + +class LLHintPopup : public LLPanel +{ +public: + + typedef enum e_popup_direction + { + LEFT, + TOP, + RIGHT, + BOTTOM + } EPopupDirection; + + struct PopupDirections : public LLInitParam::TypeValuesHelper + { + static void declareValues() + { + declare("left", LLHintPopup::LEFT); + declare("right", LLHintPopup::RIGHT); + declare("top", LLHintPopup::TOP); + declare("bottom", LLHintPopup::BOTTOM); + } + }; + + struct Params : public LLInitParam::Block + { + Mandatory notification; + Optional target; + Optional direction; + Optional distance; + Optional left_arrow, + up_arrow, + right_arrow, + down_arrow; + + Params() + : direction("direction", TOP), + distance("distance", 24), + target("target"), + left_arrow("left_arrow", LLUI::getUIImage("hint_arrow_left")), + up_arrow("up_arrow", LLUI::getUIImage("hint_arrow_up")), + right_arrow("right_arrow", LLUI::getUIImage("hint_arrow_right")), + down_arrow("down_arrow", LLUI::getUIImage("hint_arrow_down")) + {} + }; + + LLHintPopup(const Params&); + + void setHintTarget(LLHandle target) { mTarget = target; } + /*virtual*/ BOOL postBuild(); + + void onClickClose() { hide(); } + void draw(); + void hide() { die(); } + +private: + LLNotificationPtr mNotification; + LLHandle mTarget; + EPopupDirection mDirection; + S32 mDistance; + LLUIImagePtr mArrowLeft, + mArrowUp, + mArrowRight, + mArrowDown; +}; + + + + +LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) +: mNotification(p.notification), + mDirection(p.direction), + mDistance(p.distance), + mTarget(LLHints::getHintTarget(p.target)), + mArrowLeft(p.left_arrow), + mArrowUp(p.up_arrow), + mArrowRight(p.right_arrow), + mArrowDown(p.down_arrow), + LLPanel(p) +{ + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hint.xml"); +} + +BOOL LLHintPopup::postBuild() +{ + LLTextBox& hint_text = getChildRef("hint_text"); + hint_text.setText(mNotification->getMessage()); + + getChild("close")->setClickedCallback(boost::bind(&LLHintPopup::onClickClose, this)); + getChild("hint_title")->setText(mNotification->getLabel()); + + LLRect text_bounds = hint_text.getTextBoundingRect(); + S32 delta_height = text_bounds.getHeight() - hint_text.getRect().getHeight(); + reshape(getRect().getWidth(), getRect().getHeight() + delta_height); + return TRUE; +} + +void LLHintPopup::draw() +{ + LLView* targetp = mTarget.get(); + if (!targetp || !targetp->isInVisibleChain()) + { + hide(); + } + else + { + LLRect target_rect; + targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent()); + + LLRect my_local_rect = getLocalRect(); + LLRect my_rect = getRect(); + LLRect arrow_rect; + LLUIImagePtr arrow_imagep; + + const S32 OVERLAP = 5; + + switch(mDirection) + { + case LEFT: + my_rect.setCenterAndSize( target_rect.mLeft - (my_rect.getWidth() / 2 + mDistance), + target_rect.getCenterY(), + my_rect.getWidth(), + my_rect.getHeight()); + arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 - OVERLAP, + my_local_rect.getCenterY(), + mArrowRight->getWidth(), + mArrowRight->getHeight()); + arrow_imagep = mArrowRight; + break; + case TOP: + my_rect.setCenterAndSize( target_rect.getCenterX(), + target_rect.mTop + (my_rect.getHeight() / 2 + mDistance), + my_rect.getWidth(), + my_rect.getHeight()); + arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), + my_local_rect.mBottom - mArrowDown->getHeight() / 2 + OVERLAP, + mArrowDown->getWidth(), + mArrowDown->getHeight()); + arrow_imagep = mArrowDown; + break; + case RIGHT: + my_rect.setCenterAndSize( target_rect.getCenterX(), + target_rect.mTop - (my_rect.getHeight() / 2 + mDistance), + my_rect.getWidth(), + my_rect.getHeight()); + arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + OVERLAP, + my_local_rect.getCenterY(), + mArrowLeft->getWidth(), + mArrowLeft->getHeight()); + arrow_imagep = mArrowLeft; + break; + case BOTTOM: + my_rect.setCenterAndSize( target_rect.mLeft + (my_rect.getWidth() / 2 + mDistance), + target_rect.getCenterY(), + my_rect.getWidth(), + my_rect.getHeight()); + arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), + my_local_rect.mTop + mArrowUp->getHeight() / 2 - OVERLAP, + mArrowUp->getWidth(), + mArrowUp->getHeight()); + arrow_imagep = mArrowUp; + break; + } + setShape(my_rect); + LLPanel::draw(); + + arrow_imagep->draw(arrow_rect); + } +} + + +LLRegistry > LLHints::sTargetRegistry; + +//static +void LLHints::show(LLNotificationPtr hint) +{ + LLHintPopup::Params p; + LLParamSDParser::instance().readSD(hint->getPayload(), p); + + p.notification = hint; + + LLHintPopup* popup = new LLHintPopup(p); + LLView* hint_holder = gViewerWindow->getHintHolder(); + if (hint_holder) + { + hint_holder->addChild(popup); + popup->centerWithin(hint_holder->getLocalRect()); + } +} + +//static +void LLHints::registerHintTarget(const std::string& name, LLHandle target) +{ + sTargetRegistry.defaultRegistrar().add(name, target); +} + +//static +LLHandle LLHints::getHintTarget(const std::string& name) +{ + LLHandle* handlep = sTargetRegistry.getValue(name); + if (handlep) + { + return *handlep; + } + else + { + return LLHandle(); + } +} -- cgit v1.2.3 From bd897431e14aff091d5f45425816ddec4b2538c7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 12 Aug 2010 12:20:38 -0700 Subject: remaining hints defined --- indra/newview/llhints.cpp | 40 +++++++++++++++++++++++++++------------- 1 file changed, 27 insertions(+), 13 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index a8c3183301..2f3504efed 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -149,7 +149,7 @@ void LLHintPopup::draw() targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent()); LLRect my_local_rect = getLocalRect(); - LLRect my_rect = getRect(); + LLRect my_rect; LLRect arrow_rect; LLUIImagePtr arrow_imagep; @@ -158,10 +158,10 @@ void LLHintPopup::draw() switch(mDirection) { case LEFT: - my_rect.setCenterAndSize( target_rect.mLeft - (my_rect.getWidth() / 2 + mDistance), + my_rect.setCenterAndSize( target_rect.mLeft - (my_local_rect.getWidth() / 2 + mDistance), target_rect.getCenterY(), - my_rect.getWidth(), - my_rect.getHeight()); + my_local_rect.getWidth(), + my_local_rect.getHeight()); arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 - OVERLAP, my_local_rect.getCenterY(), mArrowRight->getWidth(), @@ -170,9 +170,9 @@ void LLHintPopup::draw() break; case TOP: my_rect.setCenterAndSize( target_rect.getCenterX(), - target_rect.mTop + (my_rect.getHeight() / 2 + mDistance), - my_rect.getWidth(), - my_rect.getHeight()); + target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance), + my_local_rect.getWidth(), + my_local_rect.getHeight()); arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), my_local_rect.mBottom - mArrowDown->getHeight() / 2 + OVERLAP, mArrowDown->getWidth(), @@ -181,9 +181,9 @@ void LLHintPopup::draw() break; case RIGHT: my_rect.setCenterAndSize( target_rect.getCenterX(), - target_rect.mTop - (my_rect.getHeight() / 2 + mDistance), - my_rect.getWidth(), - my_rect.getHeight()); + target_rect.mTop - (my_local_rect.getHeight() / 2 + mDistance), + my_local_rect.getWidth(), + my_local_rect.getHeight()); arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + OVERLAP, my_local_rect.getCenterY(), mArrowLeft->getWidth(), @@ -191,10 +191,10 @@ void LLHintPopup::draw() arrow_imagep = mArrowLeft; break; case BOTTOM: - my_rect.setCenterAndSize( target_rect.mLeft + (my_rect.getWidth() / 2 + mDistance), + my_rect.setCenterAndSize( target_rect.mLeft + (my_local_rect.getWidth() / 2 + mDistance), target_rect.getCenterY(), - my_rect.getWidth(), - my_rect.getHeight()); + my_local_rect.getWidth(), + my_local_rect.getHeight()); arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), my_local_rect.mTop + mArrowUp->getHeight() / 2 - OVERLAP, mArrowUp->getWidth(), @@ -211,6 +211,7 @@ void LLHintPopup::draw() LLRegistry > LLHints::sTargetRegistry; +std::map LLHints::sHints; //static void LLHints::show(LLNotificationPtr hint) @@ -221,6 +222,9 @@ void LLHints::show(LLNotificationPtr hint) p.notification = hint; LLHintPopup* popup = new LLHintPopup(p); + + sHints[hint] = popup; + LLView* hint_holder = gViewerWindow->getHintHolder(); if (hint_holder) { @@ -229,6 +233,16 @@ void LLHints::show(LLNotificationPtr hint) } } +void LLHints::hide(LLNotificationPtr hint) +{ + hint_map_t::iterator found_it = sHints.find(hint); + if (found_it != sHints.end()) + { + found_it->second->hide(); + sHints.erase(found_it); + } +} + //static void LLHints::registerHintTarget(const std::string& name, LLHandle target) { -- cgit v1.2.3 From 2c999688c4c792630865bd97c2b45ff886d9a26c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 12 Aug 2010 15:18:25 -0700 Subject: added remaining hints and fade in/fade out behavior --- indra/newview/llhints.cpp | 62 +++++++++++++++++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 13 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 2f3504efed..66799535c1 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -72,7 +72,13 @@ public: Optional left_arrow, up_arrow, right_arrow, - down_arrow; + down_arrow; + Optional left_arrow_offset, + up_arrow_offset, + right_arrow_offset, + down_arrow_offset; + Optional fade_in_time, + fade_out_time; Params() : direction("direction", TOP), @@ -81,7 +87,13 @@ public: left_arrow("left_arrow", LLUI::getUIImage("hint_arrow_left")), up_arrow("up_arrow", LLUI::getUIImage("hint_arrow_up")), right_arrow("right_arrow", LLUI::getUIImage("hint_arrow_right")), - down_arrow("down_arrow", LLUI::getUIImage("hint_arrow_down")) + down_arrow("down_arrow", LLUI::getUIImage("hint_arrow_down")), + left_arrow_offset("left_arrow_offset", 3), + up_arrow_offset("up_arrow_offset", -2), + right_arrow_offset("right_arrow_offset", -3), + down_arrow_offset("down_arrow_offset", 5), + fade_in_time("fade_in_time", 0.2f), + fade_out_time("fade_out_time", 0.5f) {} }; @@ -92,7 +104,7 @@ public: void onClickClose() { hide(); } void draw(); - void hide() { die(); } + void hide() { mHidden = true; mFadeTimer.reset(); } private: LLNotificationPtr mNotification; @@ -103,6 +115,14 @@ private: mArrowUp, mArrowRight, mArrowDown; + S32 mArrowLeftOffset, + mArrowUpOffset, + mArrowRightOffset, + mArrowDownOffset; + LLFrameTimer mFadeTimer; + F32 mFadeInTime, + mFadeOutTime; + bool mHidden; }; @@ -117,6 +137,13 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) mArrowUp(p.up_arrow), mArrowRight(p.right_arrow), mArrowDown(p.down_arrow), + mArrowLeftOffset(p.left_arrow_offset), + mArrowUpOffset(p.up_arrow_offset), + mArrowRightOffset(p.right_arrow_offset), + mArrowDownOffset(p.down_arrow_offset), + mHidden(false), + mFadeInTime(p.fade_in_time), + mFadeOutTime(p.fade_out_time), LLPanel(p) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hint.xml"); @@ -138,6 +165,17 @@ BOOL LLHintPopup::postBuild() void LLHintPopup::draw() { + F32 alpha = 1.f; + if (mHidden) + { + alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeOutTime, 1.f, 0.f); + } + else + { + alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f); + } + LLViewDrawContext context(alpha); + LLView* targetp = mTarget.get(); if (!targetp || !targetp->isInVisibleChain()) { @@ -153,8 +191,6 @@ void LLHintPopup::draw() LLRect arrow_rect; LLUIImagePtr arrow_imagep; - const S32 OVERLAP = 5; - switch(mDirection) { case LEFT: @@ -162,7 +198,7 @@ void LLHintPopup::draw() target_rect.getCenterY(), my_local_rect.getWidth(), my_local_rect.getHeight()); - arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 - OVERLAP, + arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 + mArrowRightOffset, my_local_rect.getCenterY(), mArrowRight->getWidth(), mArrowRight->getHeight()); @@ -174,7 +210,7 @@ void LLHintPopup::draw() my_local_rect.getWidth(), my_local_rect.getHeight()); arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), - my_local_rect.mBottom - mArrowDown->getHeight() / 2 + OVERLAP, + my_local_rect.mBottom - mArrowDown->getHeight() / 2 + mArrowDownOffset, mArrowDown->getWidth(), mArrowDown->getHeight()); arrow_imagep = mArrowDown; @@ -184,19 +220,19 @@ void LLHintPopup::draw() target_rect.mTop - (my_local_rect.getHeight() / 2 + mDistance), my_local_rect.getWidth(), my_local_rect.getHeight()); - arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + OVERLAP, + arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + mArrowLeftOffset, my_local_rect.getCenterY(), mArrowLeft->getWidth(), mArrowLeft->getHeight()); arrow_imagep = mArrowLeft; break; case BOTTOM: - my_rect.setCenterAndSize( target_rect.mLeft + (my_local_rect.getWidth() / 2 + mDistance), - target_rect.getCenterY(), + my_rect.setCenterAndSize( target_rect.getCenterX(), + target_rect.mBottom - (my_local_rect.getHeight() / 2 + mDistance), my_local_rect.getWidth(), my_local_rect.getHeight()); arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), - my_local_rect.mTop + mArrowUp->getHeight() / 2 - OVERLAP, + my_local_rect.mTop + mArrowUp->getHeight() / 2 + mArrowUpOffset, mArrowUp->getWidth(), mArrowUp->getHeight()); arrow_imagep = mArrowUp; @@ -205,7 +241,7 @@ void LLHintPopup::draw() setShape(my_rect); LLPanel::draw(); - arrow_imagep->draw(arrow_rect); + arrow_imagep->draw(arrow_rect, LLColor4(1.f, 1.f, 1.f, alpha)); } } @@ -217,7 +253,7 @@ std::map LLHints::sHints; void LLHints::show(LLNotificationPtr hint) { LLHintPopup::Params p; - LLParamSDParser::instance().readSD(hint->getPayload(), p); + LLParamSDParser::instance().readSD(hint->getPayload(), p); p.notification = hint; -- cgit v1.2.3 From 4ef75f35c195a4e2657a0e01d6b92cd40e6779f5 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 13 Aug 2010 12:56:28 -0700 Subject: stopped hints from appearing temporarily when retriggered --- indra/newview/llhints.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 66799535c1..14a9871a7d 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -104,7 +104,7 @@ public: void onClickClose() { hide(); } void draw(); - void hide() { mHidden = true; mFadeTimer.reset(); } + void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} } private: LLNotificationPtr mNotification; @@ -169,6 +169,10 @@ void LLHintPopup::draw() if (mHidden) { alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeOutTime, 1.f, 0.f); + if (alpha == 0.f) + { + die(); + } } else { -- cgit v1.2.3 From 32e4cda7dc730d505190db3d6658d6dd94bfc28f Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 16 Aug 2010 15:01:39 -0700 Subject: made hints only expire when explicitly responded to, not implicitly after first seeing them added hint_popup.xml for hint styling --- indra/newview/llhints.cpp | 234 +++++++++++++++++++++++++++------------------- 1 file changed, 136 insertions(+), 98 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 14a9871a7d..c4cea86a31 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -63,11 +63,21 @@ public: } }; + struct TargetParams : public LLInitParam::Block + { + Mandatory target; + Mandatory direction; + + TargetParams() + : target("target"), + direction("direction") + {} + }; + struct Params : public LLInitParam::Block { Mandatory notification; - Optional target; - Optional direction; + Optional target_params; Optional distance; Optional left_arrow, up_arrow, @@ -81,34 +91,31 @@ public: fade_out_time; Params() - : direction("direction", TOP), - distance("distance", 24), - target("target"), - left_arrow("left_arrow", LLUI::getUIImage("hint_arrow_left")), - up_arrow("up_arrow", LLUI::getUIImage("hint_arrow_up")), - right_arrow("right_arrow", LLUI::getUIImage("hint_arrow_right")), - down_arrow("down_arrow", LLUI::getUIImage("hint_arrow_down")), - left_arrow_offset("left_arrow_offset", 3), - up_arrow_offset("up_arrow_offset", -2), - right_arrow_offset("right_arrow_offset", -3), - down_arrow_offset("down_arrow_offset", 5), - fade_in_time("fade_in_time", 0.2f), - fade_out_time("fade_out_time", 0.5f) + : distance("distance"), + left_arrow("left_arrow"), + up_arrow("up_arrow"), + right_arrow("right_arrow"), + down_arrow("down_arrow"), + left_arrow_offset("left_arrow_offset"), + up_arrow_offset("up_arrow_offset"), + right_arrow_offset("right_arrow_offset"), + down_arrow_offset("down_arrow_offset"), + fade_in_time("fade_in_time"), + fade_out_time("fade_out_time") {} }; LLHintPopup(const Params&); - void setHintTarget(LLHandle target) { mTarget = target; } /*virtual*/ BOOL postBuild(); - void onClickClose() { hide(); } + void onClickClose() { hide(); LLNotifications::instance().cancel(mNotification); } void draw(); void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} } private: LLNotificationPtr mNotification; - LLHandle mTarget; + std::string mTarget; EPopupDirection mDirection; S32 mDistance; LLUIImagePtr mArrowLeft, @@ -125,14 +132,14 @@ private: bool mHidden; }; - +static LLDefaultChildRegistry::Register r("hint_popup"); LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) : mNotification(p.notification), - mDirection(p.direction), + mDirection(p.target_params.direction), mDistance(p.distance), - mTarget(LLHints::getHintTarget(p.target)), + mTarget(p.target_params.target), mArrowLeft(p.left_arrow), mArrowUp(p.up_arrow), mArrowRight(p.right_arrow), @@ -146,7 +153,7 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) mFadeOutTime(p.fade_out_time), LLPanel(p) { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hint.xml"); + buildPanel(this, "panel_hint.xml", NULL, p); } BOOL LLHintPopup::postBuild() @@ -172,80 +179,108 @@ void LLHintPopup::draw() if (alpha == 0.f) { die(); + return; } } else { alpha = clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, mFadeInTime, 0.f, 1.f); } - LLViewDrawContext context(alpha); - - LLView* targetp = mTarget.get(); - if (!targetp || !targetp->isInVisibleChain()) - { - hide(); - } - else - { - LLRect target_rect; - targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent()); - - LLRect my_local_rect = getLocalRect(); - LLRect my_rect; - LLRect arrow_rect; - LLUIImagePtr arrow_imagep; + + { LLViewDrawContext context(alpha); - switch(mDirection) + if (mTarget.empty()) { - case LEFT: - my_rect.setCenterAndSize( target_rect.mLeft - (my_local_rect.getWidth() / 2 + mDistance), - target_rect.getCenterY(), - my_local_rect.getWidth(), - my_local_rect.getHeight()); - arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 + mArrowRightOffset, - my_local_rect.getCenterY(), - mArrowRight->getWidth(), - mArrowRight->getHeight()); - arrow_imagep = mArrowRight; - break; - case TOP: - my_rect.setCenterAndSize( target_rect.getCenterX(), - target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance), - my_local_rect.getWidth(), - my_local_rect.getHeight()); - arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), - my_local_rect.mBottom - mArrowDown->getHeight() / 2 + mArrowDownOffset, - mArrowDown->getWidth(), - mArrowDown->getHeight()); - arrow_imagep = mArrowDown; - break; - case RIGHT: - my_rect.setCenterAndSize( target_rect.getCenterX(), - target_rect.mTop - (my_local_rect.getHeight() / 2 + mDistance), - my_local_rect.getWidth(), - my_local_rect.getHeight()); - arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + mArrowLeftOffset, - my_local_rect.getCenterY(), - mArrowLeft->getWidth(), - mArrowLeft->getHeight()); - arrow_imagep = mArrowLeft; - break; - case BOTTOM: - my_rect.setCenterAndSize( target_rect.getCenterX(), - target_rect.mBottom - (my_local_rect.getHeight() / 2 + mDistance), - my_local_rect.getWidth(), - my_local_rect.getHeight()); - arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), - my_local_rect.mTop + mArrowUp->getHeight() / 2 + mArrowUpOffset, - mArrowUp->getWidth(), - mArrowUp->getHeight()); - arrow_imagep = mArrowUp; - break; + // just draw contents, no arrow, in default position + LLPanel::draw(); + } + else + { + LLView* targetp = LLHints::getHintTarget(mTarget).get(); + if (!targetp) + { + // target widget is no longer valid, go away + die(); + } + else if (!targetp->isInVisibleChain()) + { + // if target is invisible, don't draw, but keep alive in case widget comes back + } + else + { + LLRect target_rect; + targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent()); + + LLRect my_local_rect = getLocalRect(); + LLRect my_rect; + LLRect arrow_rect; + LLUIImagePtr arrow_imagep; + + switch(mDirection) + { + case LEFT: + my_rect.setCenterAndSize( target_rect.mLeft - (my_local_rect.getWidth() / 2 + mDistance), + target_rect.getCenterY(), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + if (mArrowRight) + { + arrow_rect.setCenterAndSize(my_local_rect.mRight + mArrowRight->getWidth() / 2 + mArrowRightOffset, + my_local_rect.getCenterY(), + mArrowRight->getWidth(), + mArrowRight->getHeight()); + arrow_imagep = mArrowRight; + } + break; + case TOP: + my_rect.setCenterAndSize( target_rect.getCenterX(), + target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + if (mArrowDown) + { + arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), + my_local_rect.mBottom - mArrowDown->getHeight() / 2 + mArrowDownOffset, + mArrowDown->getWidth(), + mArrowDown->getHeight()); + arrow_imagep = mArrowDown; + } + break; + case RIGHT: + my_rect.setCenterAndSize( target_rect.mRight + (my_local_rect.getWidth() / 2 + mDistance), + target_rect.getCenterY(), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + if (mArrowLeft) + { + arrow_rect.setCenterAndSize(my_local_rect.mLeft - mArrowLeft->getWidth() / 2 + mArrowLeftOffset, + my_local_rect.getCenterY(), + mArrowLeft->getWidth(), + mArrowLeft->getHeight()); + arrow_imagep = mArrowLeft; + } + break; + case BOTTOM: + my_rect.setCenterAndSize( target_rect.getCenterX(), + target_rect.mBottom - (my_local_rect.getHeight() / 2 + mDistance), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + if (mArrowUp) + { + arrow_rect.setCenterAndSize(my_local_rect.getCenterX(), + my_local_rect.mTop + mArrowUp->getHeight() / 2 + mArrowUpOffset, + mArrowUp->getWidth(), + mArrowUp->getHeight()); + arrow_imagep = mArrowUp; + } + break; + } + setShape(my_rect); + LLPanel::draw(); + + if (arrow_imagep) arrow_imagep->draw(arrow_rect, LLColor4(1.f, 1.f, 1.f, alpha)); + } } - setShape(my_rect); - LLPanel::draw(); - - arrow_imagep->draw(arrow_rect, LLColor4(1.f, 1.f, 1.f, alpha)); } } @@ -256,20 +291,23 @@ std::map LLHints::sHints; //static void LLHints::show(LLNotificationPtr hint) { - LLHintPopup::Params p; - LLParamSDParser::instance().readSD(hint->getPayload(), p); + LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams()); + LLParamSDParser::instance().readSD(hint->getPayload(), p); p.notification = hint; - LLHintPopup* popup = new LLHintPopup(p); - - sHints[hint] = popup; - - LLView* hint_holder = gViewerWindow->getHintHolder(); - if (hint_holder) + if (p.validateBlock()) { - hint_holder->addChild(popup); - popup->centerWithin(hint_holder->getLocalRect()); + LLHintPopup* popup = new LLHintPopup(p); + + sHints[hint] = popup; + + LLView* hint_holder = gViewerWindow->getHintHolder(); + if (hint_holder) + { + hint_holder->addChild(popup); + popup->centerWithin(hint_holder->getLocalRect()); + } } } @@ -286,7 +324,7 @@ void LLHints::hide(LLNotificationPtr hint) //static void LLHints::registerHintTarget(const std::string& name, LLHandle target) { - sTargetRegistry.defaultRegistrar().add(name, target); + sTargetRegistry.defaultRegistrar().replace(name, target); } //static -- cgit v1.2.3 From b7266b13c96e76a64e7220baa1d4cd3cb0f9bb29 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 19 Aug 2010 17:35:49 -0700 Subject: eliminated spam when parsing hints llsd --- indra/newview/llhints.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index c4cea86a31..f758df2ef8 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -293,7 +293,7 @@ void LLHints::show(LLNotificationPtr hint) { LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams()); - LLParamSDParser::instance().readSD(hint->getPayload(), p); + LLParamSDParser::instance().readSD(hint->getPayload(), p, true); p.notification = hint; if (p.validateBlock()) -- cgit v1.2.3 From 02d8197019dcecec7aee80a104c4644ddb4807ca Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 20 Aug 2010 10:14:28 -0700 Subject: changed buildPanel/buildFloater to member functions buildFromFile streamlined LLUICtrlFactory's interface --- indra/newview/llhints.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index c4cea86a31..e0ced5caeb 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -137,9 +137,8 @@ static LLDefaultChildRegistry::Register r("hint_popup"); LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) : mNotification(p.notification), - mDirection(p.target_params.direction), + mDirection(TOP), mDistance(p.distance), - mTarget(p.target_params.target), mArrowLeft(p.left_arrow), mArrowUp(p.up_arrow), mArrowRight(p.right_arrow), @@ -153,7 +152,12 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) mFadeOutTime(p.fade_out_time), LLPanel(p) { - buildPanel(this, "panel_hint.xml", NULL, p); + if (p.target_params.isProvided()) + { + mDirection = p.target_params.direction; + mTarget = p.target_params.target; + } + buildFromFile( "panel_hint.xml", NULL, p); } BOOL LLHintPopup::postBuild() -- cgit v1.2.3 From 65c9914d23022df6a39db50ce295750f08695893 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 23 Aug 2010 11:03:19 -0700 Subject: made Params parsers not act as singletons --- indra/newview/llhints.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index e0ced5caeb..4d7cdc01e5 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -297,7 +297,8 @@ void LLHints::show(LLNotificationPtr hint) { LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams()); - LLParamSDParser::instance().readSD(hint->getPayload(), p); + LLParamSDParser parser; + parser.readSD(hint->getPayload(), p); p.notification = hint; if (p.validateBlock()) -- cgit v1.2.3 From e3856e1894d4d19e8673f1d638fa2cacf96a42a4 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 27 Aug 2010 17:45:02 -0700 Subject: Update license block for new files. --- indra/newview/llhints.cpp | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index a90131499d..0c91dd473d 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -2,31 +2,25 @@ * @file llhints.cpp * @brief Hint popups for displaying context sensitive help in a UI overlay * - * $LicenseInfo:firstyear=2000&license=viewergpl$ - * - * Copyright (c) 2000-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2000&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 - * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception - * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. - * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From fbcde287363f38a4f73a14bbf3501e34b9698c68 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 10 Sep 2010 18:06:42 -0700 Subject: EXP-23 FIX Tail for chat box hint should be slantways instead of horizontal --- indra/newview/llhints.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 0c91dd473d..21383109dc 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -43,7 +43,8 @@ public: LEFT, TOP, RIGHT, - BOTTOM + BOTTOM, + TOP_RIGHT } EPopupDirection; struct PopupDirections : public LLInitParam::TypeValuesHelper @@ -54,6 +55,7 @@ public: declare("right", LLHintPopup::RIGHT); declare("top", LLHintPopup::TOP); declare("bottom", LLHintPopup::BOTTOM); + declare("top_right", LLHintPopup::TOP_RIGHT); } }; @@ -76,7 +78,9 @@ public: Optional left_arrow, up_arrow, right_arrow, - down_arrow; + down_arrow, + lower_left_arrow; + Optional left_arrow_offset, up_arrow_offset, right_arrow_offset, @@ -90,6 +94,7 @@ public: up_arrow("up_arrow"), right_arrow("right_arrow"), down_arrow("down_arrow"), + lower_left_arrow("lower_left_arrow"), left_arrow_offset("left_arrow_offset"), up_arrow_offset("up_arrow_offset"), right_arrow_offset("right_arrow_offset"), @@ -115,7 +120,8 @@ private: LLUIImagePtr mArrowLeft, mArrowUp, mArrowRight, - mArrowDown; + mArrowDown, + mArrowDownAndLeft; S32 mArrowLeftOffset, mArrowUpOffset, mArrowRightOffset, @@ -137,6 +143,7 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) mArrowUp(p.up_arrow), mArrowRight(p.right_arrow), mArrowDown(p.down_arrow), + mArrowDownAndLeft(p.lower_left_arrow), mArrowLeftOffset(p.left_arrow_offset), mArrowUpOffset(p.up_arrow_offset), mArrowRightOffset(p.right_arrow_offset), @@ -272,6 +279,19 @@ void LLHintPopup::draw() arrow_imagep = mArrowUp; } break; + case TOP_RIGHT: + my_rect.setCenterAndSize( target_rect.mRight + (my_local_rect.getWidth() / 2), + target_rect.mTop + (my_local_rect.getHeight() / 2 + mDistance), + my_local_rect.getWidth(), + my_local_rect.getHeight()); + if (mArrowDownAndLeft) + { + arrow_rect.setCenterAndSize(my_local_rect.mLeft + mArrowDownAndLeft->getWidth() / 2 + mArrowLeftOffset, + my_local_rect.mBottom - mArrowDownAndLeft->getHeight() / 2 + mArrowDownOffset, + mArrowDownAndLeft->getWidth(), + mArrowDownAndLeft->getHeight()); + arrow_imagep = mArrowDownAndLeft; + } } setShape(my_rect); LLPanel::draw(); -- cgit v1.2.3 From e2257bc78e53162127c49adad3f9dc406ecc270e Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 10 Sep 2010 18:54:30 -0700 Subject: EXP-24 FIX Menu disable all viewer hints --- indra/newview/llhints.cpp | 51 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 38 insertions(+), 13 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 21383109dc..bd7fec63e8 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -32,6 +32,7 @@ #include "llbutton.h" #include "lltextbox.h" #include "llviewerwindow.h" +#include "llviewercontrol.h" #include "llsdparam.h" class LLHintPopup : public LLPanel @@ -309,27 +310,31 @@ std::map LLHints::sHints; //static void LLHints::show(LLNotificationPtr hint) { - LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams()); - - LLParamSDParser parser; - parser.readSD(hint->getPayload(), p, true); - p.notification = hint; - - if (p.validateBlock()) + if (gSavedSettings.getBOOL("EnableUIHints")) { - LLHintPopup* popup = new LLHintPopup(p); + LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams()); - sHints[hint] = popup; + LLParamSDParser parser; + parser.readSD(hint->getPayload(), p, true); + p.notification = hint; - LLView* hint_holder = gViewerWindow->getHintHolder(); - if (hint_holder) + if (p.validateBlock()) { - hint_holder->addChild(popup); - popup->centerWithin(hint_holder->getLocalRect()); + LLHintPopup* popup = new LLHintPopup(p); + + sHints[hint] = popup; + + LLView* hint_holder = gViewerWindow->getHintHolder(); + if (hint_holder) + { + hint_holder->addChild(popup); + popup->centerWithin(hint_holder->getLocalRect()); + } } } } +//static void LLHints::hide(LLNotificationPtr hint) { hint_map_t::iterator found_it = sHints.find(hint); @@ -340,6 +345,26 @@ void LLHints::hide(LLNotificationPtr hint) } } +//static +void LLHints::hideAll() +{ + std::vector notifications; + for (hint_map_t::iterator it = sHints.begin(), end_it = sHints.end(); + it != end_it; + ++it) + { + notifications.push_back(it->first); + } + + for(std::vector::iterator it = notifications.begin(), end_it = notifications.end(); + it != end_it; + ++it) + { + LLNotifications::instance().cancel(*it); + } + +} + //static void LLHints::registerHintTarget(const std::string& name, LLHandle target) { -- cgit v1.2.3 From 7a3fc995c3af52004fb1efee8c2f1de55fffef04 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 16 Sep 2010 15:36:23 -0700 Subject: EXP-63 FIX Hint marked as acted upon if hints are disabled while specific UI hint is open --- indra/newview/llhints.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index bd7fec63e8..bb8f4a995b 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -360,7 +360,7 @@ void LLHints::hideAll() it != end_it; ++it) { - LLNotifications::instance().cancel(*it); + hide(*it); } } -- cgit v1.2.3 From 325991a002894011b1da8dd54b16b4cb15f77554 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Sep 2010 23:12:13 -0700 Subject: EXP-60 Hints not showing after Re-enabling Hints in same session --- indra/newview/llhints.cpp | 38 ++++++++++++++++++-------------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index bb8f4a995b..393aa188e1 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -345,26 +345,6 @@ void LLHints::hide(LLNotificationPtr hint) } } -//static -void LLHints::hideAll() -{ - std::vector notifications; - for (hint_map_t::iterator it = sHints.begin(), end_it = sHints.end(); - it != end_it; - ++it) - { - notifications.push_back(it->first); - } - - for(std::vector::iterator it = notifications.begin(), end_it = notifications.end(); - it != end_it; - ++it) - { - hide(*it); - } - -} - //static void LLHints::registerHintTarget(const std::string& name, LLHandle target) { @@ -384,3 +364,21 @@ LLHandle LLHints::getHintTarget(const std::string& name) return LLHandle(); } } + +//static +void LLHints::initClass() +{ + sRegister.reference(); + + LLControlVariablePtr control = gSavedSettings.getControl("EnableUIHints"); + control->getSignal()->connect(boost::bind(&showHints, _2)); + gViewerWindow->getHintHolder()->setVisible(control->getValue().asBoolean()); + +} + +//staic +void LLHints::showHints(const LLSD& show) +{ + bool visible = show.asBoolean(); + gViewerWindow->getHintHolder()->setVisible(visible); +} \ No newline at end of file -- cgit v1.2.3 From 7c0a6df30a1d78611782767763b7710702b96336 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 20 Sep 2010 16:21:00 -0700 Subject: EXP-60 FIX not showing after Re-enabling Hints in same session --- indra/newview/llhints.cpp | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 393aa188e1..a8274b3887 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -310,26 +310,23 @@ std::map LLHints::sHints; //static void LLHints::show(LLNotificationPtr hint) { - if (gSavedSettings.getBOOL("EnableUIHints")) - { - LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams()); + LLHintPopup::Params p(LLUICtrlFactory::getDefaultParams()); - LLParamSDParser parser; - parser.readSD(hint->getPayload(), p, true); - p.notification = hint; + LLParamSDParser parser; + parser.readSD(hint->getPayload(), p, true); + p.notification = hint; - if (p.validateBlock()) - { - LLHintPopup* popup = new LLHintPopup(p); + if (p.validateBlock()) + { + LLHintPopup* popup = new LLHintPopup(p); - sHints[hint] = popup; + sHints[hint] = popup; - LLView* hint_holder = gViewerWindow->getHintHolder(); - if (hint_holder) - { - hint_holder->addChild(popup); - popup->centerWithin(hint_holder->getLocalRect()); - } + LLView* hint_holder = gViewerWindow->getHintHolder(); + if (hint_holder) + { + hint_holder->addChild(popup); + popup->centerWithin(hint_holder->getLocalRect()); } } } -- cgit v1.2.3 From b124d45b4ef714acfe629af554768950dcdd5f2c Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 22 Sep 2010 17:14:41 -0700 Subject: Fix "no newline at end of file". --- indra/newview/llhints.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index a8274b3887..d837ed8205 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -378,4 +378,4 @@ void LLHints::showHints(const LLSD& show) { bool visible = show.asBoolean(); gViewerWindow->getHintHolder()->setVisible(visible); -} \ No newline at end of file +} -- cgit v1.2.3 From 7ffc9b06c820d70724af2aef361ff9964e584e73 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 8 Oct 2010 16:56:02 -0700 Subject: Created a floater for setting display name --- indra/newview/llhints.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index d837ed8205..b326fc26f2 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -210,10 +210,15 @@ void LLHintPopup::draw() } else if (!targetp->isInVisibleChain()) { + setEnabled(false); + setMouseOpaque(false); // if target is invisible, don't draw, but keep alive in case widget comes back } else { + setEnabled(true); + setMouseOpaque(true); + LLRect target_rect; targetp->localRectToOtherView(targetp->getLocalRect(), &target_rect, getParent()); -- cgit v1.2.3 From 3059e130984052091cadd92007413df3c8cea07d Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 8 Oct 2010 17:01:32 -0700 Subject: Fixed issue where non-visible hint wasn't allowing mouse events to pass through --- indra/newview/llhints.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index b326fc26f2..7f6df627e0 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -210,12 +210,14 @@ void LLHintPopup::draw() } else if (!targetp->isInVisibleChain()) { + // if target is invisible, don't draw, but keep alive in case widget comes back + // but do make it so that it allows mouse events to pass through setEnabled(false); setMouseOpaque(false); - // if target is invisible, don't draw, but keep alive in case widget comes back } else { + // revert back enabled and mouse opaque state in case we disabled it before setEnabled(true); setMouseOpaque(true); -- cgit v1.2.3 From 95c998918646777e0f12b6663c364a93d2c8df3c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 29 Oct 2010 14:58:35 -0700 Subject: VWR-23444 FIXED Double clicking x on UI hint crashes Skylight Viewer --- indra/newview/llhints.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview/llhints.cpp') diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index 7f6df627e0..3f0deb98cd 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -109,7 +109,14 @@ public: /*virtual*/ BOOL postBuild(); - void onClickClose() { hide(); LLNotifications::instance().cancel(mNotification); } + void onClickClose() + { + if (!mHidden) + { + hide(); + LLNotifications::instance().cancel(mNotification); + } + } void draw(); void hide() { if(!mHidden) {mHidden = true; mFadeTimer.reset();} } -- cgit v1.2.3