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