From def85f2778d9b69bc3fb0e89c1cef854a1c01886 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 9 Jun 2011 12:12:28 -0700 Subject: 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 --- indra/newview/llsidetray.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'indra/newview') 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 image_selected; Optional tab_title; Optional description; + Optional 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("undock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, false)); getChild("dock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, true)); - return true; + addBadgeToParentPanel(); + + return LLPanel::postBuild(); } static const S32 splitter_margin = 1; -- cgit v1.2.3