From 25078eb1f9cc2ecc1414e1e54dad55e76d372f34 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 22 Feb 2010 17:09:03 +0200 Subject: fixed EXT-5292 'i' btn is visible through inspector --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 76 +++++++++++++++++++++++++---------------- 1 file changed, 46 insertions(+), 30 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 6180b880b5..5e8d5a63d0 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -116,34 +116,6 @@ public: return LLPanel::handleMouseUp(x,y,mask); } - //*TODO remake it using mouse enter/leave and static LLHandle to add/remove as a child - BOOL handleToolTip(S32 x, S32 y, MASK mask) - { - LLTextBase* name = getChild("user_name"); - if (name && name->parentPointInView(x, y) && mAvatarID.notNull() && mFrom.size() && SYSTEM_FROM != mFrom) - { - - // Spawn at right side of the name textbox. - LLRect sticky_rect = name->calcScreenRect(); - S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); - - LLToolTip::Params params; - params.background_visible(false); - params.click_callback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, 0, 0, 0)); - params.delay_time(0.0f); // spawn instantly on hover - params.image(LLUI::getUIImage("Info_Small")); - params.message(""); - params.padding(0); - params.pos(LLCoordGL(icon_x, sticky_rect.mTop - 2)); - params.sticky_rect(sticky_rect); - - LLToolTipMgr::getInstance()->show(params); - return TRUE; - } - - return LLPanel::handleToolTip(x, y, mask); - } - void onObjectIconContextMenuItemClicked(const LLSD& userdata) { std::string level = userdata.asString(); @@ -198,7 +170,10 @@ public: menu = LLUICtrlFactory::getInstance()->createFromFile("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mPopupMenuHandleObject = menu->getHandle(); - setDoubleClickCallback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, _2, _3, _4)); + setDoubleClickCallback(boost::bind(&LLChatHistoryHeader::showInspector, this)); + + setMouseEnterCallback(boost::bind(&LLChatHistoryHeader::showInfoCtrl, this)); + setMouseLeaveCallback(boost::bind(&LLChatHistoryHeader::hideInfoCtrl, this)); return LLPanel::postBuild(); } @@ -232,7 +207,7 @@ public: return LLPanel::handleRightMouseDown(x,y,mask); } - void onHeaderPanelClick(S32 x, S32 y, MASK mask) + void showInspector() { if (mSourceType == CHAT_SOURCE_OBJECT) { @@ -245,6 +220,17 @@ public: //if chat source is system, you may add "else" here to define behaviour. } + static void onClickInfoCtrl(LLUICtrl* info_ctrl) + { + if (!info_ctrl) return; + + LLChatHistoryHeader* header = dynamic_cast(info_ctrl->getParent()); + if (!header) return; + + header->showInspector(); + } + + const LLUUID& getAvatarId () const { return mAvatarID;} void setup(const LLChat& chat,const LLStyle::Params& style_params) @@ -385,6 +371,33 @@ protected: } } + void showInfoCtrl() + { + if (mAvatarID.isNull() || mFrom.empty() || SYSTEM_FROM == mFrom) return; + + if (!sInfoCtrl) + { + sInfoCtrl = LLUICtrlFactory::createFromFile("inspector_info_ctrl.xml", NULL, LLPanel::child_registry_t::instance()); + sInfoCtrl->setCommitCallback(boost::bind(&LLChatHistoryHeader::onClickInfoCtrl, sInfoCtrl)); + } + + LLTextBase* name = getChild("user_name"); + LLRect sticky_rect = name->getRect(); + S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); + sInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - sInfoCtrl->getRect().getHeight() / 2 ) ; + addChild(sInfoCtrl); + } + + void hideInfoCtrl() + { + if (!sInfoCtrl) return; + + if (sInfoCtrl->getParent() == this) + { + removeChild(sInfoCtrl); + } + } + private: void setTimeField(const LLChat& chat) { @@ -413,6 +426,8 @@ protected: LLHandle mPopupMenuHandleAvatar; LLHandle mPopupMenuHandleObject; + static LLUICtrl* sInfoCtrl; + LLUUID mAvatarID; EChatSourceType mSourceType; std::string mFrom; @@ -421,6 +436,7 @@ protected: S32 mMinUserNameWidth; }; +LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL; LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) : LLUICtrl(p), -- cgit v1.2.3 From 6575b685e91d334198789c88dec2efab7e5a1ac9 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Wed, 24 Feb 2010 17:18:05 +0200 Subject: fixed EXT-5526 Objects are shown as persons in the chat history from previous sessions - new chat source type CHAT_SOURCE_UNKNOWN for avatar names not in cache and object names consisting of two words (avatar names like) - new icon (unknown_icon.png) for message headers () of nearby chat messagses coming from CHAT_SOURCE_UNKNOWN - context menu no longer displayed for object names from chat history (no UUIDs) - double click on message headers in nearby chat no longer opens Inspector (no UUIDs) - object names (loaded from chat history) in nearby chat are no longer SLURLed (no UUIDs for them) --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 5e8d5a63d0..45c2d26fde 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -209,6 +209,8 @@ public: void showInspector() { + if (mAvatarID.isNull() && CHAT_SOURCE_SYSTEM != mSourceType) return; + if (mSourceType == CHAT_SOURCE_OBJECT) { LLFloaterReg::showInstance("inspect_object", LLSD().with("object_id", mAvatarID)); @@ -279,6 +281,9 @@ public: break; case CHAT_SOURCE_SYSTEM: icon->setValue(LLSD("SL_Logo")); + break; + case CHAT_SOURCE_UNKNOWN: + icon->setValue(LLSD("Unknown_Icon")); } } @@ -325,9 +330,9 @@ protected: { if(mSourceType == CHAT_SOURCE_SYSTEM) showSystemContextMenu(x,y); - if(mSourceType == CHAT_SOURCE_AGENT) + if(mAvatarID.notNull() && mSourceType == CHAT_SOURCE_AGENT) showAvatarContextMenu(x,y); - if(mSourceType == CHAT_SOURCE_OBJECT && SYSTEM_FROM != mFrom) + if(mAvatarID.notNull() && mSourceType == CHAT_SOURCE_OBJECT && SYSTEM_FROM != mFrom) showObjectContextMenu(x,y); } @@ -632,7 +637,7 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL if (utf8str_trim(chat.mFromName).size() != 0) { // Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text. - if ( chat.mSourceType == CHAT_SOURCE_OBJECT ) + if ( chat.mSourceType == CHAT_SOURCE_OBJECT && chat.mFromID.notNull()) { // for object IMs, create a secondlife:///app/objectim SLapp std::string url = LLSLURL::buildCommand("objectim", chat.mFromID, ""); -- cgit v1.2.3 From 08ede585ce33b2551d8e22bec5c5b3a5e345051f Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Wed, 24 Feb 2010 17:13:56 +0200 Subject: Work on major bug EXT-5589 (Notifications button falls under side panel) -- updated LLLayoutStack to process "max_width" & "max_height" attributes for layout_panel. --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/newview/llchathistory.cpp') diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 45c2d26fde..e1c96d4a16 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -491,7 +491,7 @@ void LLChatHistory::initFromParams(const LLChatHistory::Params& p) panel_p.background_visible = false; panel_p.has_border = false; panel_p.mouse_opaque = false; - stackp->addPanel(LLUICtrlFactory::create(panel_p), 0, 30, true, false, LLLayoutStack::ANIMATE); + stackp->addPanel(LLUICtrlFactory::create(panel_p), 0, 30, S32_MAX, S32_MAX, true, false, LLLayoutStack::ANIMATE); panel_p.name = "new_text_notice_holder"; LLRect new_text_notice_rect = getLocalRect(); @@ -509,7 +509,7 @@ void LLChatHistory::initFromParams(const LLChatHistory::Params& p) mMoreChatText = LLUICtrlFactory::create(text_p, mMoreChatPanel); mMoreChatText->setClickedCallback(boost::bind(&LLChatHistory::onClickMoreText, this)); - stackp->addPanel(mMoreChatPanel, 0, 0, false, false, LLLayoutStack::ANIMATE); + stackp->addPanel(mMoreChatPanel, 0, 0, S32_MAX, S32_MAX, false, false, LLLayoutStack::ANIMATE); } -- cgit v1.2.3