diff options
author | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-07-01 16:55:19 -0400 |
---|---|---|
committer | Brad Payne (Vir Linden) <vir@lindenlab.com> | 2010-07-01 16:55:19 -0400 |
commit | ddf87b874a0841a65ec95d2d8ed4764412cd394c (patch) | |
tree | 956fedc2cc55b74c3959b9f9c1a8de9c12206178 /indra/llui | |
parent | 5cda3ccad729f21dee0ea5517be4dcd8304943fe (diff) | |
parent | eed8e6adc93ed85ce9fe15f946fb4035672f6190 (diff) |
merge
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llaccordionctrltab.cpp | 29 | ||||
-rw-r--r-- | indra/llui/llaccordionctrltab.h | 3 | ||||
-rw-r--r-- | indra/llui/llnotifications.cpp | 32 | ||||
-rw-r--r-- | indra/llui/llnotifications.h | 2 |
4 files changed, 46 insertions, 20 deletions
diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 09cb15d7a8..37fc571bbd 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -78,6 +78,8 @@ public: void setTitleFontStyle(std::string style); + void setTitleColor(LLUIColor); + void setSelected(bool is_selected) { mIsSelected = is_selected; } virtual void onMouseEnter(S32 x, S32 y, MASK mask); @@ -192,6 +194,14 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitleFontStyle(std::string } } +void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::setTitleColor(LLUIColor color) +{ + if(mHeaderTextbox) + { + mHeaderTextbox->setColor(color); + } +} + void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::draw() { S32 width = getRect().getWidth(); @@ -249,6 +259,15 @@ void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::reshape(S32 width, S32 height LLRect textboxRect(HEADER_TEXT_LEFT_OFFSET,(height+header_height)/2 ,width,(height-header_height)/2); mHeaderTextbox->reshape(textboxRect.getWidth(), textboxRect.getHeight()); mHeaderTextbox->setRect(textboxRect); + + if (mHeaderTextbox->getTextPixelWidth() > mHeaderTextbox->getRect().getWidth()) + { + setToolTip(mHeaderTextbox->getText()); + } + else + { + setToolTip(LLStringUtil::null); + } } void LLAccordionCtrlTab::LLAccordionCtrlTabHeader::onMouseEnter(S32 x, S32 y, MASK mask) @@ -520,6 +539,15 @@ void LLAccordionCtrlTab::setTitleFontStyle(std::string style) } } +void LLAccordionCtrlTab::setTitleColor(LLUIColor color) +{ + LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); + if (header) + { + header->setTitleColor(color); + } +} + boost::signals2::connection LLAccordionCtrlTab::setFocusReceivedCallback(const focus_signal_t::slot_type& cb) { LLAccordionCtrlTabHeader* header = findChild<LLAccordionCtrlTabHeader>(DD_HEADER_NAME); @@ -989,6 +1017,7 @@ BOOL LLAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask) { //inside tab header //fix for EXT-6619 + mHeader->handleToolTip(x, y, mask); return TRUE; } return LLUICtrl::handleToolTip(x, y, mask); diff --git a/indra/llui/llaccordionctrltab.h b/indra/llui/llaccordionctrltab.h index e17ecc5319..5646a355d0 100644 --- a/indra/llui/llaccordionctrltab.h +++ b/indra/llui/llaccordionctrltab.h @@ -124,6 +124,9 @@ public: // Set text font style in LLAccordionCtrlTabHeader void setTitleFontStyle(std::string style); + // Set text color in LLAccordionCtrlTabHeader + void setTitleColor(LLUIColor color); + boost::signals2::connection setFocusReceivedCallback(const focus_signal_t::slot_type& cb); boost::signals2::connection setFocusLostCallback(const focus_signal_t::slot_type& cb); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 7b8f51ae3c..621e72ce38 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -560,21 +560,6 @@ void LLNotification::setResponseFunctor(const LLNotificationResponderPtr& respon mResponder = responder; } -bool LLNotification::payloadContainsAll(const std::vector<std::string>& required_fields) const -{ - for(std::vector<std::string>::const_iterator required_fields_it = required_fields.begin(); - required_fields_it != required_fields.end(); - required_fields_it++) - { - std::string required_field_name = *required_fields_it; - if( ! getPayload().has(required_field_name)) - { - return false; // a required field was not found - } - } - return true; // all required fields were found -} - bool LLNotification::isEquivalentTo(LLNotificationPtr that) const { if (this->mTemplatep->mName != that->mTemplatep->mName) @@ -583,11 +568,22 @@ bool LLNotification::isEquivalentTo(LLNotificationPtr that) const } if (this->mTemplatep->mUnique) { + const LLSD& these_substitutions = this->getSubstitutions(); + const LLSD& those_substitutions = that->getSubstitutions(); + // highlander bit sez there can only be one of these - return - this->payloadContainsAll(that->mTemplatep->mUniqueContext) && - that->payloadContainsAll(this->mTemplatep->mUniqueContext); + for (std::vector<std::string>::const_iterator it = mTemplatep->mUniqueContext.begin(), end_it = mTemplatep->mUniqueContext.end(); + it != end_it; + ++it) + { + if (these_substitutions.get(*it).asString() != those_substitutions.get(*it).asString()) + { + return false; + } + } + return true; } + return false; } diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index c942a32512..8bfada0e71 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -400,8 +400,6 @@ private: void cancel(); - bool payloadContainsAll(const std::vector<std::string>& required_fields) const; - public: // constructor from a saved notification |