summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-28 20:41:34 +0200
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-10-28 20:41:34 +0200
commitb2f1e8899b32f681e13705d684db9a93d18450ae (patch)
tree70ee7701d7a24a0759915f8050786ed43a8a2a7a /indra/llui
parent0ef7a9b39cf72da1211039ab22bdf8f9f6a2c984 (diff)
parent65764a5b7bab573b261386aca11a7967a21ec2d2 (diff)
Merge branch 'develop' into marchcat/c-develop
# Conflicts: # indra/llwindow/llwindowwin32.cpp # indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/llfloater.h6
-rw-r--r--indra/llui/lllineeditor.cpp1
-rw-r--r--indra/llui/lllineeditor.h2
-rw-r--r--indra/llui/llluafloater.cpp4
-rw-r--r--indra/llui/llnotifications.h1
-rw-r--r--indra/llui/llscrolllistctrl.cpp15
-rw-r--r--indra/llui/llscrolllistctrl.h1
-rw-r--r--indra/llui/lltexteditor.cpp8
-rw-r--r--indra/llui/lltexteditor.h7
9 files changed, 35 insertions, 10 deletions
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index 5bdbcdfcf8..9e1594bdd2 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -377,6 +377,10 @@ public:
void enableResizeCtrls(bool enable, bool width = true, bool height = true);
bool isPositioning(LLFloaterEnums::EOpenPositioning p) const { return (p == mPositioning); }
+
+ void setAutoFocus(bool focus) { mAutoFocus = focus; } // whether to automatically take focus when opened
+ bool getAutoFocus() const { return mAutoFocus; }
+
protected:
void applyControlsAndPosition(LLFloater* other);
@@ -401,8 +405,6 @@ protected:
void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized
const LLRect& getExpandedRect() const { return mExpandedRect; }
- void setAutoFocus(bool focus) { mAutoFocus = focus; } // whether to automatically take focus when opened
- bool getAutoFocus() const { return mAutoFocus; }
LLDragHandle* getDragHandle() const { return mDragHandle; }
void destroy(); // Don't call this directly. You probably want to call closeFloater()
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 66b274c33f..c0abba4358 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -122,6 +122,7 @@ LLLineEditor::Params::Params()
LLLineEditor::LLLineEditor(const LLLineEditor::Params& p)
: LLUICtrl(p),
+ mDefaultText(p.default_text),
mMaxLengthBytes(p.max_length.bytes),
mMaxLengthChars(p.max_length.chars),
mCursorPos( 0 ),
diff --git a/indra/llui/lllineeditor.h b/indra/llui/lllineeditor.h
index 7533f76f1d..65f167bc6b 100644
--- a/indra/llui/lllineeditor.h
+++ b/indra/llui/lllineeditor.h
@@ -202,6 +202,7 @@ public:
void setLabel(const LLStringExplicit &new_label) { mLabel = new_label; }
const std::string& getLabel() { return mLabel.getString(); }
+ void setDefaultText() { setText(mDefaultText); }
void setText(const LLStringExplicit &new_text);
const std::string& getText() const override { return mText.getString(); }
@@ -347,6 +348,7 @@ protected:
LLFontVertexBuffer mFontBufferSelection;
LLFontVertexBuffer mFontBufferPostSelection;
LLFontVertexBuffer mFontBufferLabel;
+ std::string mDefaultText;
S32 mMaxLengthBytes; // Max length of the UTF8 string in bytes
S32 mMaxLengthChars; // Maximum number of characters in the string
S32 mCursorPos; // I-beam is just after the mCursorPos-th character.
diff --git a/indra/llui/llluafloater.cpp b/indra/llui/llluafloater.cpp
index ccdadc6ae0..91c0cfeec9 100644
--- a/indra/llui/llluafloater.cpp
+++ b/indra/llui/llluafloater.cpp
@@ -301,11 +301,11 @@ void LLLuaFloater::postEvent(LLSD data, const std::string &event_name)
void LLLuaFloater::showLuaFloater(const LLSD &data)
{
fsyspath fs_path(data["xml_path"].asString());
- std::string path = fs_path.lexically_normal().u8string();
+ fsyspath path = fs_path.lexically_normal();
if (!fs_path.is_absolute())
{
std::string lib_path = gDirUtilp->getExpandedFilename(LL_PATH_SCRIPTS, "lua");
- path = (fsyspath(lib_path) / path).u8string();
+ path = fsyspath(fsyspath(lib_path) / path);
}
LLLuaFloater *floater = new LLLuaFloater(data);
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h
index ef0762fc17..eca13cbb3c 100644
--- a/indra/llui/llnotifications.h
+++ b/indra/llui/llnotifications.h
@@ -94,6 +94,7 @@
#include "llinitparam.h"
#include "llinstancetracker.h"
#include "llmortician.h"
+#include "llmutex.h"
#include "llnotificationptr.h"
#include "llpointer.h"
#include "llrefcount.h"
diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp
index 8093536868..3ed328e37f 100644
--- a/indra/llui/llscrolllistctrl.cpp
+++ b/indra/llui/llscrolllistctrl.cpp
@@ -423,6 +423,19 @@ std::vector<LLScrollListItem*> LLScrollListCtrl::getAllSelected() const
return ret;
}
+std::vector<LLSD> LLScrollListCtrl::getAllSelectedValues() const
+{
+ std::vector<LLSD> ret;
+ for (LLScrollListItem* item : mItemList)
+ {
+ if (item->getSelected())
+ {
+ ret.push_back(item->getValue());
+ }
+ }
+ return ret;
+}
+
S32 LLScrollListCtrl::getNumSelected() const
{
S32 numSelected = 0;
@@ -1510,7 +1523,7 @@ bool LLScrollListCtrl::setSelectedByValue(const LLSD& value, bool selected)
{
if (selected)
{
- selectItem(item, -1);
+ selectItem(item, -1, !mAllowMultipleSelection);
}
else
{
diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h
index bfae08ab5b..badaf31657 100644
--- a/indra/llui/llscrolllistctrl.h
+++ b/indra/llui/llscrolllistctrl.h
@@ -284,6 +284,7 @@ public:
LLScrollListItem* getFirstSelected() const;
virtual S32 getFirstSelectedIndex() const;
std::vector<LLScrollListItem*> getAllSelected() const;
+ std::vector<LLSD> getAllSelectedValues() const;
S32 getNumSelected() const;
LLScrollListItem* getLastSelectedItem() const { return mLastSelected; }
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index da365c6c9b..2d01116e40 100644
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -1625,8 +1625,14 @@ void LLTextEditor::cleanStringForPaste(LLWString & clean_string)
}
}
-void LLTextEditor::pasteTextWithLinebreaksImpl(const LLWString & clean_string)
+void LLTextEditor::pasteTextWithLinebreaksImpl(const LLWString & clean_string, bool reset_cursor)
{
+ if (reset_cursor)
+ {
+ deselect();
+ setCursorPos(getLength());
+ }
+
std::basic_string<llwchar>::size_type start = 0;
std::basic_string<llwchar>::size_type pos = clean_string.find('\n',start);
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index 20ea022dbd..869ff2a63c 100644
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -310,14 +310,13 @@ private:
public:
template <typename STRINGTYPE>
- void pasteTextWithLinebreaks(const STRINGTYPE& clean_string)
+ void pasteTextWithLinebreaks(const STRINGTYPE& clean_string, bool reset_cursor = false)
{
- pasteTextWithLinebreaksImpl(ll_convert(clean_string));
+ pasteTextWithLinebreaksImpl(ll_convert(clean_string), reset_cursor);
}
- void pasteTextWithLinebreaksImpl(const LLWString& clean_string);
+ void pasteTextWithLinebreaksImpl(const LLWString& clean_string, bool reset_cursor = false);
private:
- void pasteTextWithLinebreaksInternal(const LLWString & clean_string);
void onKeyStroke();
// Concrete TextCmd sub-classes used by the LLTextEditor base class