From 09053688c3b35b7c4e33ed831b806220a77ce662 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Mon, 22 Feb 2010 16:50:31 +0200 Subject: fixed low Bug EXT-5194 SLURL field dropdown should display empty menu rather than do nothing when empty --HG-- branch : product-engine --- indra/newview/lllocationinputctrl.cpp | 9 +++++++++ indra/newview/lllocationinputctrl.h | 7 +++++++ 2 files changed, 16 insertions(+) (limited to 'indra') diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 04c684b240..a9ead36a70 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -674,6 +674,15 @@ void LLLocationInputCtrl::onLocationPrearrange(const LLSD& data) _1, filter)); } } + if(mList->isEmpty()) + { + /** + * Add a couple of empty items for a better view. + * EXT-5194 + */ + for(int i = 0; i < NUMBER_OF_EMPTY_ITEMS; i++ ) + add("", LLSD()); + } sortByName(); mList->mouseOverHighlightNthItem(-1); // Clear highlight on the last selected item. diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 4bb41f3bf4..ee128a5cf7 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -120,6 +120,13 @@ private: ICON_COUNT }; + /** + * This constant holds number of empty dropdown items, which will be displayed instead of doing nothing when the list is empty. + * Added due to EXT-5194 + */ + static const S32 NUMBER_OF_EMPTY_ITEMS = 3; + + friend class LLUICtrlFactory; LLLocationInputCtrl(const Params&); virtual ~LLLocationInputCtrl(); -- cgit v1.2.3 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 +++++++++++++--------- .../skins/default/xui/en/inspector_info_ctrl.xml | 9 +++ 2 files changed, 55 insertions(+), 30 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/inspector_info_ctrl.xml (limited to 'indra') 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), diff --git a/indra/newview/skins/default/xui/en/inspector_info_ctrl.xml b/indra/newview/skins/default/xui/en/inspector_info_ctrl.xml new file mode 100644 index 0000000000..39fb54d513 --- /dev/null +++ b/indra/newview/skins/default/xui/en/inspector_info_ctrl.xml @@ -0,0 +1,9 @@ +