diff options
author | Leslie Linden <none@none> | 2011-06-09 12:12:28 -0700 |
---|---|---|
committer | Leslie Linden <none@none> | 2011-06-09 12:12:28 -0700 |
commit | def85f2778d9b69bc3fb0e89c1cef854a1c01886 (patch) | |
tree | bfae24f88d2a2679d5812a9684b33a5750d946c6 /indra/newview | |
parent | 6e928645b94901518fe452ab7fab0278e87613d7 (diff) |
EXP-865 FIX -- Modify LLBadge to allow it to hang off of non-buttons
LLBadgeOwner now only depends on LLView instead of LLUICtrl
Sidebar Tab Buttons now can support badges
Reviewed by Leyla
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llsidetray.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 631b244785..fe3f2568bc 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -30,6 +30,7 @@ #include "llagentcamera.h" #include "llappviewer.h" +#include "llbadgeowner.h" #include "llbottomtray.h" #include "llfloaterreg.h" #include "llfirstuse.h" @@ -98,7 +99,7 @@ bool LLSideTray::instanceCreated () // Represents a single tab in the side tray, only used by LLSideTray ////////////////////////////////////////////////////////////////////////////// -class LLSideTrayTab: public LLPanel +class LLSideTrayTab: public LLPanel, public LLBadgeOwner { LOG_CLASS(LLSideTrayTab); friend class LLUICtrlFactory; @@ -113,11 +114,14 @@ public: Optional<std::string> image_selected; Optional<std::string> tab_title; Optional<std::string> description; + Optional<LLBadge::Params> badge; + Params() : image("image"), image_selected("image_selected"), tab_title("tab_title","no title"), - description("description","no description") + description("description","no description"), + badge("badge") {}; }; protected: @@ -162,12 +166,17 @@ private: LLSideTrayTab::LLSideTrayTab(const Params& p) : LLPanel(), + LLBadgeOwner(LLView::getHandle()), mTabTitle(p.tab_title), mImage(p.image), mImageSelected(p.image_selected), mDescription(p.description), mMainPanel(NULL) { + if (p.badge.isProvided()) + { + LLBadgeOwner::initBadgeParams(p.badge()); + } } LLSideTrayTab::~LLSideTrayTab() @@ -196,7 +205,9 @@ BOOL LLSideTrayTab::postBuild() getChild<LLButton>("undock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, false)); getChild<LLButton>("dock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, true)); - return true; + addBadgeToParentPanel(); + + return LLPanel::postBuild(); } static const S32 splitter_margin = 1; |