diff options
41 files changed, 209 insertions, 195 deletions
diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index db1f019a81..7ad5f9608f 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -761,6 +761,29 @@ U8 LLFontGL::getStyleFromString(const std::string &style) } // static +std::string LLFontGL::getStringFromStyle(U8 style) +{ + std::string style_string; + if (style & NORMAL) + { + style_string += "|NORMAL"; + } + if (style & BOLD) + { + style_string += "|BOLD"; + } + if (style & ITALIC) + { + style_string += "|ITALIC"; + } + if (style & UNDERLINE) + { + style_string += "|UNDERLINE"; + } + return style_string; +} + +// static std::string LLFontGL::nameFromFont(const LLFontGL* fontp) { return fontp->mFontDescriptor.getName(); diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index bb7d8524e7..ea8eee7690 100644 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h @@ -144,6 +144,7 @@ public: // Takes a string with potentially several flags, i.e. "NORMAL|BOLD|ITALIC" static U8 getStyleFromString(const std::string &style); + static std::string getStringFromStyle(U8 style); static std::string nameFromFont(const LLFontGL* fontp); static std::string sizeFromFont(const LLFontGL* fontp); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 5fd707fea3..f7fd2dbdfe 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2716,6 +2716,7 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o params.rect.left.set(0); } + params.from_xui = true; setupParams(params, parent); initFromParams(params); diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 1fb618adee..5e15fa3919 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -246,6 +246,7 @@ LLView* LLLayoutStack::fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o output_node, output_params, &default_params); } + p.from_xui = true; setupParams(p, parent); LLLayoutStack* layout_stackp = LLUICtrlFactory::create<LLLayoutStack>(p); diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index abd5436018..c1af428674 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -45,9 +45,8 @@ public: { Optional<std::string> orientation; Optional<S32> border_size; - Optional<bool> animate; - Optional<bool> clip; - // mMinWidth and mMinHeight are calculated, not set in XML + Optional<bool> animate, + clip; Params(); }; diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index de2b43bf13..738a96f730 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -541,6 +541,7 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu output_node, output_params, &default_params); } + params.from_xui = true; setupParams(params, parent); { LLFastTimer timer(FTM_PANEL_CONSTRUCTION); diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index 74e30cd633..997b9c13f8 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -112,6 +112,7 @@ void LLRadioGroup::initFromParams(const Params& p) ++it) { LLRadioGroup::ItemParams item_params(*it); + item_params.font.setIfNotProvided(mFont); // apply radio group font by default item_params.commit_callback.function = boost::bind(&LLRadioGroup::onClickButton, this, _1); item_params.from_xui = p.from_xui; @@ -332,7 +333,7 @@ void LLRadioGroup::setValue( const LLSD& value ) iter != mRadioButtons.end(); ++iter) { LLRadioCtrl* radio = *iter; - if (llsd_equals(radio->getPayload(), value)) + if (radio->getPayload().asString() == value.asString()) { setSelectedIndex(idx); idx = -1; @@ -384,7 +385,7 @@ BOOL LLRadioGroup::setSelectedByValue(const LLSD& value, BOOL selected) for (button_list_t::const_iterator iter = mRadioButtons.begin(); iter != mRadioButtons.end(); ++iter) { - if(llsd_equals((*iter)->getPayload(), value)) + if((*iter)->getPayload().asString() == value.asString()) { setSelectedIndex(idx); return TRUE; @@ -406,7 +407,7 @@ BOOL LLRadioGroup::isSelected(const LLSD& value) const for (button_list_t::const_iterator iter = mRadioButtons.begin(); iter != mRadioButtons.end(); ++iter) { - if(llsd_equals((*iter)->getPayload(), value)) + if((*iter)->getPayload().asString() == value.asString()) { if (idx == mSelectedIndex) { diff --git a/indra/llui/llradiogroup.h b/indra/llui/llradiogroup.h index 2edfd7c2ca..b178bb36ca 100644 --- a/indra/llui/llradiogroup.h +++ b/indra/llui/llradiogroup.h @@ -56,7 +56,7 @@ public: struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { Optional<bool> has_border; - Multiple<ItemParams, LLInitParam::AtLeast<1> > items; + Multiple<ItemParams, AtLeast<1> > items; Params(); }; diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h index bd2d595174..714aca9337 100644 --- a/indra/llui/llsearcheditor.h +++ b/indra/llui/llsearcheditor.h @@ -50,15 +50,17 @@ class LLSearchEditor : public LLUICtrl public: struct Params : public LLInitParam::Block<Params, LLLineEditor::Params> { - Optional<LLButton::Params> search_button, clear_button; - Optional<bool> search_button_visible, clear_button_visible; + Optional<LLButton::Params> search_button, + clear_button; + Optional<bool> search_button_visible, + clear_button_visible; Optional<commit_callback_t> keystroke_callback; Params() - : search_button("search_button") - , search_button_visible("search_button_visible") - , clear_button("clear_button") - , clear_button_visible("clear_button_visible") + : search_button("search_button"), + search_button_visible("search_button_visible"), + clear_button("clear_button"), + clear_button_visible("clear_button_visible") { name = "search_editor"; } diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 6c983fd92e..cb0907a771 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -1137,9 +1137,12 @@ void LLTextBase::reflow(S32 start_index) // grow line height as necessary based on reported height of this segment line_height = llmax(line_height, segment_height); remaining_pixels -= segment_width; + if (remaining_pixels < 0) + { + // getNumChars() and getDimensions() should return consistent results + remaining_pixels = 0; + } - // getNumChars() and getDimensions() should return consistent results - llassert_always(remaining_pixels >= 0); seg_offset += character_count; S32 last_segment_char_on_line = segment->getStart() + seg_offset; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 6603887905..1ea6b66a93 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1896,17 +1896,26 @@ namespace LLInitParam control("") {} - LLUIColor TypedParam<LLUIColor>::getValueFromBlock() const + void TypedParam<LLUIColor>::setValueFromBlock() const { if (control.isProvided()) { - return LLUIColorTable::instance().getColor(control); + mData.mValue = LLUIColorTable::instance().getColor(control); } else { - return LLColor4(red, green, blue, alpha); + mData.mValue = LLColor4(red, green, blue, alpha); } } + + void TypedParam<LLUIColor>::setBlockFromValue() + { + LLColor4 color = mData.mValue.get(); + red = color.mV[VRED]; + green = color.mV[VGREEN]; + blue = color.mV[VBLUE]; + alpha = color.mV[VALPHA]; + } void TypeValues<LLUIColor>::declareValues() { @@ -1932,28 +1941,33 @@ namespace LLInitParam addSynonym(name, ""); } - const LLFontGL* TypedParam<const LLFontGL*>::getValueFromBlock() const + void TypedParam<const LLFontGL*>::setValueFromBlock() const { - if (name.isProvided()) + const LLFontGL* res_fontp = LLFontGL::getFontByName(name); + if (res_fontp) { - const LLFontGL* res_fontp = LLFontGL::getFontByName(name); - if (res_fontp) - { - return res_fontp; - } + mData.mValue = res_fontp; + return; + } - U8 fontstyle = 0; - fontstyle = LLFontGL::getStyleFromString(style()); - LLFontDescriptor desc(name(), size(), fontstyle); - const LLFontGL* fontp = LLFontGL::getFont(desc); - if (fontp) - { - return fontp; - } + U8 fontstyle = 0; + fontstyle = LLFontGL::getStyleFromString(style()); + LLFontDescriptor desc(name(), size(), fontstyle); + const LLFontGL* fontp = LLFontGL::getFont(desc); + if (fontp) + { + mData.mValue = fontp; + } + } + + void TypedParam<const LLFontGL*>::setBlockFromValue() + { + if (mData.mValue) + { + name = LLFontGL::nameFromFont(mData.mValue); + size = LLFontGL::sizeFromFont(mData.mValue); + style = LLFontGL::getStringFromStyle(mData.mValue->getFontDesc().getStyle()); } - - // default to current value - return mData.mValue; } TypedParam<LLRect>::TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) @@ -1966,7 +1980,7 @@ namespace LLInitParam height("height") {} - LLRect TypedParam<LLRect>::getValueFromBlock() const + void TypedParam<LLRect>::setValueFromBlock() const { LLRect rect; @@ -2027,7 +2041,17 @@ namespace LLInitParam rect.mBottom = bottom; rect.mTop = top; } - return rect; + mData.mValue = rect; + } + + void TypedParam<LLRect>::setBlockFromValue() + { + left = mData.mValue.mLeft; + right = mData.mValue.mRight; + bottom = mData.mValue.mBottom; + top = mData.mValue.mTop; + width.setProvided(false); + height.setProvided(false); } TypedParam<LLCoordGL>::TypedParam(BlockDescriptor& descriptor, const char* name, LLCoordGL value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count) @@ -2037,9 +2061,15 @@ namespace LLInitParam { } - LLCoordGL TypedParam<LLCoordGL>::getValueFromBlock() const + void TypedParam<LLCoordGL>::setValueFromBlock() const + { + mData.mValue.set(x, y); + } + + void TypedParam<LLCoordGL>::setBlockFromValue() { - return LLCoordGL(x, y); + x = mData.mValue.mX; + y = mData.mValue.mY; } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index 5ec07f1941..5840e76f5c 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -379,7 +379,8 @@ namespace LLInitParam TypedParam(BlockDescriptor& descriptor, const char* name, const LLRect& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); - LLRect getValueFromBlock() const; + void setValueFromBlock() const; + void setBlockFromValue(); }; template<> @@ -401,7 +402,8 @@ namespace LLInitParam Optional<std::string> control; TypedParam(BlockDescriptor& descriptor, const char* name, const LLUIColor& value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); - LLUIColor getValueFromBlock() const; + void setValueFromBlock() const; + void setBlockFromValue(); }; // provide a better default for Optional<const LLFontGL*> than NULL @@ -429,7 +431,8 @@ namespace LLInitParam style; TypedParam(BlockDescriptor& descriptor, const char* name, const LLFontGL* const value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); - const LLFontGL* getValueFromBlock() const; + void setValueFromBlock() const; + void setBlockFromValue(); }; template<> @@ -467,7 +470,8 @@ namespace LLInitParam y; TypedParam(BlockDescriptor& descriptor, const char* name, LLCoordGL value, ParamDescriptor::validation_func_t func, S32 min_count, S32 max_count); - LLCoordGL getValueFromBlock() const; + void setValueFromBlock() const; + void setBlockFromValue(); }; } diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index 53967e4963..27237800d4 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -105,9 +105,12 @@ void LLUICtrlFactory::loadWidgetTemplate(const std::string& widget_tag, LLInitPa } } +static LLFastTimer::DeclareTimer FTM_CREATE_CHILDREN("Create XUI Children"); + //static void LLUICtrlFactory::createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t& registry, LLXMLNodePtr output_node) { + LLFastTimer ft(FTM_CREATE_CHILDREN); if (node.isNull()) return; for (LLXMLNodePtr child_node = node->getFirstChild(); child_node.notNull(); child_node = child_node->getNextSibling()) @@ -452,4 +455,5 @@ dummy_widget_creator_func_t* LLUICtrlFactory::getDefaultWidgetFunc(const std::ty const std::string* LLUICtrlFactory::getWidgetTag(const std::type_info* widget_type) { return LLWidgetNameRegistry::instance().getValue(widget_type); -}
\ No newline at end of file +} + diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 60f5fe9e1c..6788f29ba9 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -182,11 +182,10 @@ public: template<typename T> static T* createWidget(typename T::Params& params, LLView* parent = NULL) { - // Apply layout transformations, usually munging rect - T::setupParams(params, parent); - T* widget = NULL; + T::setupParams(params, parent); + if (!params.validateBlock()) { llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; @@ -309,27 +308,9 @@ fail: output_node, output_params, &default_params); } + // Apply layout transformations, usually munging rect params.from_xui = true; - - if (!params.validateBlock()) - { - llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; - } - T* widget; - { - LLFastTimer timer(FTM_WIDGET_CONSTRUCTION); - widget = new T(params); - } - { - LLFastTimer timer(FTM_INIT_FROM_PARAMS); - widget->initFromParams(params); - } - - if (parent) - { - S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1; - setCtrlParent(widget, parent, tab_group); - } + T* widget = createWidget<T>(params, parent); typedef typename T::child_registry_t registry_t; diff --git a/indra/llui/lluiimage.cpp b/indra/llui/lluiimage.cpp index f941f391eb..1dfc281d93 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -161,22 +161,32 @@ void LLUIImage::onImageLoaded() namespace LLInitParam { - LLUIImage* TypedParam<LLUIImage*>::getValueFromBlock() const + void TypedParam<LLUIImage*>::setValueFromBlock() const { // The keyword "none" is specifically requesting a null image // do not default to current value. Used to overwrite template images. if (name() == "none") { - return NULL; + mData.mValue = NULL; } LLUIImage* imagep = LLUI::getUIImage(name()); - if (!imagep) + if (imagep) { - // default to current value - imagep = mData.mValue; + mData.mValue = imagep; + } + } + + void TypedParam<LLUIImage*>::setBlockFromValue() + { + if (mData.mValue == NULL) + { + name = "none"; + } + else + { + name = mData.mValue->getName(); } - return imagep; } diff --git a/indra/llui/lluiimage.h b/indra/llui/lluiimage.h index 5fa9610ab2..bdfc44262d 100644 --- a/indra/llui/lluiimage.h +++ b/indra/llui/lluiimage.h @@ -111,7 +111,8 @@ namespace LLInitParam { } - LLUIImage* getValueFromBlock() const; + void setValueFromBlock() const; + void setBlockFromValue(); }; // Need custom comparison function for our test app, which only loads diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 7932b749a8..a8d8626e49 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2501,6 +2501,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.layout = parent->getLayout(); } + if (parent) { LLRect parent_rect = parent->getLocalRect(); @@ -2508,7 +2509,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) LLRect last_rect = parent->getLocalRect(); bool layout_topleft = (p.layout() == "topleft"); - if (layout_topleft) + if (layout_topleft && p.from_xui) { //invert top to bottom if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top; @@ -2516,7 +2517,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) } // convert negative or centered coordinates to parent relative values - // Note: some of this logic matches the logic in TypedParam<LLRect>::getValueFromBlock() + // Note: some of this logic matches the logic in TypedParam<LLRect>::setValueFromBlock() if (p.center_horiz) { @@ -2534,7 +2535,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.rect.right.setProvided(false); // recalculate the right } } - else + else if (p.from_xui) // only do negative coordinate magic for XUI { if (p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth(); if (p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth(); @@ -2555,7 +2556,7 @@ void LLView::setupParams(LLView::Params& p, LLView* parent) p.rect.top.setProvided(false); // recalculate the top } } - else + else if (p.from_xui) { if (p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight(); if (p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight(); diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 493ddaa378..7e1e4a3d21 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -1,5 +1,5 @@ /** - * @file llinitparam.h +f * @file llinitparam.h * @brief parameter block abstraction for creating complex objects and * parsing construction parameters from xml and LLSD * @@ -405,6 +405,41 @@ namespace LLInitParam class BaseBlock { public: + // "Multiple" constraint types + struct AnyAmount + { + static U32 minCount() { return 0; } + static U32 maxCount() { return U32_MAX; } + }; + + template<U32 MIN_AMOUNT> + struct AtLeast + { + static U32 minCount() { return MIN_AMOUNT; } + static U32 maxCount() { return U32_MAX; } + }; + + template<U32 MAX_AMOUNT> + struct AtMost + { + static U32 minCount() { return 0; } + static U32 maxCount() { return MAX_AMOUNT; } + }; + + template<U32 MIN_AMOUNT, U32 MAX_AMOUNT> + struct Between + { + static U32 minCount() { return MIN_AMOUNT; } + static U32 maxCount() { return MAX_AMOUNT; } + }; + + template<U32 EXACT_COUNT> + struct Exactly + { + static U32 minCount() { return EXACT_COUNT; } + static U32 maxCount() { return EXACT_COUNT; } + }; + // this typedef identifies derived classes as being blocks typedef void baseblock_base_class_t; LOG_CLASS(BaseBlock); @@ -1365,40 +1400,6 @@ namespace LLInitParam } }; - struct AnyAmount - { - static U32 minCount() { return 0; } - static U32 maxCount() { return U32_MAX; } - }; - - template<U32 MIN_AMOUNT> - struct AtLeast - { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return U32_MAX; } - }; - - template<U32 MAX_AMOUNT> - struct AtMost - { - static U32 minCount() { return 0; } - static U32 maxCount() { return MAX_AMOUNT; } - }; - - template<U32 MIN_AMOUNT, U32 MAX_AMOUNT> - struct Between - { - static U32 minCount() { return MIN_AMOUNT; } - static U32 maxCount() { return MAX_AMOUNT; } - }; - - template<U32 EXACT_COUNT> - struct Exactly - { - static U32 minCount() { return EXACT_COUNT; } - static U32 maxCount() { return EXACT_COUNT; } - }; - template <typename DERIVED_BLOCK, typename BASE_BLOCK = BaseBlock> class Block : public BASE_BLOCK @@ -1491,7 +1492,7 @@ namespace LLInitParam }; - template <typename T, typename RANGE = AnyAmount, typename NAME_VALUE_LOOKUP = TypeValues<T> > + template <typename T, typename RANGE = BaseBlock::AnyAmount, typename NAME_VALUE_LOOKUP = TypeValues<T> > class Multiple : public TypedParam<T, NAME_VALUE_LOOKUP, true> { public: @@ -1711,7 +1712,7 @@ namespace LLInitParam { if (block_t::validateBlock(true)) { - mData.mValue = static_cast<const DERIVED*>(this)->getValueFromBlock(); + static_cast<const DERIVED*>(this)->setValueFromBlock(); // clear stale keyword associated with old value mData.clearKey(); mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); @@ -1737,6 +1738,7 @@ namespace LLInitParam mData.mValue = val; mData.clearKey(); setProvided(flag_as_provided); + static_cast<DERIVED*>(this)->setBlockFromValue(); } void setIfNotProvided(value_assignment_t val, bool flag_as_provided = true) @@ -1768,7 +1770,7 @@ namespace LLInitParam // go ahead and issue warnings at this point if any param is invalid if(block_t::validateBlock(false)) { - mData.mValue = static_cast<const DERIVED*>(this)->getValueFromBlock(); + static_cast<const DERIVED*>(this)->setValueFromBlock(); mData.clearKey(); mData.mLastParamVersion = BaseBlock::getLastChangeVersion(); } diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index 9e6ef2fc4d..60f150bd96 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -570,25 +570,12 @@ void LLFloaterAnimPreview::onBtnPlay(void* user_data) { previewp->resetMotion(); previewp->mPauseRequest = NULL; - previewp->mPauseButton->setVisible(TRUE); - previewp->mPauseButton->setEnabled(TRUE); - previewp->mPlayButton->setVisible(FALSE); - previewp->mPlayButton->setEnabled(FALSE); } else if (avatarp->areAnimationsPaused()) - { - + { previewp->mPauseRequest = NULL; - previewp->mPauseButton->setVisible(TRUE); - previewp->mPauseButton->setEnabled(TRUE); - previewp->mPlayButton->setVisible(FALSE); - previewp->mPlayButton->setEnabled(FALSE); } - } - - - } //----------------------------------------------------------------------------- @@ -609,16 +596,9 @@ void LLFloaterAnimPreview::onBtnPause(void* user_data) if (!avatarp->areAnimationsPaused()) { previewp->mPauseRequest = avatarp->requestPause(); - - previewp->mPlayButton->setVisible(TRUE); - previewp->mPlayButton->setEnabled(TRUE); - previewp->mPauseButton->setVisible(FALSE); - previewp->mPauseButton->setEnabled(FALSE); } } } - - } //----------------------------------------------------------------------------- @@ -636,10 +616,6 @@ void LLFloaterAnimPreview::onBtnStop(void* user_data) previewp->resetMotion(); previewp->mPauseRequest = avatarp->requestPause(); } - previewp->mPlayButton->setVisible(TRUE); - previewp->mPlayButton->setEnabled(TRUE); - previewp->mPauseButton->setVisible(FALSE); - previewp->mPauseButton->setEnabled(FALSE); } //----------------------------------------------------------------------------- @@ -953,18 +929,22 @@ bool LLFloaterAnimPreview::validateLoopOut(const LLSD& data) //----------------------------------------------------------------------------- void LLFloaterAnimPreview::refresh() { + // Are we showing the play button (default) or the pause button? + bool show_play = true; if (!mAnimPreview) { childShow("bad_animation_text"); + // play button visible but disabled mPlayButton->setEnabled(FALSE); - mPlayButton->setVisible(TRUE); - mPauseButton->setVisible(FALSE); mStopButton->setEnabled(FALSE); childDisable("ok_btn"); } else { childHide("bad_animation_text"); + // re-enabled in case previous animation was bad + mPlayButton->setEnabled(TRUE); + mStopButton->setEnabled(TRUE); LLVOAvatar* avatarp = mAnimPreview->getDummyAvatar(); if (avatarp->isMotionActive(mMotionID)) { @@ -972,28 +952,25 @@ void LLFloaterAnimPreview::refresh() LLKeyframeMotion* motionp = (LLKeyframeMotion*)avatarp->findMotion(mMotionID); if (!avatarp->areAnimationsPaused()) { + // animation is playing if (motionp) { F32 fraction_complete = motionp->getLastUpdateTime() / motionp->getDuration(); childSetValue("playback_slider", fraction_complete); } - - mPlayButton->setVisible(FALSE); - mPauseButton->setVisible(TRUE); - + show_play = false; } - } else { + // Motion just finished playing mPauseRequest = avatarp->requestPause(); - //mPlayButton->setVisible(TRUE); - //mPlayButton->setEnabled(TRUE); - mStopButton->setEnabled(TRUE); // stop also resets, leave enabled. } childEnable("ok_btn"); mAnimPreview->requestUpdate(); } + mPlayButton->setVisible(show_play); + mPauseButton->setVisible(!show_play); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 539673ab9e..73e7d99815 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1634,11 +1634,15 @@ bool idle_startup() gSavedSettings.setString("TutorialURL", tutorial_url.asString()); } - LLSD use_tutorial = (*it)["use_tutorial"]; - if(use_tutorial.asString() == "true") - { - show_hud = true; - } + // For Viewer 2.0 we are not using the web-based tutorial + // If we reverse that decision, put this code back and use + // login.cgi to send a different URL with content that matches + // the Viewer 2.0 UI. + //LLSD use_tutorial = (*it)["use_tutorial"]; + //if(use_tutorial.asString() == "true") + //{ + // show_hud = true; + //} } } // Either we want to show tutorial because this is the first login diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index c183333c3e..5302ef3a39 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -684,5 +684,7 @@ <color name="ChatToastAgentNameColor" reference="EmphasisColor" /> - + <color + name="ColorSwatchBorderColor" + value="0.45098 0.517647 0.607843 1"/> </colors> diff --git a/indra/newview/skins/default/xui/en/floater_customize.xml b/indra/newview/skins/default/xui/en/floater_customize.xml index 9d3694873e..fba1ec4440 100644 --- a/indra/newview/skins/default/xui/en/floater_customize.xml +++ b/indra/newview/skins/default/xui/en/floater_customize.xml @@ -1018,7 +1018,6 @@ scratch and wear it. top_pad="41" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" @@ -1224,7 +1223,6 @@ scratch and wear it. top_pad="41" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" @@ -1534,7 +1532,6 @@ scratch and wear it. top="65" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" @@ -1740,7 +1737,6 @@ scratch and wear it. top="65" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" @@ -1958,7 +1954,6 @@ scratch and wear it. top_delta="80" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" @@ -2164,7 +2159,6 @@ scratch and wear it. top="65" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" @@ -2370,7 +2364,6 @@ scratch and wear it. top="65" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" @@ -2576,7 +2569,6 @@ scratch and wear it. top="65" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" @@ -2782,7 +2774,6 @@ scratch and wear it. top="65" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/floater_env_settings.xml b/indra/newview/skins/default/xui/en/floater_env_settings.xml index 5e78037ee1..8c87bd42dd 100644 --- a/indra/newview/skins/default/xui/en/floater_env_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_env_settings.xml @@ -98,7 +98,6 @@ Water Color </text> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.5 0.5 0.5 1" follows="left|top" diff --git a/indra/newview/skins/default/xui/en/floater_test_widgets.xml b/indra/newview/skins/default/xui/en/floater_test_widgets.xml index a2055d8c52..84adabe4fa 100644 --- a/indra/newview/skins/default/xui/en/floater_test_widgets.xml +++ b/indra/newview/skins/default/xui/en/floater_test_widgets.xml @@ -355,7 +355,6 @@ line to actually fit <!-- "color_swatch" displays a color and spawns a color picker when clicked. --> <color_swatch - border_color="1 0 0 1" can_apply_immediately="true" color="0.3 0.6 0.9 1" follows="left|top" @@ -368,7 +367,6 @@ line to actually fit top="10" width="80" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="1 0 1 1" follows="left|top" diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 5e68850e30..1903434d33 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -2264,7 +2264,6 @@ even though the user gets a free copy. top="8" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/floater_water.xml b/indra/newview/skins/default/xui/en/floater_water.xml index 439d68282f..7f31692ad9 100644 --- a/indra/newview/skins/default/xui/en/floater_water.xml +++ b/indra/newview/skins/default/xui/en/floater_water.xml @@ -71,7 +71,6 @@ width="700"> <panel border="true" - border_color="EmphasisColor" follows="all" height="180" label="Settings" diff --git a/indra/newview/skins/default/xui/en/panel_edit_gloves.xml b/indra/newview/skins/default/xui/en/panel_edit_gloves.xml index f9ef038314..7aca40e8d9 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_gloves.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_gloves.xml @@ -29,7 +29,6 @@ top="10" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/panel_edit_jacket.xml b/indra/newview/skins/default/xui/en/panel_edit_jacket.xml index f4c03399fe..ed92b1e0f8 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_jacket.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_jacket.xml @@ -41,7 +41,6 @@ top="10" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/panel_edit_pants.xml b/indra/newview/skins/default/xui/en/panel_edit_pants.xml index ab105afd88..b764188e04 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pants.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pants.xml @@ -29,7 +29,6 @@ top="10" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/panel_edit_shirt.xml b/indra/newview/skins/default/xui/en/panel_edit_shirt.xml index 9a13dfa3c4..4b7235545f 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_shirt.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_shirt.xml @@ -29,7 +29,6 @@ top="10" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/panel_edit_shoes.xml b/indra/newview/skins/default/xui/en/panel_edit_shoes.xml index 154b9d959c..e886afa010 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_shoes.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_shoes.xml @@ -29,7 +29,6 @@ top="10" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/panel_edit_skirt.xml b/indra/newview/skins/default/xui/en/panel_edit_skirt.xml index d0f4d75444..6cccab1843 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_skirt.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_skirt.xml @@ -29,7 +29,6 @@ top="10" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/panel_edit_socks.xml b/indra/newview/skins/default/xui/en/panel_edit_socks.xml index acc6d482a7..fc7de00714 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_socks.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_socks.xml @@ -29,7 +29,6 @@ top="10" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/panel_edit_underpants.xml b/indra/newview/skins/default/xui/en/panel_edit_underpants.xml index 4f5c1c08b7..03e0bb70ef 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_underpants.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_underpants.xml @@ -29,7 +29,6 @@ top="10" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml b/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml index 715674e88b..20c56142fb 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_undershirt.xml @@ -29,7 +29,6 @@ top="10" width="64" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="80" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 405ff02836..426a2b1f9e 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -29,7 +29,6 @@ name="bubble_text_chat" width="150" /> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0 0 0 1" control_name="BackgroundChatColor" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index d0e325b04e..017c321767 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -46,7 +46,6 @@ width="125" /> </radio_group> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="47" @@ -76,7 +75,6 @@ Me </text> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" follows="left|top" height="47" @@ -106,7 +104,6 @@ Others </text> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.6 0.6 1 1" follows="left|top" @@ -138,7 +135,6 @@ IM </text> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.8 1 1 1" follows="left|top" @@ -170,7 +166,6 @@ System </text> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.82 0.82 0.99 1" follows="left|top" @@ -201,7 +196,6 @@ Errors </text> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.7 0.9 0.7 1" follows="left|top" @@ -232,7 +226,6 @@ Objects </text> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.7 0.9 0.7 1" follows="left|top" @@ -263,7 +256,6 @@ Owner </text> <color_swatch - border_color="0.45098 0.517647 0.607843 1" can_apply_immediately="true" color="0.6 0.6 1 1" follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 7c9256e69d..41bd7f3dcc 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -87,7 +87,7 @@ value="ja" /> </combo_box> <text - font="SanSerifSmall" + font="SansSerifSmall" type="string" length="1" follows="left|top" @@ -328,7 +328,6 @@ control_name="BusyModeResponse2" text_readonly_color="LabelDisabledColor" bg_writeable_color="LtGray" - border_color="DefaultHighlightLight" use_ellipses="false" bg_visible="false" border_visible="false" diff --git a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml index 178c890c61..bda88857ae 100644 --- a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml +++ b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <color_swatch alpha_background_image="color_swatch_alpha.tga" - border_color="DefaultHighlightLight" + border_color="ColorSwatchBorderColor" name="color_swatch"> <color_swatch.caption_text name="caption" font="SansSerifSmall" diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml index 0174782c5b..3368fa88ef 100644 --- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml +++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml @@ -5,7 +5,7 @@ label_pad_left - padding to the left of tab button labels --> <tab_container tab_min_width="60" tab_max_width="150" - font_halign="center" + halign="center" font="SansSerifSmall" tab_height="21" label_pad_bottom="2" diff --git a/indra/newview/skins/default/xui/en/widgets/text.xml b/indra/newview/skins/default/xui/en/widgets/text.xml index 5dd09e663b..855584a0db 100644 --- a/indra/newview/skins/default/xui/en/widgets/text.xml +++ b/indra/newview/skins/default/xui/en/widgets/text.xml @@ -11,7 +11,6 @@ allow_scroll="false" text_readonly_color="LabelDisabledColor" bg_writeable_color="FloaterDefaultBackgroundColor" - border_color="DefaultHighlightLight" use_ellipses="false" bg_visible="false" border_visible="false" |