diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/lltextbase.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltextbase.h | 2 | ||||
-rw-r--r-- | indra/llui/lltextbox.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltextbox.h | 2 | ||||
-rw-r--r-- | indra/llui/lltexteditor.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lltexteditor.h | 2 | ||||
-rw-r--r-- | indra/llui/lluicolortable.cpp | 10 | ||||
-rw-r--r-- | indra/llui/lluictrl.cpp | 4 | ||||
-rw-r--r-- | indra/llui/lluictrlfactory.cpp | 2 |
9 files changed, 19 insertions, 15 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 9706878a57..7b1aaac35c 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1451,7 +1451,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url) } } -void LLTextBase::setText(const LLStringExplicit &utf8str) +void LLTextBase::setText(const LLStringExplicit &utf8str ,const LLStyle::Params& input_params) { // clear out the existing text and segments getViewModel()->setDisplay(LLWStringUtil::null); @@ -1466,7 +1466,7 @@ void LLTextBase::setText(const LLStringExplicit &utf8str) std::string text(utf8str); LLStringUtil::removeCRLF(text); - appendText(text, false); + appendText(text, false, input_params); onValueChange(0, getLength()); } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index fb01cd1e7c..70d78c77cd 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -137,7 +137,7 @@ public: // Text accessors // TODO: add optional style parameter - virtual void setText(const LLStringExplicit &utf8str); // uses default style + virtual void setText(const LLStringExplicit &utf8str , const LLStyle::Params& input_params = LLStyle::Params()); // uses default style virtual std::string getText() const; // wide-char versions diff --git a/indra/llui/lltextbox.cpp b/indra/llui/lltextbox.cpp index 00f1d833a3..4c4123cf45 100644 --- a/indra/llui/lltextbox.cpp +++ b/indra/llui/lltextbox.cpp @@ -112,12 +112,12 @@ BOOL LLTextBox::handleHover(S32 x, S32 y, MASK mask) return handled; } -void LLTextBox::setText(const LLStringExplicit& text) +void LLTextBox::setText(const LLStringExplicit& text , const LLStyle::Params& input_params ) { // does string argument insertion mText.assign(text); - LLTextBase::setText(mText.getString()); + LLTextBase::setText(mText.getString(), input_params ); } void LLTextBox::setClickedCallback( boost::function<void (void*)> cb, void* userdata /*= NULL */ ) diff --git a/indra/llui/lltextbox.h b/indra/llui/lltextbox.h index 73f8a7c299..01b4bfa5ed 100644 --- a/indra/llui/lltextbox.h +++ b/indra/llui/lltextbox.h @@ -58,7 +58,7 @@ public: /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - /*virtual*/ void setText( const LLStringExplicit& text ); + /*virtual*/ void setText( const LLStringExplicit& text, const LLStyle::Params& input_params = LLStyle::Params() ); void setRightAlign() { mHAlign = LLFontGL::RIGHT; } void setHAlign( LLFontGL::HAlign align ) { mHAlign = align; } diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index d136c6b49d..224f066968 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -311,12 +311,12 @@ LLTextEditor::~LLTextEditor() // LLTextEditor // Public methods -void LLTextEditor::setText(const LLStringExplicit &utf8str) +void LLTextEditor::setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params) { blockUndo(); deselect(); - LLTextBase::setText(utf8str); + LLTextBase::setText(utf8str, input_params); resetDirty(); } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 10fc94dedc..fb014b86bf 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -168,7 +168,7 @@ public: void appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo); // Non-undoable - void setText(const LLStringExplicit &utf8str); + void setText(const LLStringExplicit &utf8str, const LLStyle::Params& input_params = LLStyle::Params()); // Removes text from the end of document diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index f1e3000547..9be33483d0 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -192,19 +192,27 @@ void LLUIColorTable::clear() LLUIColor LLUIColorTable::getColor(const std::string& name, const LLColor4& default_color) const { string_color_map_t::const_iterator iter = mUserSetColors.find(name); + if(iter != mUserSetColors.end()) { return LLUIColor(&iter->second); } iter = mLoadedColors.find(name); - return (iter != mLoadedColors.end() ? LLUIColor(&iter->second) : LLUIColor(default_color)); + + if(iter != mLoadedColors.end()) + { + return LLUIColor(&iter->second); + } + + return LLUIColor(default_color); } // update user color, loaded colors are parsed on initialization void LLUIColorTable::setColor(const std::string& name, const LLColor4& color) { setColor(name, color, mUserSetColors); + setColor(name, color, mLoadedColors); } bool LLUIColorTable::loadFromSettings() diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index aaadc1b58d..08fc8fb784 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -38,10 +38,6 @@ #include "llpanel.h" #include "lluictrlfactory.h" -// This breaks the ability to construct dummy LLUICtrls for calls like -// getChild<LLUICtrl>("not-there") -//static LLWidgetNameRegistry::StaticRegistrar r(&typeid(LLUICtrl::Params), "ui_ctrl"); -// This doesn't appear to read/apply ui_ctrl.xml static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl"); LLUICtrl::Params::Params() diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index adfbb41feb..1c1450d7e9 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -433,8 +433,8 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st LLWidgetNameRegistry ::instance().defaultRegistrar().add(param_block_type, tag); // associate widget type with factory function LLDefaultWidgetRegistry::instance().defaultRegistrar().add(widget_type, creator_func); - LLWidgetTypeRegistry::instance().defaultRegistrar().add(tag, widget_type); //FIXME: comment this in when working on schema generation + //LLWidgetTypeRegistry::instance().defaultRegistrar().add(tag, widget_type); //LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &getEmptyParamBlock<T>); } |