diff options
Diffstat (limited to 'indra/llui')
26 files changed, 172 insertions, 130 deletions
diff --git a/indra/llui/lldockcontrol.cpp b/indra/llui/lldockcontrol.cpp index 35a854267a..045505af5b 100644 --- a/indra/llui/lldockcontrol.cpp +++ b/indra/llui/lldockcontrol.cpp @@ -256,7 +256,6 @@ void LLDockControl::on() { if (isDockVisible()) { - mDockableFloater->setCanDrag(false); mEnabled = true; mRecalculateDocablePosition = true; } @@ -264,7 +263,6 @@ void LLDockControl::on() void LLDockControl::off() { - mDockableFloater->setCanDrag(true); mEnabled = false; } diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 03925f922c..eb67e3a561 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -46,7 +46,7 @@ LLFloaterReg::instance_map_t LLFloaterReg::sInstanceMap; LLFloaterReg::build_map_t LLFloaterReg::sBuildMap; std::map<std::string,std::string> LLFloaterReg::sGroupMap; -static LLFloaterRegListener sFloaterRegListener("LLFloaterReg"); +static LLFloaterRegListener sFloaterRegListener; //******************************************************* diff --git a/indra/llui/llfloaterreglistener.cpp b/indra/llui/llfloaterreglistener.cpp index 57d148b5af..029d3b6810 100644 --- a/indra/llui/llfloaterreglistener.cpp +++ b/indra/llui/llfloaterreglistener.cpp @@ -21,19 +21,35 @@ #include "llfloater.h" #include "llbutton.h" -LLFloaterRegListener::LLFloaterRegListener(const std::string& pumpName): - LLDispatchListener(pumpName, "op") +LLFloaterRegListener::LLFloaterRegListener(): + LLEventAPI("LLFloaterReg", + "LLFloaterReg listener to (e.g.) show/hide LLFloater instances") { - add("getBuildMap", &LLFloaterRegListener::getBuildMap, LLSD().insert("reply", LLSD())); + add("getBuildMap", + "Return on [\"reply\"] data about all registered LLFloaterReg floater names", + &LLFloaterRegListener::getBuildMap, + LLSD().insert("reply", LLSD())); LLSD requiredName; requiredName["name"] = LLSD(); - add("showInstance", &LLFloaterRegListener::showInstance, requiredName); - add("hideInstance", &LLFloaterRegListener::hideInstance, requiredName); - add("toggleInstance", &LLFloaterRegListener::toggleInstance, requiredName); + add("showInstance", + "Ask to display the floater specified in [\"name\"]", + &LLFloaterRegListener::showInstance, + requiredName); + add("hideInstance", + "Ask to hide the floater specified in [\"name\"]", + &LLFloaterRegListener::hideInstance, + requiredName); + add("toggleInstance", + "Ask to toggle the state of the floater specified in [\"name\"]", + &LLFloaterRegListener::toggleInstance, + requiredName); LLSD requiredNameButton; requiredNameButton["name"] = LLSD(); requiredNameButton["button"] = LLSD(); - add("clickButton", &LLFloaterRegListener::clickButton, requiredNameButton); + add("clickButton", + "Simulate clicking the named [\"button\"] in the visible floater named in [\"name\"]", + &LLFloaterRegListener::clickButton, + requiredNameButton); } void LLFloaterRegListener::getBuildMap(const LLSD& event) const diff --git a/indra/llui/llfloaterreglistener.h b/indra/llui/llfloaterreglistener.h index 304ecd1090..a38117f6b0 100644 --- a/indra/llui/llfloaterreglistener.h +++ b/indra/llui/llfloaterreglistener.h @@ -12,18 +12,18 @@ #if ! defined(LL_LLFLOATERREGLISTENER_H) #define LL_LLFLOATERREGLISTENER_H -#include "lleventdispatcher.h" +#include "lleventapi.h" #include <string> class LLSD; /// Event API wrapper for LLFloaterReg -class LLFloaterRegListener: public LLDispatchListener +class LLFloaterRegListener: public LLEventAPI { public: /// As all public LLFloaterReg methods are static, there's no point in /// binding an LLFloaterReg instance. - LLFloaterRegListener(const std::string& pumpName); + LLFloaterRegListener(); private: void getBuildMap(const LLSD& event) const; diff --git a/indra/llui/llhelp.h b/indra/llui/llhelp.h index c06d29a4bd..82c3bc385f 100644 --- a/indra/llui/llhelp.h +++ b/indra/llui/llhelp.h @@ -40,6 +40,8 @@ class LLHelp virtual void showTopic(const std::string &topic) = 0; // return default (fallback) topic name suitable for showTopic() virtual std::string defaultTopic() = 0; + // return topic to use before the user logs in + virtual std::string preLoginTopic() = 0; }; #endif // headerguard diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 9399ace1f7..14a6ddb7e0 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -792,8 +792,8 @@ void LLLayoutStack::calcMinExtents() //static void LLLayoutStack::updateClass() { - for (LLInstanceTracker<LLLayoutStack>::instance_iter it = beginInstances(); it != endInstances(); ++it) + for (LLLayoutStack::instance_iter it = beginInstances(); it != endInstances(); ++it) { - (*it)->updateLayout(); + it->updateLayout(); } } diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp index 75f4d6177d..fe4fbe7510 100644 --- a/indra/llui/llnotificationslistener.cpp +++ b/indra/llui/llnotificationslistener.cpp @@ -16,10 +16,14 @@ #include "llnotifications.h" LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) : - LLDispatchListener("LLNotifications", "op"), + LLEventAPI("LLNotifications", + "LLNotifications listener to (e.g.) pop up a notification"), mNotifications(notifications) { - add("requestAdd", &LLNotificationsListener::requestAdd); + add("requestAdd", + "Add a notification with specified [\"name\"], [\"substitutions\"] and [\"payload\"].\n" + "If optional [\"reply\"] specified, arrange to send user response on that LLEventPump.", + &LLNotificationsListener::requestAdd); } void LLNotificationsListener::requestAdd(const LLSD& event_data) const diff --git a/indra/llui/llnotificationslistener.h b/indra/llui/llnotificationslistener.h index 6f71a7c781..9b405d7b4b 100644 --- a/indra/llui/llnotificationslistener.h +++ b/indra/llui/llnotificationslistener.h @@ -12,12 +12,12 @@ #ifndef LL_LLNOTIFICATIONSLISTENER_H #define LL_LLNOTIFICATIONSLISTENER_H -#include "lleventdispatcher.h" +#include "lleventapi.h" class LLNotifications; class LLSD; -class LLNotificationsListener : public LLDispatchListener +class LLNotificationsListener : public LLEventAPI { public: LLNotificationsListener(LLNotifications & notifications); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 07c0f3ce84..89c4656297 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -512,6 +512,8 @@ BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu // add children using dimensions from referenced xml for consistent layout setShape(params.rect); LLUICtrlFactory::createChildren(this, referenced_xml, child_registry_t::instance()); + + setXMLFilename(xml_filename); } // ask LLUICtrlFactory for filename, since xml_filename might be empty diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp index a7c268758a..544352176a 100644 --- a/indra/llui/llscrolllistcell.cpp +++ b/indra/llui/llscrolllistcell.cpp @@ -71,7 +71,8 @@ LLScrollListCell* LLScrollListCell::create(const LLScrollListCell::Params& cell_ LLScrollListCell::LLScrollListCell(const LLScrollListCell::Params& p) -: mWidth(p.width) +: mWidth(p.width), + mToolTip(p.tool_tip) {} // virtual @@ -204,13 +205,28 @@ BOOL LLScrollListText::isText() const return TRUE; } +// virtual +const std::string &LLScrollListText::getToolTip() const +{ + // If base class has a tooltip, return that + if (! LLScrollListCell::getToolTip().empty()) + return LLScrollListCell::getToolTip(); + + // ...otherwise, return the value itself as the tooltip + return mText.getString(); +} + +// virtual BOOL LLScrollListText::needsToolTip() const { - // show tooltips for truncated text + // If base class has a tooltip, return that + if (LLScrollListCell::needsToolTip()) + return LLScrollListCell::needsToolTip(); + + // ...otherwise, show tooltips for truncated text return mFont->getWidth(mText.getString()) > getWidth(); } - //virtual BOOL LLScrollListText::getVisible() const { diff --git a/indra/llui/llscrolllistcell.h b/indra/llui/llscrolllistcell.h index 758623f121..5fecf5aade 100644 --- a/indra/llui/llscrolllistcell.h +++ b/indra/llui/llscrolllistcell.h @@ -66,6 +66,7 @@ public: Optional<void*> userdata; Optional<LLSD> value; + Optional<std::string> tool_tip; Optional<const LLFontGL*> font; Optional<LLColor4> font_color; @@ -80,6 +81,7 @@ public: enabled("enabled", true), visible("visible", true), value("value"), + tool_tip("tool_tip", ""), font("font", LLFontGL::getFontSansSerifSmall()), font_color("font_color", LLColor4::black), color("color", LLColor4::white), @@ -101,11 +103,13 @@ public: virtual S32 getHeight() const { return 0; } virtual const LLSD getValue() const; virtual void setValue(const LLSD& value) { } + virtual const std::string &getToolTip() const { return mToolTip; } + virtual void setToolTip(const std::string &str) { mToolTip = str; } virtual BOOL getVisible() const { return TRUE; } virtual void setWidth(S32 width) { mWidth = width; } virtual void highlightText(S32 offset, S32 num_chars) {} virtual BOOL isText() const { return FALSE; } - virtual BOOL needsToolTip() const { return FALSE; } + virtual BOOL needsToolTip() const { return ! mToolTip.empty(); } virtual void setColor(const LLColor4&) {} virtual void onCommit() {}; @@ -114,6 +118,7 @@ public: private: S32 mWidth; + std::string mToolTip; }; class LLScrollListSpacer : public LLScrollListCell @@ -143,6 +148,7 @@ public: /*virtual*/ void setColor(const LLColor4&); /*virtual*/ BOOL isText() const; + /*virtual*/ const std::string & getToolTip() const; /*virtual*/ BOOL needsToolTip() const; void setText(const LLStringExplicit& text); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 1c2c02e1cc..a53a30b501 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1565,7 +1565,7 @@ BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, MASK mask) // display tooltip exactly over original cell, in same font LLToolTipMgr::instance().show(LLToolTip::Params() - .message(hit_cell->getValue().asString()) + .message(hit_cell->getToolTip()) .font(LLFontGL::getFontSansSerifSmall()) .pos(LLCoordGL(sticky_rect.mLeft - 5, sticky_rect.mTop + 6)) .delay_time(0.2f) diff --git a/indra/llui/llstyle.cpp b/indra/llui/llstyle.cpp index fd3f88d1f6..71511f69a4 100644 --- a/indra/llui/llstyle.cpp +++ b/indra/llui/llstyle.cpp @@ -51,6 +51,7 @@ LLStyle::Params::Params() LLStyle::LLStyle(const LLStyle::Params& p) : mVisible(p.visible), mColor(p.color()), + mReadOnlyColor(p.readonly_color()), mFont(p.font()), mLink(p.link_href), mDropShadow(p.drop_shadow), diff --git a/indra/llui/llstyle.h b/indra/llui/llstyle.h index c769964136..ee9ca730e9 100644 --- a/indra/llui/llstyle.h +++ b/indra/llui/llstyle.h @@ -46,7 +46,8 @@ public: { Optional<bool> visible; Optional<LLFontGL::ShadowType> drop_shadow; - Optional<LLUIColor> color; + Optional<LLUIColor> color, + readonly_color; Optional<const LLFontGL*> font; Optional<LLUIImage*> image; Optional<std::string> link_href; @@ -57,6 +58,8 @@ public: const LLColor4& getColor() const { return mColor; } void setColor(const LLColor4 &color) { mColor = color; } + const LLColor4& getReadOnlyColor() const { return mReadOnlyColor; } + BOOL isVisible() const; void setVisible(BOOL is_visible); @@ -81,6 +84,7 @@ public: return mVisible == rhs.mVisible && mColor == rhs.mColor + && mReadOnlyColor == rhs.mReadOnlyColor && mFont == rhs.mFont && mLink == rhs.mLink && mImagep == rhs.mImagep @@ -104,6 +108,7 @@ protected: private: BOOL mVisible; LLUIColor mColor; + LLUIColor mReadOnlyColor; std::string mFontName; const LLFontGL* mFont; // cached for performance std::string mLink; diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index b67f753d39..44eff8d357 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -346,7 +346,13 @@ void LLTabContainer::draw() } } - LLPanel::draw(); + { + LLRect clip_rect = getLocalRect(); + clip_rect.mLeft+=(LLPANEL_BORDER_WIDTH + 2); + clip_rect.mRight-=(LLPANEL_BORDER_WIDTH + 2); + LLLocalClipRect clip(clip_rect); + LLPanel::draw(); + } // if tabs are hidden, don't draw them and leave them in the invisible state if (!getTabsHidden()) @@ -358,24 +364,6 @@ void LLTabContainer::draw() tuple->mButton->setVisible( TRUE ); } - // Draw some of the buttons... - LLRect clip_rect = getLocalRect(); - if (has_scroll_arrows) - { - // ...but clip them. - if (mIsVertical) - { - clip_rect.mBottom = mNextArrowBtn->getRect().mTop + 3*tabcntrv_pad; - clip_rect.mTop = mPrevArrowBtn->getRect().mBottom - 3*tabcntrv_pad; - } - else - { - clip_rect.mLeft = mPrevArrowBtn->getRect().mRight; - clip_rect.mRight = mNextArrowBtn->getRect().mLeft; - } - } - LLLocalClipRect clip(clip_rect); - S32 max_scroll_visible = getTabCount() - getMaxScrollPos() + getScrollPos(); S32 idx = 0; for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) @@ -403,7 +391,7 @@ void LLTabContainer::draw() mNextArrowBtn->setFlashing( TRUE ); } } - } + }
idx++; } @@ -1039,6 +1027,11 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) { LLUICtrl::addChild(child, 1); } + + sendChildToFront(mPrevArrowBtn); + sendChildToFront(mNextArrowBtn); + sendChildToFront(mJumpPrevArrowBtn); + sendChildToFront(mJumpNextArrowBtn); if( select ) { @@ -1672,23 +1665,23 @@ void LLTabContainer::initButtons() S32 btn_top = (getTabPosition() == TOP ) ? getRect().getHeight() - getTopBorderHeight() : tabcntr_arrow_btn_size + 1; LLRect left_arrow_btn_rect; - left_arrow_btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH+1+tabcntr_arrow_btn_size, btn_top + arrow_fudge, tabcntr_arrow_btn_size, tabcntr_arrow_btn_size ); + left_arrow_btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH+1+tabcntr_arrow_btn_size, btn_top + arrow_fudge, tabcntr_arrow_btn_size, mTabHeight ); LLRect jump_left_arrow_btn_rect; - jump_left_arrow_btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH+1, btn_top + arrow_fudge, tabcntr_arrow_btn_size, tabcntr_arrow_btn_size ); + jump_left_arrow_btn_rect.setLeftTopAndSize( LLPANEL_BORDER_WIDTH+1, btn_top + arrow_fudge, tabcntr_arrow_btn_size, mTabHeight ); S32 right_pad = tabcntr_arrow_btn_size + LLPANEL_BORDER_WIDTH + 1; LLRect right_arrow_btn_rect; right_arrow_btn_rect.setLeftTopAndSize( getRect().getWidth() - mRightTabBtnOffset - right_pad - tabcntr_arrow_btn_size, btn_top + arrow_fudge, - tabcntr_arrow_btn_size, tabcntr_arrow_btn_size ); + tabcntr_arrow_btn_size, mTabHeight ); LLRect jump_right_arrow_btn_rect; jump_right_arrow_btn_rect.setLeftTopAndSize( getRect().getWidth() - mRightTabBtnOffset - right_pad, btn_top + arrow_fudge, - tabcntr_arrow_btn_size, tabcntr_arrow_btn_size ); + tabcntr_arrow_btn_size, mTabHeight ); LLButton::Params p; p.name(std::string("Jump Left Arrow")); diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 97ba691341..9706878a57 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -286,8 +286,7 @@ bool LLTextBase::truncate() LLStyle::Params LLTextBase::getDefaultStyle() { - LLColor4 text_color = ( mReadOnly ? mReadOnlyFgColor.get() : mFgColor.get() ); - return LLStyle::Params().color(text_color).font(mDefaultFont).drop_shadow(mFontShadow); + return LLStyle::Params().color(mFgColor.get()).readonly_color(mReadOnlyFgColor.get()).font(mDefaultFont).drop_shadow(mFontShadow); } void LLTextBase::onValueChange(S32 start, S32 end) @@ -995,6 +994,12 @@ void LLTextBase::setColor( const LLColor4& c ) mFgColor = c; } +//virtual +void LLTextBase::setReadOnlyColor(const LLColor4 &c) +{ + mReadOnlyFgColor = c; +} + //virtual void LLTextBase::setValue(const LLSD& value ) { @@ -2232,7 +2237,7 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele const LLFontGL* font = mStyle->getFont(); - LLColor4 color = mStyle->getColor() % alpha; + LLColor4 color = (mEditor.getReadOnly() ? mStyle->getReadOnlyColor() : mStyle->getColor()) % alpha; font = mStyle->getFont(); @@ -2370,7 +2375,9 @@ bool LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt height = mFontHeight; width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); - return num_chars >= 1 && text[mStart + num_chars - 1] == '\n'; + // if last character is a newline, then return true, forcing line break + llwchar last_char = text[mStart + first_char + num_chars - 1]; + return num_chars >= 1 && last_char == '\n'; } S32 LLNormalTextSegment::getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index 8cae8fde22..fb01cd1e7c 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -118,6 +118,8 @@ public: // LLUICtrl interface /*virtual*/ BOOL acceptsTextInput() const { return !mReadOnly; } /*virtual*/ void setColor( const LLColor4& c ); + virtual void setReadOnlyColor(const LLColor4 &c); + /*virtual*/ void setValue(const LLSD& value ); /*virtual*/ LLTextViewModel* getViewModel() const; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 3ce5a0320b..d136c6b49d 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -2005,7 +2005,8 @@ void LLTextEditor::setEnabled(BOOL enabled) bool read_only = !enabled; if (read_only != mReadOnly) { - mReadOnly = read_only; + //mReadOnly = read_only; + LLTextBase::setReadOnly(read_only); updateSegments(); updateAllowingLanguageInput(); } diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index fe1c2ba67c..bb85177811 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -139,6 +139,10 @@ void LLToolTipView::drawStickyRect() { gl_rect_2d(LLToolTipMgr::instance().getMouseNearRect(), LLColor4::white, false); } + +// defaults for floater param block pulled from widgets/floater.xml +static LLWidgetNameRegistry::StaticRegistrar sRegisterInspectorParams(&typeid(LLInspector::Params), "inspector"); + // // LLToolTip // @@ -168,7 +172,6 @@ LLToolTip::Params::Params() LLToolTip::LLToolTip(const LLToolTip::Params& p) : LLPanel(p), - mMaxWidth(p.max_width), mHasClickCallback(p.click_callback.isProvided()), mPadding(p.padding), mTextBox(NULL), @@ -177,11 +180,9 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) mHomePageButton(NULL) { LLTextBox::Params params; - params.initial_value = "tip_text"; params.name = params.initial_value().asString(); // bake textbox padding into initial rect params.rect = LLRect (mPadding, mPadding + 1, mPadding + 1, mPadding); - params.follows.flags = FOLLOWS_ALL; params.h_pad = 0; params.v_pad = 0; params.mouse_opaque = false; @@ -206,7 +207,6 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) TOOLTIP_ICON_SIZE = (imagep ? imagep->getWidth() : 16); icon_rect.setOriginAndSize(mPadding, mPadding, TOOLTIP_ICON_SIZE, TOOLTIP_ICON_SIZE); icon_params.rect = icon_rect; - //icon_params.follows.flags = FOLLOWS_LEFT | FOLLOWS_BOTTOM; icon_params.image_unselected(imagep); icon_params.image_selected(imagep); @@ -277,15 +277,30 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) } } -void LLToolTip::setValue(const LLSD& value) +void LLToolTip::initFromParams(const LLToolTip::Params& p) { + LLPanel::initFromParams(p); + + // do this *after* we've had our size set in LLPanel::initFromParams(); const S32 REALLY_LARGE_HEIGHT = 10000; - reshape(mMaxWidth, REALLY_LARGE_HEIGHT); + mTextBox->reshape(p.max_width, REALLY_LARGE_HEIGHT); - mTextBox->setValue(value); + if (p.styled_message.isProvided()) + { + for (LLInitParam::ParamIterator<LLToolTip::StyledText>::const_iterator text_it = p.styled_message().begin(); + text_it != p.styled_message().end(); + ++text_it) + { + mTextBox->appendText(text_it->text(), false, text_it->style); + } + } + else + { + mTextBox->setText(p.message()); + } LLRect text_contents_rect = mTextBox->getContentsRect(); - S32 text_width = llmin(mMaxWidth, text_contents_rect.getWidth()); + S32 text_width = llmin(p.max_width(), text_contents_rect.getWidth()); S32 text_height = text_contents_rect.getHeight(); mTextBox->reshape(text_width, text_height); @@ -296,7 +311,7 @@ void LLToolTip::setValue(const LLSD& value) tooltip_rect.mBottom = 0; tooltip_rect.mLeft = 0; - setRect(tooltip_rect); + setShape(tooltip_rect); } void LLToolTip::setVisible(BOOL visible) @@ -407,9 +422,8 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params) } tooltip_params.rect = LLRect (0, 1, 1, 0); - mToolTip = LLUICtrlFactory::create<LLToolTip> (tooltip_params); - mToolTip->setValue(params.message()); + gToolTipView->addChild(mToolTip); if (params.pos.isProvided()) diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 30d251266c..8c8fdf0a4c 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -37,6 +37,7 @@ #include "llsingleton.h" #include "llinitparam.h" #include "llpanel.h" +#include "llstyle.h" // // Classes @@ -65,11 +66,19 @@ public: class LLToolTip : public LLPanel { public: + + struct StyledText : public LLInitParam::Block<StyledText> + { + Mandatory<std::string> text; + Optional<LLStyle::Params> style; + }; + struct Params : public LLInitParam::Block<Params, LLPanel::Params> { typedef boost::function<void(void)> click_callback_t; - Mandatory<std::string> message; + Optional<std::string> message; + Multiple<StyledText> styled_message; Optional<LLCoordGL> pos; Optional<F32> delay_time, @@ -85,8 +94,8 @@ public: Optional<click_callback_t> click_callback, click_playmedia_callback, click_homepage_callback; - Optional<S32> max_width; - Optional<S32> padding; + Optional<S32> max_width, + padding; Optional<bool> wrap; Params(); @@ -94,7 +103,6 @@ public: /*virtual*/ void draw(); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - /*virtual*/ void setValue(const LLSD& value); /*virtual*/ void setVisible(BOOL visible); bool isFading(); @@ -102,6 +110,7 @@ public: bool hasClickCallback(); LLToolTip(const Params& p); + void initFromParams(const LLToolTip::Params& params); private: class LLTextBox* mTextBox; @@ -111,11 +120,16 @@ private: LLFrameTimer mFadeTimer; LLFrameTimer mVisibleTimer; - S32 mMaxWidth; bool mHasClickCallback; S32 mPadding; // pixels }; +// used for the inspector tooltips which need different background images etc. +class LLInspector : public LLToolTip +{ +public: + struct Params : public LLInitParam::Block<Params, LLToolTip::Params> {}; +}; class LLToolTipMgr : public LLSingleton<LLToolTipMgr> { diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index 851091f0ca..f1e3000547 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -69,7 +69,14 @@ void LLUIColorTable::insertFromParams(const Params& p) ColorEntryParams color_entry = *it; if(color_entry.color.value.isChosen()) { - setColor(color_entry.name, color_entry.color.value, mLoadedColors); + if(mUserSetColors.find(color_entry.name)!=mUserSetColors.end()) + { + setColor(color_entry.name, color_entry.color.value); + } + else + { + setColor(color_entry.name, color_entry.color.value, mLoadedColors); + } } else { @@ -213,7 +220,7 @@ bool LLUIColorTable::loadFromSettings() result |= loadFromFilename(current_filename); } - std::string user_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SKIN, "colors.xml"); + std::string user_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml"); loadFromFilename(user_filename); return result; @@ -239,7 +246,7 @@ void LLUIColorTable::saveUserSettings() const if(!output_node->isNull()) { - const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SKIN, "colors.xml"); + const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml"); LLFILE *fp = LLFile::fopen(filename, "w"); if(fp != NULL) diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 08fc8fb784..aaadc1b58d 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -38,6 +38,10 @@ #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/lluiimage.cpp b/indra/llui/lluiimage.cpp index 6c1a32722f..a8683e55c3 100644 --- a/indra/llui/lluiimage.cpp +++ b/indra/llui/lluiimage.cpp @@ -142,6 +142,13 @@ namespace LLInitParam { LLUIImage* TypedParam<LLUIImage*>::getValueFromBlock() 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; + } + LLUIImage* imagep = LLUI::getUIImage(name()); if (!imagep) { diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index dae4b512d1..219fae84be 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -512,50 +512,6 @@ std::string LLUrlEntryTeleport::getLocation(const std::string &url) const return ::getStringAfterToken(url, "app/teleport/"); } -/// -/// LLUrlEntryObjectIM Describes a Second Life object instant msg Url, e.g., -/// secondlife:///app/objectim/<sessionid> -/// -LLUrlEntryObjectIM::LLUrlEntryObjectIM() -{ - mPattern = boost::regex("secondlife:///app/objectim/[\\da-f-]+\\??\\S*", - boost::regex::perl|boost::regex::icase); - mMenuName = "menu_url_objectim.xml"; - mTooltip = LLTrans::getString("TooltipObjectIMUrl"); -} - -std::string LLUrlEntryObjectIM::getLabel(const std::string &url, const LLUrlLabelCallback &cb) -{ - LLURI uri(url); - LLSD params = uri.queryMap(); - if (params.has("name")) - { - // look for a ?name=<obj-name> param in the url - // and use that as the label if present. - std::string name = params.get("name"); - LLStringUtil::trim(name); - if (name.empty()) - { - name = LLTrans::getString("Unnamed"); - } - return name; - } - - return unescapeUrl(url); -} - -std::string LLUrlEntryObjectIM::getLocation(const std::string &url) const -{ - LLURI uri(url); - LLSD params = uri.queryMap(); - if (params.has("slurl")) - { - return params.get("slurl"); - } - - return ""; -} - // // LLUrlEntrySL Describes a generic SLURL, e.g., a Url that starts // with secondlife:// (used as a catch-all for cases not matched above) diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 4507572b1e..7970b48eb5 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -209,18 +209,6 @@ public: }; /// -/// LLUrlEntryObjectIM Describes a Second Life object instant msg Url, e.g., -/// secondlife:///app/objectim/<sessionid>?name=Foo -/// -class LLUrlEntryObjectIM : public LLUrlEntryBase -{ -public: - LLUrlEntryObjectIM(); - /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); - /*virtual*/ std::string getLocation(const std::string &url) const; -}; - -/// /// LLUrlEntrySL Describes a generic SLURL, e.g., a Url that starts /// with secondlife:// (used as a catch-all for cases not matched above) /// diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 60275b60bc..a6922b019b 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -52,7 +52,6 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntryParcel()); registerUrl(new LLUrlEntryTeleport()); registerUrl(new LLUrlEntryWorldMap()); - registerUrl(new LLUrlEntryObjectIM()); registerUrl(new LLUrlEntryPlace()); registerUrl(new LLUrlEntrySL()); registerUrl(new LLUrlEntrySLLabel()); |