From 024032c6745300a0cde75ad404e73a7ddff61534 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 4 Jun 2021 22:31:20 +0300 Subject: SL-15346 "Listing ID" field has OS-dependent length restriction --- indra/llui/lllineeditor.cpp | 17 +++++++++++++++-- indra/llui/lllineeditor.h | 2 ++ 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index 1badd54fca..a88a191847 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -175,6 +175,14 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) mTripleClickTimer.reset(); setText(p.default_text()); + if (p.initial_value.isProvided() + && !p.control_name.isProvided()) + { + // Initial value often is descriptive, like "Type some ID here" + // and can be longer than size limitation, ignore size + setText(p.initial_value.getValue().asString(), true); + } + // Initialize current history line iterator mCurrentHistoryLine = mLineHistory.begin(); @@ -389,6 +397,11 @@ void LLLineEditor::updateTextPadding() void LLLineEditor::setText(const LLStringExplicit &new_text) +{ + setText(new_text, false); +} + +void LLLineEditor::setText(const LLStringExplicit &new_text, bool ignore_size_limit) { // If new text is identical, don't copy and don't move insertion point if (mText.getString() == new_text) @@ -407,13 +420,13 @@ void LLLineEditor::setText(const LLStringExplicit &new_text) all_selected = all_selected || (len == 0 && hasFocus() && mSelectAllonFocusReceived); std::string truncated_utf8 = new_text; - if (truncated_utf8.size() > (U32)mMaxLengthBytes) + if (!ignore_size_limit && truncated_utf8.size() > (U32)mMaxLengthBytes) { truncated_utf8 = utf8str_truncate(new_text, mMaxLengthBytes); } mText.assign(truncated_utf8); - if (mMaxLengthChars) + if (!ignore_size_limit && mMaxLengthChars) { mText.assign(utf8str_symbol_truncate(truncated_utf8, mMaxLengthChars)); } diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index aa5779d45f..088578a821 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -317,6 +317,8 @@ private: virtual S32 getPreeditFontSize() const; virtual LLWString getPreeditString() const { return getWText(); } + void setText(const LLStringExplicit &new_text, bool ignore_size_limit); + void setContextMenu(LLContextMenu* new_context_menu); protected: -- cgit v1.2.3 From 7c179b8e7d0b7a0f4a9412ad4525a050a1f95bbe Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Sat, 5 Jun 2021 10:12:34 +0300 Subject: SL-15346 Small adjustment --- indra/llui/lllineeditor.cpp | 10 +++++----- indra/llui/lllineeditor.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index a88a191847..33037b5001 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -180,7 +180,7 @@ LLLineEditor::LLLineEditor(const LLLineEditor::Params& p) { // Initial value often is descriptive, like "Type some ID here" // and can be longer than size limitation, ignore size - setText(p.initial_value.getValue().asString(), true); + setText(p.initial_value.getValue().asString(), false); } // Initialize current history line iterator @@ -398,10 +398,10 @@ void LLLineEditor::updateTextPadding() void LLLineEditor::setText(const LLStringExplicit &new_text) { - setText(new_text, false); + setText(new_text, true); } -void LLLineEditor::setText(const LLStringExplicit &new_text, bool ignore_size_limit) +void LLLineEditor::setText(const LLStringExplicit &new_text, bool use_size_limit) { // If new text is identical, don't copy and don't move insertion point if (mText.getString() == new_text) @@ -420,13 +420,13 @@ void LLLineEditor::setText(const LLStringExplicit &new_text, bool ignore_size_li all_selected = all_selected || (len == 0 && hasFocus() && mSelectAllonFocusReceived); std::string truncated_utf8 = new_text; - if (!ignore_size_limit && truncated_utf8.size() > (U32)mMaxLengthBytes) + if (use_size_limit && truncated_utf8.size() > (U32)mMaxLengthBytes) { truncated_utf8 = utf8str_truncate(new_text, mMaxLengthBytes); } mText.assign(truncated_utf8); - if (!ignore_size_limit && mMaxLengthChars) + if (use_size_limit && mMaxLengthChars) { mText.assign(utf8str_symbol_truncate(truncated_utf8, mMaxLengthChars)); } diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h index 088578a821..f8abd5eacf 100644 --- a/indra/llui/lllineeditor.h +++ b/indra/llui/lllineeditor.h @@ -317,7 +317,7 @@ private: virtual S32 getPreeditFontSize() const; virtual LLWString getPreeditString() const { return getWText(); } - void setText(const LLStringExplicit &new_text, bool ignore_size_limit); + void setText(const LLStringExplicit &new_text, bool use_size_limit); void setContextMenu(LLContextMenu* new_context_menu); -- cgit v1.2.3 From da5cc13df2d3cff17cb6afb586da278709e9d40a Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Fri, 18 Jun 2021 19:11:33 +0300 Subject: SL-15410 Menu search breaks torn off menus --- indra/llui/llmenugl.cpp | 41 ++++++++++++++++++++++++++++++++++++++--- indra/llui/llmenugl.h | 4 +++- 2 files changed, 41 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 37dbe9b40e..f04ce74ce1 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -2362,6 +2362,16 @@ void LLMenuGL::arrange( void ) (*item_iter)->setRect( rect ); } } + + + if (getTornOff()) + { + LLTearOffMenu * torn_off_menu = dynamic_cast(getParent()); + if (torn_off_menu) + { + torn_off_menu->updateSize(); + } + } } if (mKeepFixedSize) { @@ -3894,7 +3904,7 @@ LLTearOffMenu::LLTearOffMenu(LLMenuGL* menup) : LLRect rect; menup->localRectToOtherView(LLRect(-1, menup->getRect().getHeight(), menup->getRect().getWidth() + 3, 0), &rect, gFloaterView); // make sure this floater is big enough for menu - mTargetHeight = (F32)(rect.getHeight() + floater_header_size); + mTargetHeight = rect.getHeight() + floater_header_size; reshape(rect.getWidth(), rect.getHeight()); setRect(rect); @@ -3926,12 +3936,12 @@ LLTearOffMenu::~LLTearOffMenu() void LLTearOffMenu::draw() { mMenu->setBackgroundVisible(isBackgroundOpaque()); - mMenu->needsArrange(); if (getRect().getHeight() != mTargetHeight) { // animate towards target height - reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), mTargetHeight, LLSmoothInterpolation::getInterpolant(0.05f)))); + reshape(getRect().getWidth(), llceil(lerp((F32)getRect().getHeight(), (F32)mTargetHeight, LLSmoothInterpolation::getInterpolant(0.05f)))); + mMenu->needsArrange(); } LLFloater::draw(); } @@ -4014,6 +4024,31 @@ LLTearOffMenu* LLTearOffMenu::create(LLMenuGL* menup) return tearoffp; } +void LLTearOffMenu::updateSize() +{ + if (mMenu) + { + S32 floater_header_size = getHeaderHeight(); + const LLRect &floater_rect = getRect(); + LLRect new_rect; + mMenu->localRectToOtherView(LLRect(-1, mMenu->getRect().getHeight() + floater_header_size, mMenu->getRect().getWidth() + 3, 0), &new_rect, gFloaterView); + + if (floater_rect.getWidth() != new_rect.getWidth() + || mTargetHeight != new_rect.getHeight()) + { + // make sure this floater is big enough for menu + mTargetHeight = new_rect.getHeight(); + reshape(new_rect.getWidth(), mTargetHeight); + + // Restore menu position + LLRect menu_rect = mMenu->getRect(); + menu_rect.setOriginAndSize(1, 1, + menu_rect.getWidth(), menu_rect.getHeight()); + mMenu->setRect(menu_rect); + } + } +} + void LLTearOffMenu::closeTearOff() { removeChild(mMenu); diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 273bd789c4..01e677315b 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -873,6 +873,8 @@ public: virtual BOOL handleKeyHere(KEY key, MASK mask); virtual void translate(S32 x, S32 y); + void updateSize(); + private: LLTearOffMenu(LLMenuGL* menup); @@ -880,7 +882,7 @@ private: LLView* mOldParent; LLMenuGL* mMenu; - F32 mTargetHeight; + S32 mTargetHeight; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From 8178e51a743f43600798f1251231908025dd11d7 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Thu, 29 Jul 2021 19:06:13 +0300 Subject: SL-15690 FIXED Wrong URI determination --- indra/llui/llurlentry.cpp | 18 ++++++++++++++++++ indra/llui/llurlentry.h | 11 +++++++++++ indra/llui/llurlregistry.cpp | 2 +- 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index e43c52c0c2..2d526df7a5 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -976,6 +976,24 @@ std::string LLUrlEntryObjectIM::getLocation(const std::string &url) const return LLUrlEntryBase::getLocation(url); } +// +// LLUrlEntryChat Describes a Second Life chat Url, e.g., +// secondlife:///app/chat/42/This%20Is%20a%20test +// + +LLUrlEntryChat::LLUrlEntryChat() +{ + mPattern = boost::regex("secondlife:///app/chat/\\d+/\\S+", + boost::regex::perl|boost::regex::icase); + mMenuName = "menu_url_slapp.xml"; + mTooltip = LLTrans::getString("TooltipSLAPP"); +} + +std::string LLUrlEntryChat::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + return unescapeUrl(url); +} + // LLUrlEntryParcel statics. LLUUID LLUrlEntryParcel::sAgentID(LLUUID::null); LLUUID LLUrlEntryParcel::sSessionID(LLUUID::null); diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 4af1ab5096..21206b5852 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -370,6 +370,17 @@ public: private: }; +// +// LLUrlEntryChat Describes a Second Life chat Url, e.g., +// secondlife:///app/chat/42/This%20Is%20a%20test +// +class LLUrlEntryChat : public LLUrlEntryBase +{ +public: + LLUrlEntryChat(); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); +}; + /// /// LLUrlEntryParcel Describes a Second Life parcel Url, e.g., /// secondlife:///app/parcel/0000060e-4b39-e00b-d0c3-d98b1934e3a8/about diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 321a0ec5b9..732691b4a5 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -63,6 +63,7 @@ LLUrlRegistry::LLUrlRegistry() // LLUrlEntryAgent*Name must appear before LLUrlEntryAgent since // LLUrlEntryAgent is a less specific (catchall for agent urls) registerUrl(new LLUrlEntryAgent()); + registerUrl(new LLUrlEntryChat()); registerUrl(new LLUrlEntryGroup()); registerUrl(new LLUrlEntryParcel()); registerUrl(new LLUrlEntryTeleport()); @@ -71,7 +72,6 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntryObjectIM()); registerUrl(new LLUrlEntryPlace()); registerUrl(new LLUrlEntryInventory()); - registerUrl(new LLUrlEntryObjectIM()); registerUrl(new LLUrlEntryExperienceProfile()); //LLUrlEntrySL and LLUrlEntrySLLabel have more common pattern, //so it should be registered in the end of list -- cgit v1.2.3 From 01be43b7cdd9cc4c06d2d3ff3e1a21bba4ba3e6b Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 3 Aug 2021 17:27:53 +0300 Subject: SL-15426 FIXED Tear off menu visible during logout --- indra/llui/llmenugl.cpp | 11 +++++++++-- indra/llui/llmenugl.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 80d12a0953..76fd789bec 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3889,7 +3889,8 @@ void LLMenuHolderGL::setActivatedItem(LLMenuItemGL* item) /// Class LLTearOffMenu ///============================================================================ LLTearOffMenu::LLTearOffMenu(LLMenuGL* menup) : - LLFloater(LLSD()) + LLFloater(LLSD()), + mQuitRequested(false) { S32 floater_header_size = getHeaderHeight(); @@ -3948,7 +3949,12 @@ void LLTearOffMenu::draw() void LLTearOffMenu::onFocusReceived() { - // if nothing is highlighted, just highlight first item + if (mQuitRequested) + { + return; + } + + // if nothing is highlighted, just highlight first item if (!mMenu->getHighlightedItem()) { mMenu->highlightNextItem(NULL); @@ -4059,6 +4065,7 @@ void LLTearOffMenu::closeTearOff() mMenu->setVisible(FALSE); mMenu->setTornOff(FALSE); mMenu->setDropShadowed(TRUE); + mQuitRequested = true; } LLContextMenuBranch::LLContextMenuBranch(const LLContextMenuBranch::Params& p) diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 01e677315b..abbfd9a24a 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -883,6 +883,7 @@ private: LLView* mOldParent; LLMenuGL* mMenu; S32 mTargetHeight; + bool mQuitRequested; }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3