diff options
Diffstat (limited to 'indra/llui')
29 files changed, 170 insertions, 78 deletions
diff --git a/indra/llui/llconsole.cpp b/indra/llui/llconsole.cpp index e0053b4cc7..48c76cf105 100644 --- a/indra/llui/llconsole.cpp +++ b/indra/llui/llconsole.cpp @@ -60,6 +60,8 @@ LLConsole* gConsole = NULL; // Created and destroyed in LLViewerWindow. const F32 FADE_DURATION = 2.f; const S32 MIN_CONSOLE_WIDTH = 200; +static LLDefaultChildRegistry::Register<LLConsole> r("console"); + LLConsole::LLConsole(const LLConsole::Params& p) : LLUICtrl(p), LLFixedBuffer(p.max_lines), diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index aac27e6562..f2cdad8854 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1857,6 +1857,8 @@ void LLFloater::buildButtons() ///////////////////////////////////////////////////// // LLFloaterView +static LLDefaultChildRegistry::Register<LLFloaterView> r("floater_view"); + LLFloaterView::LLFloaterView (const Params& p) : LLUICtrl (p), mFocusCycleMode(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 bac5491943..14a6ddb7e0 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -137,6 +137,7 @@ LLLayoutStack::LLLayoutStack(const LLLayoutStack::Params& p) mPanelSpacing(p.border_size), mOrientation((p.orientation() == "vertical") ? VERTICAL : HORIZONTAL), mAnimate(p.animate), + mAnimatedThisFrame(false), mClip(p.clip) {} @@ -172,6 +173,7 @@ void LLLayoutStack::draw() // only force drawing invisible children if visible amount is non-zero drawChild(panelp, 0, 0, !clip_rect.isEmpty()); } + mAnimatedThisFrame = false; } void LLLayoutStack::removeChild(LLView* view) @@ -411,8 +413,10 @@ void LLLayoutStack::updatePanelAutoResize(const std::string& panel_name, BOOL au } } +static LLFastTimer::DeclareTimer FTM_UPDATE_LAYOUT("Update LayoutStacks"); void LLLayoutStack::updateLayout(BOOL force_resize) { + LLFastTimer ft(FTM_UPDATE_LAYOUT); static LLUICachedControl<S32> resize_bar_overlap ("UIResizeBarOverlap", 0); calcMinExtents(); @@ -431,10 +435,13 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (mAnimate) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_OPEN_TIME)); - if ((*panel_it)->mVisibleAmt > 0.99f) + if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = 1.f; + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(ANIM_OPEN_TIME)); + if ((*panel_it)->mVisibleAmt > 0.99f) + { + (*panel_it)->mVisibleAmt = 1.f; + } } } else @@ -446,10 +453,13 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (mAnimate) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); - if ((*panel_it)->mVisibleAmt < 0.001f) + if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = 0.f; + (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(ANIM_CLOSE_TIME)); + if ((*panel_it)->mVisibleAmt < 0.001f) + { + (*panel_it)->mVisibleAmt = 0.f; + } } } else @@ -631,10 +641,10 @@ void LLLayoutStack::updateLayout(BOOL force_resize) // adjust running headroom count based on new sizes shrink_headroom_total += delta_size; - panelp->reshape(new_width, new_height); - panelp->setOrigin(cur_x, cur_y - new_height); + LLRect panel_rect; + panel_rect.setLeftTopAndSize(cur_x, cur_y, new_width, new_height); + panelp->setShape(panel_rect); - LLRect panel_rect = panelp->getRect(); LLRect resize_bar_rect = panel_rect; if (mOrientation == HORIZONTAL) { @@ -705,6 +715,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize) llassert_always(force_resize == FALSE); updateLayout(TRUE); } + + mAnimatedThisFrame = true; } // end LLLayoutStack::updateLayout @@ -772,3 +784,16 @@ void LLLayoutStack::calcMinExtents() } } } + +// update layout stack animations, etc. once per frame +// NOTE: we use this to size world view based on animating UI, *before* we draw the UI +// we might still need to call updateLayout during UI draw phase, in case UI elements +// are resizing themselves dynamically +//static +void LLLayoutStack::updateClass() +{ + for (LLLayoutStack::instance_iter it = beginInstances(); it != endInstances(); ++it) + { + it->updateLayout(); + } +} diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 9ded48ef6a..3a073fa1b2 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -38,7 +38,7 @@ class LLPanel; -class LLLayoutStack : public LLView +class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack> { public: struct Params : public LLInitParam::Block<Params, LLView::Params> @@ -81,6 +81,10 @@ public: S32 getNumPanels() { return mPanels.size(); } void updatePanelAutoResize(const std::string& panel_name, BOOL auto_resize); + + + static void updateClass(); + protected: LLLayoutStack(const Params&); friend class LLUICtrlFactory; @@ -105,6 +109,8 @@ private: S32 mMinHeight; // calculated by calcMinExtents S32 mPanelSpacing; + // true if we already applied animation this frame + bool mAnimatedThisFrame; bool mAnimate; bool mClip; }; // end class LLLayoutStack diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index c6a38c7ca7..de9a854f63 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3270,11 +3270,9 @@ BOOL LLMenuBarGL::handleHover( S32 x, S32 y, MASK mask ) ///============================================================================ LLCoordGL LLMenuHolderGL::sContextMenuSpawnPos(S32_MAX, S32_MAX); -LLMenuHolderGL::LLMenuHolderGL() - : LLPanel() +LLMenuHolderGL::LLMenuHolderGL(const LLMenuHolderGL::Params& p) + : LLPanel(p) { - setName("Menu Holder"); - setMouseOpaque(FALSE); sItemActivationTimer.stop(); mCanHide = TRUE; } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index dc8ed3b3fd..cbb9b4d344 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -746,7 +746,9 @@ private: class LLMenuHolderGL : public LLPanel { public: - LLMenuHolderGL(); + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + {}; + LLMenuHolderGL(const Params& p); virtual ~LLMenuHolderGL() {} virtual BOOL hideMenus(); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index ef222bad60..eb8cc3e2c5 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -81,6 +81,11 @@ private: void savePersistentNotifications() { + /* NOTE: As of 2009-11-09 the reload of notifications on startup does not + work, and has not worked for months. Skip saving notifications until the + read can be fixed, because this hits the disk once per notification and + causes log spam. James + llinfos << "Saving open notifications to " << mFileName << llendl; llofstream notify_file(mFileName.c_str()); @@ -107,6 +112,7 @@ private: LLPointer<LLSDFormatter> formatter = new LLSDXMLFormatter(); formatter->format(output, notify_file, LLSDFormatter::OPTIONS_PRETTY); + */ } void loadPersistentNotifications() 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/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index ba53f84877..d281341202 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -44,6 +44,9 @@ const S32 MIN_COLUMN_WIDTH = 20; +// defaults for LLScrollColumnHeader param block pulled from widgets/scroll_column_header.xml +static LLWidgetNameRegistry::StaticRegistrar sRegisterColumnHeaderParams(&typeid(LLScrollColumnHeader::Params), "scroll_column_header"); + //--------------------------------------------------------------------------- // LLScrollColumnHeader //--------------------------------------------------------------------------- @@ -51,15 +54,7 @@ LLScrollColumnHeader::Params::Params() : column("column") { name = "column_header"; - image_unselected.name("square_btn_32x128.tga"); - image_selected.name("square_btn_selected_32x128.tga"); - image_disabled.name("square_btn_32x128.tga"); - image_disabled_selected.name("square_btn_selected_32x128.tga"); - image_overlay.name("combobox_arrow.tga"); - image_overlay_alignment("right"); - font_halign = LLFontGL::LEFT; tab_stop(false); - scale_image(true); } diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index a6cd6412e5..1c2c02e1cc 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -2624,7 +2624,7 @@ void LLScrollListCtrl::addColumn(const LLScrollListColumn::Params& column_params LLRect temp_rect = LLRect(left,top+mHeadingHeight,right,top); - LLScrollColumnHeader::Params params; + LLScrollColumnHeader::Params params(LLUICtrlFactory::getDefaultParams<LLScrollColumnHeader>()); params.name = "btn_" + name; params.rect = temp_rect; params.column = new_column; 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..8d36c9c616 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) @@ -2232,7 +2231,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(); 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 4bc9a9c042..984a534da6 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -57,6 +57,8 @@ LLToolTipView *gToolTipView = NULL; // Member functions // +static LLDefaultChildRegistry::Register<LLToolTipView> register_tooltip_view("tooltip_view"); + LLToolTipView::Params::Params() { mouse_opaque = false; @@ -137,12 +139,16 @@ 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 // -static LLDefaultChildRegistry::Register<LLToolTip> r("tool_tip"); +static LLDefaultChildRegistry::Register<LLToolTip> register_tooltip("tool_tip"); LLToolTip::Params::Params() diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 30d251266c..774ca507c1 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -116,6 +116,12 @@ private: 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/llui.cpp b/indra/llui/llui.cpp index a82e6eb372..4cf503b413 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -43,7 +43,6 @@ #include "llrender.h" #include "llrect.h" #include "lldir.h" -#include "llfontgl.h" #include "llgl.h" // Project includes 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/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp index c3c0daed0f..adfbb41feb 100644 --- a/indra/llui/lluictrlfactory.cpp +++ b/indra/llui/lluictrlfactory.cpp @@ -449,3 +449,9 @@ const std::string* LLUICtrlFactory::getWidgetTag(const std::type_info* widget_ty { return LLWidgetNameRegistry::instance().getValue(widget_type); } + +// static +void LLUICtrlFactory::connect(LLView* parent, LLView* child) +{ + parent->addChild(child); +} diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 17e32dc7a9..8a9c9e23c1 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -188,10 +188,15 @@ public: T* widget = new T(params); widget->initFromParams(params); if (parent) - widget->setParent(parent); + { + connect(parent, widget); + } return widget; } + // fix for gcc template instantiation annoyance + static void connect(LLView* parent, LLView* child); + LLView* createFromXML(LLXMLNodePtr node, LLView* parent, const std::string& filename, const widget_registry_t&, LLXMLNodePtr output_node ); template<typename T> 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/llview.cpp b/indra/llui/llview.cpp index fe7fd59de8..dba24ee165 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -40,7 +40,6 @@ #include "llrender.h" #include "llevent.h" -#include "llfontgl.h" #include "llfocusmgr.h" #include "llrect.h" #include "llstl.h" @@ -1698,8 +1697,11 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const return child; } +static LLFastTimer::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); + LLView* LLView::findChildView(const std::string& name, BOOL recurse) const { + LLFastTimer ft(FTM_FIND_VIEWS); //richard: should we allow empty names? //if(name.empty()) // return NULL; diff --git a/indra/llui/llview.h b/indra/llui/llview.h index c3b442e022..2607120e17 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -267,9 +267,6 @@ public: // remove the specified child from the view, and set it's parent to NULL. virtual void removeChild(LLView* view); - // helper function for lluictrlfactory.h create<> template - void setParent(LLView* parent) { if (parent) parent->addChild(this); } - virtual BOOL postBuild() { return TRUE; } child_tab_order_t getCtrlOrder() const { return mCtrlOrder; } |