From 5d8de7b7200c514bb874e4f60581c6df6cf3be5a Mon Sep 17 00:00:00 2001 From: Erica Date: Thu, 21 Jan 2010 10:52:58 -0800 Subject: getting chiclet stuff out of test floater since it causes a crash --- .../skins/default/xui/en/floater_test_checkbox.xml | 79 ---------------------- 1 file changed, 79 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_test_checkbox.xml b/indra/newview/skins/default/xui/en/floater_test_checkbox.xml index 042b4226c3..9977e85a9d 100644 --- a/indra/newview/skins/default/xui/en/floater_test_checkbox.xml +++ b/indra/newview/skins/default/xui/en/floater_test_checkbox.xml @@ -71,83 +71,4 @@ name="font_checkbox" top_pad="14" width="150" /> - - - - - - - - - - - - - - - -- cgit v1.2.3 From 337716d946cf4ece8ba59cce82bd51b3c2148f75 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 22 Jan 2010 16:51:13 -0800 Subject: LLPointer cleanup and fix for EXT-4413 reviewed by Rick --- indra/llcommon/llpointer.h | 1 - indra/llcommon/llrefcount.cpp | 11 +++ indra/llcommon/llrefcount.h | 14 ++-- indra/llui/llspinctrl.cpp | 16 ++-- indra/llui/llspinctrl.h | 5 +- indra/llui/llstyle.h | 4 +- indra/llui/lltextbase.cpp | 49 +++++------- indra/llui/lltextbase.h | 19 +++-- indra/llui/lltexteditor.cpp | 8 +- indra/llui/llui.cpp | 18 ++--- indra/llui/lluicolortable.h | 2 +- indra/llui/lluiimage.cpp | 4 +- indra/llxuixml/llinitparam.cpp | 12 ++- indra/llxuixml/llinitparam.h | 3 +- indra/llxuixml/lluicolor.cpp | 14 ++-- indra/llxuixml/lluicolor.h | 8 +- indra/newview/llavatarlist.h | 10 +-- indra/newview/llavatarlistitem.cpp | 88 +++++++++------------- indra/newview/llavatarlistitem.h | 15 +++- indra/newview/llexpandabletextbox.cpp | 6 +- indra/newview/llviewertexteditor.cpp | 2 +- .../default/xui/en/widgets/avatar_list_item.xml | 44 +++++++++++ 22 files changed, 195 insertions(+), 158 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml (limited to 'indra') diff --git a/indra/llcommon/llpointer.h b/indra/llcommon/llpointer.h index 2c37eadcc6..e6c736a263 100644 --- a/indra/llcommon/llpointer.h +++ b/indra/llcommon/llpointer.h @@ -95,7 +95,6 @@ public: bool notNull() const { return (mPointer != NULL); } operator Type*() const { return mPointer; } - operator const Type*() const { return mPointer; } bool operator !=(Type* ptr) const { return (mPointer != ptr); } bool operator ==(Type* ptr) const { return (mPointer == ptr); } bool operator ==(const LLPointer& ptr) const { return (mPointer == ptr.mPointer); } diff --git a/indra/llcommon/llrefcount.cpp b/indra/llcommon/llrefcount.cpp index 33b6875fb0..c90b52f482 100644 --- a/indra/llcommon/llrefcount.cpp +++ b/indra/llcommon/llrefcount.cpp @@ -35,6 +35,17 @@ #include "llerror.h" +LLRefCount::LLRefCount(const LLRefCount& other) +: mRef(0) +{ +} + +LLRefCount& LLRefCount::operator=(const LLRefCount&) +{ + // do nothing, since ref count is specific to *this* reference + return *this; +} + LLRefCount::LLRefCount() : mRef(0) { diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h index 9ab844eb22..a18f6706a9 100644 --- a/indra/llcommon/llrefcount.h +++ b/indra/llcommon/llrefcount.h @@ -41,22 +41,20 @@ class LL_COMMON_API LLRefCount { -private: - LLRefCount(const LLRefCount& other); // no implementation -private: - LLRefCount& operator=(const LLRefCount&); // no implementation protected: + LLRefCount(const LLRefCount& other); + LLRefCount& operator=(const LLRefCount&); virtual ~LLRefCount(); // use unref() public: LLRefCount(); - void ref() + void ref() const { mRef++; } - S32 unref() + S32 unref() const { llassert(mRef >= 1); if (0 == --mRef) @@ -67,13 +65,15 @@ public: return mRef; } + //NOTE: when passing around a const LLRefCount object, this can return different results + // at different types, since mRef is mutable S32 getNumRefs() const { return mRef; } private: - S32 mRef; + mutable S32 mRef; }; #endif diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp index 20a1ab7af3..28f3788817 100644 --- a/indra/llui/llspinctrl.cpp +++ b/indra/llui/llspinctrl.cpp @@ -270,13 +270,19 @@ void LLSpinCtrl::clear() mbHasBeenSet = FALSE; } - +void LLSpinCtrl::updateLabelColor() +{ + if( mLabelBox ) + { + mLabelBox->setColor( getEnabled() ? mTextEnabledColor.get() : mTextDisabledColor.get() ); + } +} void LLSpinCtrl::updateEditor() { LLLocale locale(LLLocale::USER_LOCALE); - // Don't display very small negative values as -0.000 + // Don't display very small negative valu es as -0.000 F32 displayed_value = clamp_precision((F32)getValue().asReal(), mPrecision); // if( S32( displayed_value * pow( 10, mPrecision ) ) == 0 ) @@ -339,10 +345,7 @@ void LLSpinCtrl::setEnabled(BOOL b) { LLView::setEnabled( b ); mEditor->setEnabled( b ); - if( mLabelBox ) - { - mLabelBox->setColor( b ? mTextEnabledColor.get() : mTextDisabledColor.get() ); - } + updateLabelColor(); } @@ -390,6 +393,7 @@ void LLSpinCtrl::setLabel(const LLStringExplicit& label) { llwarns << "Attempting to set label on LLSpinCtrl constructed without one " << getName() << llendl; } + updateLabelColor(); } void LLSpinCtrl::setAllowEdit(BOOL allow_edit) diff --git a/indra/llui/llspinctrl.h b/indra/llui/llspinctrl.h index 0e610b7741..00d6f86f83 100644 --- a/indra/llui/llspinctrl.h +++ b/indra/llui/llspinctrl.h @@ -81,8 +81,8 @@ public: virtual void setPrecision(S32 precision); void setLabel(const LLStringExplicit& label); - void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; } - void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; } + void setLabelColor(const LLColor4& c) { mTextEnabledColor = c; updateLabelColor(); } + void setDisabledLabelColor(const LLColor4& c) { mTextDisabledColor = c; updateLabelColor();} void setAllowEdit(BOOL allow_edit); virtual void onTabInto(); @@ -103,6 +103,7 @@ public: void onDownBtn(const LLSD& data); private: + void updateLabelColor(); void updateEditor(); void reportInvalidData(); diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h index ee9ca730e9..2067e8e8be 100644 --- a/indra/llui/llstyle.h +++ b/indra/llui/llstyle.h @@ -59,11 +59,12 @@ public: void setColor(const LLColor4 &color) { mColor = color; } const LLColor4& getReadOnlyColor() const { return mReadOnlyColor; } + void setReadOnlyColor(const LLColor4& color) { mReadOnlyColor = color; } BOOL isVisible() const; void setVisible(BOOL is_visible); - LLFontGL::ShadowType getShadowType() { return mDropShadow; } + LLFontGL::ShadowType getShadowType() const { return mDropShadow; } void setFont(const LLFontGL* font); const LLFontGL* getFont() const; @@ -116,5 +117,6 @@ private: }; typedef LLPointer LLStyleSP; +typedef LLPointer LLStyleConstSP; #endif // LL_LLSTYLE_H diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 17aecaf32f..885a830c9f 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -291,9 +291,13 @@ bool LLTextBase::truncate() return did_truncate; } -LLStyle::Params LLTextBase::getDefaultStyle() +LLStyle::Params LLTextBase::getDefaultStyleParams() { - return LLStyle::Params().color(mFgColor.get()).readonly_color(mReadOnlyFgColor.get()).font(mDefaultFont).drop_shadow(mFontShadow); + return LLStyle::Params() + .color(LLUIColor(&mFgColor)) + .readonly_color(LLUIColor(&mReadOnlyFgColor)) + .font(mDefaultFont) + .drop_shadow(mFontShadow); } void LLTextBase::onValueChange(S32 start, S32 end) @@ -619,7 +623,7 @@ S32 LLTextBase::insertStringNoUndo(S32 pos, const LLWString &wstr, LLTextBase::s else { // create default editable segment to hold new text - default_segment = new LLNormalTextSegment( new LLStyle(getDefaultStyle()), pos, pos + insert_len, *this); + default_segment = new LLNormalTextSegment( LLStyleConstSP(new LLStyle(getDefaultStyleParams())), pos, pos + insert_len, *this); } // shift remaining segments to right @@ -743,7 +747,7 @@ void LLTextBase::createDefaultSegment() // ensures that there is always at least one segment if (mSegments.empty()) { - LLTextSegmentPtr default_segment = new LLNormalTextSegment( new LLStyle(getDefaultStyle()), 0, getLength() + 1, *this); + LLTextSegmentPtr default_segment = new LLNormalTextSegment( LLStyleConstSP(new LLStyle(getDefaultStyleParams())), 0, getLength() + 1, *this); mSegments.insert(default_segment); default_segment->linkToDocument(this); } @@ -1510,16 +1514,7 @@ std::string LLTextBase::getText() const void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, const LLStyle::Params& input_params) { LLStyle::Params style_params(input_params); - style_params.fillFrom(getDefaultStyle()); - - if (!style_params.font.isProvided()) - { - style_params.font = mDefaultFont; - } - if (!style_params.drop_shadow.isProvided()) - { - style_params.drop_shadow = mFontShadow; - } + style_params.fillFrom(getDefaultStyleParams()); S32 part = (S32)LLTextParser::WHOLE; if(mParseHTML) @@ -1536,13 +1531,7 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c LLStyle::Params link_params = style_params; link_params.color = match.getColor(); link_params.readonly_color = match.getColor(); - // apply font name from requested style_params - std::string font_name = LLFontGL::nameFromFont(style_params.font()); - std::string font_size = LLFontGL::sizeFromFont(style_params.font()); - link_params.font.name(font_name); - link_params.font.size(font_size); link_params.font.style("UNDERLINE"); - link_params.link_href = match.getUrl(); // output the text before the Url @@ -1611,9 +1600,9 @@ void LLTextBase::appendText(const std::string &new_text, bool prepend_newline, c } } -void LLTextBase::appendAndHighlightText(const std::string &new_text, bool prepend_newline, S32 highlight_part, const LLStyle::Params& stylep) +void LLTextBase::appendAndHighlightText(const std::string &new_text, bool prepend_newline, S32 highlight_part, const LLStyle::Params& style_params) { - if (new_text.empty()) return; + if (new_text.empty()) return; // Save old state S32 selection_start = mSelectionStart; @@ -1631,7 +1620,7 @@ void LLTextBase::appendAndHighlightText(const std::string &new_text, bool prepen if (mParseHighlights && highlight) { - LLStyle::Params highlight_params = stylep; + LLStyle::Params highlight_params(style_params); LLSD pieces = highlight->parsePartialLineHighlights(new_text, highlight_params.color(), (LLTextParser::EHighlightPosition)highlight_part); for (S32 i = 0; i < pieces.size(); i++) @@ -1651,7 +1640,7 @@ void LLTextBase::appendAndHighlightText(const std::string &new_text, bool prepen wide_text = utf8str_to_wstring(pieces[i]["text"].asString()); } S32 cur_length = getLength(); - LLTextSegmentPtr segmentp = new LLNormalTextSegment(new LLStyle(highlight_params), cur_length, cur_length + wide_text.size(), *this); + LLTextSegmentPtr segmentp = new LLNormalTextSegment(LLStyleConstSP(new LLStyle(highlight_params)), cur_length, cur_length + wide_text.size(), *this); segment_vec_t segments; segments.push_back(segmentp); insertStringNoUndo(cur_length, wide_text, &segments); @@ -1675,7 +1664,7 @@ void LLTextBase::appendAndHighlightText(const std::string &new_text, bool prepen segment_vec_t segments; S32 segment_start = old_length; S32 segment_end = old_length + wide_text.size(); - segments.push_back(new LLNormalTextSegment(new LLStyle(stylep), segment_start, segment_end, *this )); + segments.push_back(new LLNormalTextSegment(LLStyleConstSP(new LLStyle(style_params)), segment_start, segment_end, *this )); insertStringNoUndo(getLength(), wide_text, &segments); } @@ -1719,7 +1708,7 @@ void LLTextBase::replaceUrlLabel(const std::string &url, for (it = mSegments.begin(); it != mSegments.end(); ++it) { LLTextSegment *seg = *it; - const LLStyleSP style = seg->getStyle(); + LLStyleConstSP style = seg->getStyle(); // update segment start/end length in case we replaced text earlier S32 seg_length = seg->getEnd() - seg->getStart(); @@ -2212,9 +2201,9 @@ bool LLTextSegment::canEdit() const { return false; } void LLTextSegment::unlinkFromDocument(LLTextBase*) {} void LLTextSegment::linkToDocument(LLTextBase*) {} const LLColor4& LLTextSegment::getColor() const { return LLColor4::white; } -void LLTextSegment::setColor(const LLColor4 &color) {} -const LLStyleSP LLTextSegment::getStyle() const {static LLStyleSP sp(new LLStyle()); return sp; } -void LLTextSegment::setStyle(const LLStyleSP &style) {} +//void LLTextSegment::setColor(const LLColor4 &color) {} +LLStyleConstSP LLTextSegment::getStyle() const {static LLStyleConstSP sp(new LLStyle()); return sp; } +void LLTextSegment::setStyle(LLStyleConstSP &style) {} void LLTextSegment::setToken( LLKeywordToken* token ) {} LLKeywordToken* LLTextSegment::getToken() const { return NULL; } void LLTextSegment::setToolTip( const std::string &msg ) {} @@ -2239,7 +2228,7 @@ BOOL LLTextSegment::hasMouseCapture() { return FALSE; } // LLNormalTextSegment // -LLNormalTextSegment::LLNormalTextSegment( const LLStyleSP& style, S32 start, S32 end, LLTextBase& editor ) +LLNormalTextSegment::LLNormalTextSegment( LLStyleConstSP& style, S32 start, S32 end, LLTextBase& editor ) : LLTextSegment(start, end), mStyle( style ), mToken(NULL), diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 038b9eaa62..5526667166 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -184,7 +184,6 @@ public: bool scrolledToEnd(); const LLFontGL* getDefaultFont() const { return mDefaultFont; } - LLStyle::Params getDefaultStyle(); public: // Fired when a URL link is clicked @@ -281,7 +280,8 @@ protected: void createDefaultSegment(); virtual void updateSegments(); void insertSegment(LLTextSegmentPtr segment_to_insert); - + LLStyle::Params getDefaultStyleParams(); + // manage lines S32 getLineStart( S32 line ) const; S32 getLineEnd( S32 line ) const; @@ -388,9 +388,9 @@ public: virtual void linkToDocument(class LLTextBase* editor); virtual const LLColor4& getColor() const; - virtual void setColor(const LLColor4 &color); - virtual const LLStyleSP getStyle() const; - virtual void setStyle(const LLStyleSP &style); + //virtual void setColor(const LLColor4 &color); + virtual LLStyleConstSP getStyle() const; + virtual void setStyle(LLStyleConstSP &style); virtual void setToken( LLKeywordToken* token ); virtual LLKeywordToken* getToken() const; virtual void setToolTip(const std::string& tooltip); @@ -426,7 +426,7 @@ protected: class LLNormalTextSegment : public LLTextSegment { public: - LLNormalTextSegment( const LLStyleSP& style, S32 start, S32 end, LLTextBase& editor ); + LLNormalTextSegment( LLStyleConstSP& style, S32 start, S32 end, LLTextBase& editor ); LLNormalTextSegment( const LLColor4& color, S32 start, S32 end, LLTextBase& editor, BOOL is_visible = TRUE); ~LLNormalTextSegment(); @@ -436,9 +436,8 @@ public: /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect); /*virtual*/ bool canEdit() const { return true; } /*virtual*/ const LLColor4& getColor() const { return mStyle->getColor(); } - /*virtual*/ void setColor(const LLColor4 &color) { mStyle->setColor(color); } - /*virtual*/ const LLStyleSP getStyle() const { return mStyle; } - /*virtual*/ void setStyle(const LLStyleSP &style) { mStyle = style; } + /*virtual*/ LLStyleConstSP getStyle() const { return mStyle; } + /*virtual*/ void setStyle(LLStyleConstSP &style) { mStyle = style; } /*virtual*/ void setToken( LLKeywordToken* token ) { mToken = token; } /*virtual*/ LLKeywordToken* getToken() const { return mToken; } /*virtual*/ BOOL getToolTip( std::string& msg ) const; @@ -456,7 +455,7 @@ protected: protected: class LLTextBase& mEditor; - LLStyleSP mStyle; + LLStyleConstSP mStyle; S32 mFontHeight; LLKeywordToken* mToken; std::string mTooltip; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index f2c3879a6c..93ce7a4bea 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2390,7 +2390,7 @@ void LLTextEditor::replaceUrlLabel(const std::string &url, for (it = mSegments.begin(); it != mSegments.end(); ++it) { LLTextSegment *seg = *it; - const LLStyleSP style = seg->getStyle(); + LLStyleConstSP style = seg->getStyle(); // update segment start/end length in case we replaced text earlier S32 seg_length = seg->getEnd() - seg->getStart(); @@ -2559,13 +2559,15 @@ void LLTextEditor::updateLinkSegments() // if the link's label (what the user can edit) is a valid Url, // then update the link's HREF to be the same as the label text. // This lets users edit Urls in-place. - LLStyleSP style = static_cast(segment->getStyle()); + LLStyleConstSP style = segment->getStyle(); + LLStyle* new_style = new LLStyle(*style); LLWString url_label = wtext.substr(segment->getStart(), segment->getEnd()-segment->getStart()); if (LLUrlRegistry::instance().hasUrl(url_label)) { std::string new_url = wstring_to_utf8str(url_label); LLStringUtil::trim(new_url); - style->setLinkHREF(new_url); + new_style->setLinkHREF(new_url); + segment->setStyle(LLStyleConstSP(new_style)); } } } diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index d0ed3b6fca..76f07373b4 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1911,10 +1911,10 @@ namespace LLInitParam void TypedParam::setBlockFromValue() { LLColor4 color = mData.mValue.get(); - red = color.mV[VRED]; - green = color.mV[VGREEN]; - blue = color.mV[VBLUE]; - alpha = color.mV[VALPHA]; + red.set(color.mV[VRED], false); + green.set(color.mV[VGREEN], false); + blue.set(color.mV[VBLUE], false); + alpha.set(color.mV[VALPHA], false); control.set("", false); } @@ -1965,9 +1965,9 @@ namespace LLInitParam { if (mData.mValue) { - name = LLFontGL::nameFromFont(mData.mValue); - size = LLFontGL::sizeFromFont(mData.mValue); - style = LLFontGL::getStringFromStyle(mData.mValue->getFontDesc().getStyle()); + name.set(LLFontGL::nameFromFont(mData.mValue), false); + size.set(LLFontGL::sizeFromFont(mData.mValue), false); + style.set(LLFontGL::getStringFromStyle(mData.mValue->getFontDesc().getStyle()), false); } } @@ -2073,8 +2073,8 @@ namespace LLInitParam void TypedParam::setBlockFromValue() { - x = mData.mValue.mX; - y = mData.mValue.mY; + x.set(mData.mValue.mX, false); + y.set(mData.mValue.mY, false); } diff --git a/indra/llui/lluicolortable.h b/indra/llui/lluicolortable.h index 59be0c4f9a..c87695f456 100644 --- a/indra/llui/lluicolortable.h +++ b/indra/llui/lluicolortable.h @@ -94,7 +94,7 @@ private: bool loadFromFilename(const std::string& filename); // consider using sorted vector, can be much faster - typedef std::map string_color_map_t; + typedef std::map string_color_map_t; void clearTable(string_color_map_t& table); void setColor(const std::string& name, const LLColor4& color, string_color_map_t& table); diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index 966d919dc7..8cd6460b66 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -182,11 +182,11 @@ namespace LLInitParam { if (mData.mValue == NULL) { - name = "none"; + name.set("none", false); } else { - name = mData.mValue->getName(); + name.set(mData.mValue->getName(), false); } } diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp index 4c050844f8..424a9fae8e 100644 --- a/indra/llxuixml/llinitparam.cpp +++ b/indra/llxuixml/llinitparam.cpp @@ -84,8 +84,7 @@ namespace LLInitParam // BaseBlock // BaseBlock::BaseBlock() - : mLastChangedParam(0), - mChangeVersion(0) + : mChangeVersion(0) {} BaseBlock::~BaseBlock() @@ -347,7 +346,6 @@ namespace LLInitParam if (deserialize_func && deserialize_func(*paramp, p, name_stack, name_stack.first == name_stack.second ? -1 : name_stack.first->second)) { - mLastChangedParam = (*it)->mParamHandle; return true; } } @@ -416,8 +414,10 @@ namespace LLInitParam void BaseBlock::setLastChangedParam(const Param& last_param, bool user_provided) { - mLastChangedParam = getHandleFromParam(&last_param); - mChangeVersion++; + if (user_provided) + { + mChangeVersion++; + } } const std::string& BaseBlock::getParamName(const BlockDescriptor& block_data, const Param* paramp) const @@ -471,7 +471,6 @@ namespace LLInitParam { Param* paramp = getParamFromHandle(it->mParamHandle); param_changed |= merge_func(*paramp, *other_paramp, true); - mLastChangedParam = it->mParamHandle; } } return param_changed; @@ -492,7 +491,6 @@ namespace LLInitParam { Param* paramp = getParamFromHandle(it->mParamHandle); param_changed |= merge_func(*paramp, *other_paramp, false); - mLastChangedParam = it->mParamHandle; } } return param_changed; diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 7e1e4a3d21..529fae18c0 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -470,7 +470,6 @@ namespace LLInitParam // Blocks can override this to do custom tracking of changes virtual void setLastChangedParam(const Param& last_param, bool user_provided); - const Param* getLastChangedParam() const { return mLastChangedParam ? getParamFromHandle(mLastChangedParam) : NULL; } S32 getLastChangeVersion() const { return mChangeVersion; } bool isDefault() const { return mChangeVersion == 0; } @@ -505,7 +504,6 @@ namespace LLInitParam bool fillFromImpl(BlockDescriptor& block_data, const BaseBlock& other); // can be updated in getters - mutable param_handle_t mLastChangedParam; mutable S32 mChangeVersion; BlockDescriptor* mBlockDescriptor; // most derived block descriptor @@ -1732,6 +1730,7 @@ namespace LLInitParam void set(value_assignment_t val, bool flag_as_provided = true) { Param::enclosingBlock().setLastChangedParam(*this, flag_as_provided); + // set param version number to be up to date, so we ignore block contents mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); diff --git a/indra/llxuixml/lluicolor.cpp b/indra/llxuixml/lluicolor.cpp index 424d878a6b..0049ec055c 100644 --- a/indra/llxuixml/lluicolor.cpp +++ b/indra/llxuixml/lluicolor.cpp @@ -16,13 +16,15 @@ LLUIColor::LLUIColor() { } -LLUIColor::LLUIColor(const LLColor4* color) - :mColorPtr(color) + +LLUIColor::LLUIColor(const LLColor4& color) +: mColor(color), + mColorPtr(NULL) { } -LLUIColor::LLUIColor(const LLColor4& color) - :mColor(color), mColorPtr(NULL) +LLUIColor::LLUIColor(const LLUIColor* color) +: mColorPtr(color) { } @@ -32,14 +34,14 @@ void LLUIColor::set(const LLColor4& color) mColorPtr = NULL; } -void LLUIColor::set(const LLColor4* color) +void LLUIColor::set(const LLUIColor* color) { mColorPtr = color; } const LLColor4& LLUIColor::get() const { - return (mColorPtr == NULL ? mColor : *mColorPtr); + return (mColorPtr == NULL ? mColor : mColorPtr->get()); } LLUIColor::operator const LLColor4& () const diff --git a/indra/llxuixml/lluicolor.h b/indra/llxuixml/lluicolor.h index bb0f786326..0ef2f78b24 100644 --- a/indra/llxuixml/lluicolor.h +++ b/indra/llxuixml/lluicolor.h @@ -22,11 +22,11 @@ class LLUIColor { public: LLUIColor(); - LLUIColor(const LLColor4* color); LLUIColor(const LLColor4& color); + LLUIColor(const LLUIColor* color); void set(const LLColor4& color); - void set(const LLColor4* color); + void set(const LLUIColor* color); const LLColor4& get() const; @@ -38,7 +38,7 @@ public: private: friend struct LLInitParam::ParamCompare; - const LLColor4* mColorPtr; + const LLUIColor* mColorPtr; LLColor4 mColor; }; @@ -47,7 +47,7 @@ namespace LLInitParam template<> struct ParamCompare { - static bool equals(const class LLUIColor& a, const class LLUIColor& b); + static bool equals(const LLUIColor& a, const LLUIColor& b); }; } diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index a58a562378..aeed4fee08 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -57,11 +57,11 @@ public: struct Params : public LLInitParam::Block { - Optional ignore_online_status; // show all items as online - Optional show_last_interaction_time; // show most recent interaction time. *HACK: move this to a derived class - Optional show_info_btn; - Optional show_profile_btn; - Optional show_speaking_indicator; + Optional ignore_online_status, // show all items as online + show_last_interaction_time, // show most recent interaction time. *HACK: move this to a derived class + show_info_btn, + show_profile_btn, + show_speaking_indicator; Params(); }; diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 66ab32f3e8..26a39532dd 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -48,6 +48,17 @@ S32 LLAvatarListItem::sLeftPadding = 0; S32 LLAvatarListItem::sRightNamePadding = 0; S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT]; +static LLWidgetNameRegistry::StaticRegistrar sRegisterAvatarListItemParams(&typeid(LLAvatarListItem::Params), "avatar_list_item"); + +LLAvatarListItem::Params::Params() +: default_style("default_style"), + voice_call_invited_style("voice_call_invited_style"), + voice_call_joined_style("voice_call_joined_style"), + voice_call_left_style("voice_call_left_style"), + online_style("online_style"), + offline_style("offline_style") +{}; + LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) : LLPanel(), @@ -166,9 +177,30 @@ void LLAvatarListItem::setHighlight(const std::string& highlight) void LLAvatarListItem::setState(EItemState item_style) { - item_style_map_t& item_styles_params_map = getItemStylesParams(); + const LLAvatarListItem::Params& params = LLUICtrlFactory::getDefaultParams(); - mAvatarNameStyle = item_styles_params_map[item_style]; + switch(item_style) + { + default: + case IS_DEFAULT: + mAvatarNameStyle = params.default_style(); + break; + case IS_VOICE_INVITED: + mAvatarNameStyle = params.voice_call_invited_style(); + break; + case IS_VOICE_JOINED: + mAvatarNameStyle = params.voice_call_joined_style(); + break; + case IS_VOICE_LEFT: + mAvatarNameStyle = params.voice_call_left_style(); + break; + case IS_ONLINE: + mAvatarNameStyle = params.online_style(); + break; + case IS_OFFLINE: + mAvatarNameStyle = params.offline_style(); + break; + } // *NOTE: You cannot set the style on a text box anymore, you must // rebuild the text. This will cause problems if the text contains @@ -352,58 +384,6 @@ std::string LLAvatarListItem::formatSeconds(U32 secs) return getString(fmt, args); } -// static -LLAvatarListItem::item_style_map_t& LLAvatarListItem::getItemStylesParams() -{ - static item_style_map_t item_styles_params_map; - if (!item_styles_params_map.empty()) return item_styles_params_map; - - LLPanel::Params params = LLUICtrlFactory::getDefaultParams(); - LLPanel* params_panel = LLUICtrlFactory::create(params); - - BOOL sucsess = LLUICtrlFactory::instance().buildPanel(params_panel, "panel_avatar_list_item_params.xml"); - - if (sucsess) - { - - item_styles_params_map.insert( - std::make_pair(IS_DEFAULT, - params_panel->getChild("default_style")->getDefaultStyle())); - - item_styles_params_map.insert( - std::make_pair(IS_VOICE_INVITED, - params_panel->getChild("voice_call_invited_style")->getDefaultStyle())); - - item_styles_params_map.insert( - std::make_pair(IS_VOICE_JOINED, - params_panel->getChild("voice_call_joined_style")->getDefaultStyle())); - - item_styles_params_map.insert( - std::make_pair(IS_VOICE_LEFT, - params_panel->getChild("voice_call_left_style")->getDefaultStyle())); - - item_styles_params_map.insert( - std::make_pair(IS_ONLINE, - params_panel->getChild("online_style")->getDefaultStyle())); - - item_styles_params_map.insert( - std::make_pair(IS_OFFLINE, - params_panel->getChild("offline_style")->getDefaultStyle())); - } - else - { - item_styles_params_map.insert(std::make_pair(IS_DEFAULT, LLStyle::Params())); - item_styles_params_map.insert(std::make_pair(IS_VOICE_INVITED, LLStyle::Params())); - item_styles_params_map.insert(std::make_pair(IS_VOICE_JOINED, LLStyle::Params())); - item_styles_params_map.insert(std::make_pair(IS_VOICE_LEFT, LLStyle::Params())); - item_styles_params_map.insert(std::make_pair(IS_ONLINE, LLStyle::Params())); - item_styles_params_map.insert(std::make_pair(IS_OFFLINE, LLStyle::Params())); - } - if (params_panel) params_panel->die(); - - return item_styles_params_map; -} - // static LLAvatarListItem::icon_color_map_t& LLAvatarListItem::getItemIconColorMap() { diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index 479a4833cb..9f81aa0804 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -46,6 +46,18 @@ class LLAvatarIconCtrl; class LLAvatarListItem : public LLPanel, public LLFriendObserver { public: + struct Params : public LLInitParam::Block + { + Optional default_style, + voice_call_invited_style, + voice_call_joined_style, + voice_call_left_style, + online_style, + offline_style; + + Params(); + }; + typedef enum e_item_state_type { IS_DEFAULT, IS_VOICE_INVITED, @@ -143,9 +155,6 @@ private: std::string formatSeconds(U32 secs); - typedef std::map item_style_map_t; - static item_style_map_t& getItemStylesParams(); - typedef std::map icon_color_map_t; static icon_color_map_t& getItemIconColorMap(); diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 9f6412c0ab..77b3a48cef 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -169,8 +169,7 @@ void LLExpandableTextBox::LLTextBoxEx::showExpandText() std::pair visible_lines = getVisibleLines(true); S32 last_line = visible_lines.second - 1; - LLStyle::Params expander_style = getDefaultStyle(); - expander_style.font.name(LLFontGL::nameFromFont(expander_style.font)); + LLStyle::Params expander_style(getDefaultStyleParams()); expander_style.font.style = "UNDERLINE"; expander_style.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); LLExpanderSegment* expanderp = new LLExpanderSegment(new LLStyle(expander_style), getLineStart(last_line), getLength() + 1, mExpanderLabel, *this); @@ -186,8 +185,7 @@ void LLExpandableTextBox::LLTextBoxEx::hideExpandText() if (mExpanderVisible) { // this will overwrite the expander segment and all text styling with a single style - LLNormalTextSegment* segmentp = new LLNormalTextSegment( - new LLStyle(getDefaultStyle()), 0, getLength() + 1, *this); + LLNormalTextSegment* segmentp = new LLNormalTextSegment(LLStyleConstSP(new LLStyle(getDefaultStyleParams())), 0, getLength() + 1, *this); insertSegment(segmentp); mExpanderVisible = false; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 300aea1620..94c257fe8c 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -247,7 +247,7 @@ public: return FALSE; } - /*virtual*/ const LLStyleSP getStyle() const { return mStyle; } + /*virtual*/ LLStyleConstSP getStyle() const { return mStyle; } private: LLUIImagePtr mImage; diff --git a/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml new file mode 100644 index 0000000000..1a9a882c7b --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 955c0cc5a9ab8fb9eda7a6c20cd7bd09c2fd9369 Mon Sep 17 00:00:00 2001 From: richard Date: Fri, 22 Jan 2010 17:17:12 -0800 Subject: wrong param names for avatar list item colors reviewed by Rick --- .../skins/default/xui/en/widgets/avatar_list_item.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml index 1a9a882c7b..ed8df69bf4 100644 --- a/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/widgets/avatar_list_item.xml @@ -10,35 +10,35 @@ + color="DkGray"/> + color="0.5 0.5 0.5 0.5"/> + color="white"/> + color="LtGray_50"/> + color="white"/> + color="0.5 0.5 0.5 1.0"/> -- cgit v1.2.3 From ae9449bff10d8c2247ae28044af50870c6a782eb Mon Sep 17 00:00:00 2001 From: Erica Date: Fri, 22 Jan 2010 23:04:59 -0800 Subject: Group profile layout now resizes with the viewer window. Gave extra room to each accordion panel, and tweaked the layout a bit. --- .../skins/default/xui/en/panel_group_general.xml | 87 +++++--- .../default/xui/en/panel_group_info_sidetray.xml | 163 ++++++++------ .../default/xui/en/panel_group_land_money.xml | 104 ++++----- .../skins/default/xui/en/panel_group_notices.xml | 82 +++---- .../skins/default/xui/en/panel_group_roles.xml | 247 ++++++++++++--------- .../skins/default/xui/en/panel_side_tray.xml | 2 +- 6 files changed, 395 insertions(+), 290 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index af73faf9a1..96185bad56 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -1,12 +1,11 @@ + name="general_tab"> The General tab contains general information about this group, a list of members, general Group Preferences and member options. @@ -25,12 +24,14 @@ Hover your mouse over the options for more help. type="string" follows="left|top|right" left="5" - height="60" + height="150" layout="topleft" max_length="511" name="charter" top="5" right="-1" + bg_readonly_color="DkGray2" + text_readonly_color="White" word_wrap="true"> Group Charter @@ -38,8 +39,8 @@ Hover your mouse over the options for more help. column_padding="0" draw_heading="true" follows="left|top|right" - heading_height="20" - height="156" + heading_height="23" + height="200" layout="topleft" left="0" right="-1" @@ -60,17 +61,29 @@ Hover your mouse over the options for more help. height="12" layout="left|top|right" left="5" + text_color="EmphasisColor" + name="my_group_settngs_label" + top_pad="10" + width="300"> + Me + + - My Title + My title: @@ -79,7 +92,7 @@ Hover your mouse over the options for more help. font="SansSerifSmall" label="Receive group notices" layout="topleft" - left="5" + left="10" name="receive_notices" tool_tip="Sets whether you want to receive Notices from this group. Uncheck this box if this group is spamming you." top_pad="5" @@ -88,36 +101,46 @@ Hover your mouse over the options for more help. height="16" label="Show in my profile" layout="topleft" - left="5" + left="10" name="list_groups_in_profile" tool_tip="Sets whether you want to show this group in your profile" top_pad="5" width="295" /> - + top_pad="5"> + + Group + - + + diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index 673052c3b5..4e017819c1 100644 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -2,17 +2,17 @@ + width="313"> - There are unsaved changes to the current tab + There are unsaved changes @@ -26,6 +26,14 @@ background_visible="true" name="group_join_free"> Free + + -