From c6089637e71c71e3301082327b89a61b2af408f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Liru=20F=C3=A6rs?= Date: Thu, 10 Oct 2019 12:37:47 -0400 Subject: [PATCH] On second thought, clicking a name editor should open up the profile, too The initial thinking behind this decision was that people may want to select, if they do, they can right click for this very rare use case. --- indra/newview/llnamebox.cpp | 17 +---------------- indra/newview/llnamebox.h | 1 - indra/newview/llnameeditor.cpp | 13 ++++++++++++- indra/newview/llnameeditor.h | 1 + indra/newview/llnameui.cpp | 12 ++++++++++++ indra/newview/llnameui.h | 1 + 6 files changed, 27 insertions(+), 18 deletions(-) diff --git a/indra/newview/llnamebox.cpp b/indra/newview/llnamebox.cpp index 9caa43f64..f09bf0e63 100644 --- a/indra/newview/llnamebox.cpp +++ b/indra/newview/llnamebox.cpp @@ -34,18 +34,13 @@ #include "llnamebox.h" -#include "llcachename.h" - -#include "llavataractions.h" -#include "llgroupactions.h" - static LLRegisterWidget r("name_box"); LLNameBox::LLNameBox(const std::string& name) : LLNameUI() , LLTextBox(name, LLRect(), LLStringUtil::null, nullptr, TRUE) { - setClickedCallback(boost::bind(&LLNameBox::showProfile, this)); + setClickedCallback(boost::bind(&LLNameUI::showProfile, this)); } void LLNameBox::displayAsLink(bool link) @@ -55,16 +50,6 @@ void LLNameBox::displayAsLink(bool link) setDisabledColor(link ? color : LLUI::sColorsGroup->getColor("LabelDisabledColor")); } -void LLNameBox::showProfile() -{ - if (!mAllowInteract) return; - - if (mIsGroup) - LLGroupActions::show(mNameID); - else - LLAvatarActions::showProfile(mNameID); -} - // virtual BOOL LLNameBox::handleRightMouseDown(S32 x, S32 y, MASK mask) { diff --git a/indra/newview/llnamebox.h b/indra/newview/llnamebox.h index 2ea39f6f0..8d0005c75 100644 --- a/indra/newview/llnamebox.h +++ b/indra/newview/llnamebox.h @@ -49,7 +49,6 @@ public: void setValue(const LLSD& value) override final { LLNameUI::setValue(value); } LLSD getValue() const override final { return LLNameUI::getValue(); } - void showProfile(); BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override final; protected: diff --git a/indra/newview/llnameeditor.cpp b/indra/newview/llnameeditor.cpp index d00a6dc25..70ab8cc28 100644 --- a/indra/newview/llnameeditor.cpp +++ b/indra/newview/llnameeditor.cpp @@ -33,7 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llnameeditor.h" -#include "llcachename.h" + #include "llmenugl.h" #include "lluictrlfactory.h" @@ -56,6 +56,17 @@ LLNameEditor::LLNameEditor(const std::string& name, const LLRect& rect, else setText(mInitialValue); } +// virtual +BOOL LLNameEditor::handleMouseDown(S32 x, S32 y, MASK mask) +{ + if (mAllowInteract) + { + showProfile(); + return true; + } + else return LLLineEditor::handleMouseDown(x, y, mask); +} + // virtual BOOL LLNameEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) { diff --git a/indra/newview/llnameeditor.h b/indra/newview/llnameeditor.h index 7d566526d..c11c26fe7 100644 --- a/indra/newview/llnameeditor.h +++ b/indra/newview/llnameeditor.h @@ -49,6 +49,7 @@ public: const LLFontGL* glfont = nullptr, S32 max_text_length = 254); + BOOL handleMouseDown(S32 x, S32 y, MASK mask) override final; BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) override final; LLXMLNodePtr getXML(bool save_children = true) const override final; diff --git a/indra/newview/llnameui.cpp b/indra/newview/llnameui.cpp index 4a7e45aea..3c3a50a14 100644 --- a/indra/newview/llnameui.cpp +++ b/indra/newview/llnameui.cpp @@ -35,7 +35,9 @@ #include "llnameui.h" #include "llagentdata.h" +#include "llavataractions.h" #include "llavatarnamecache.h" +#include "llgroupactions.h" #include "lltrans.h" #include "rlvhandler.h" @@ -126,4 +128,14 @@ void LLNameUI::refreshAll(const LLUUID& id, const std::string& full_name, bool i { box->refresh(id, full_name, is_group); } +} + +void LLNameUI::showProfile() +{ + if (!mAllowInteract) return; + + if (mIsGroup) + LLGroupActions::show(mNameID); + else + LLAvatarActions::showProfile(mNameID); } \ No newline at end of file diff --git a/indra/newview/llnameui.h b/indra/newview/llnameui.h index 99616e9d7..3d392675c 100644 --- a/indra/newview/llnameui.h +++ b/indra/newview/llnameui.h @@ -57,6 +57,7 @@ struct LLNameUI : public LFIDBearer static void refreshAll(const LLUUID& id, const std::string& full_name, bool is_group); void setShowCompleteName(bool show) { mShowCompleteName = show; } + void showProfile(); virtual void displayAsLink(bool link) = 0; // Override to make the name display as a link virtual void setText(const std::string& text) = 0;