summaryrefslogtreecommitdiff
path: root/indra/newview/llchiclet.cpp
diff options
context:
space:
mode:
authorMike Antipov <mantipov@productengine.com>2009-11-18 13:04:17 +0200
committerMike Antipov <mantipov@productengine.com>2009-11-18 13:04:17 +0200
commitc22a90669c78bd206593d112d44e9c6cbc1503fb (patch)
treee939de0b47e6a299799693eb92e63185a29c5b8c /indra/newview/llchiclet.cpp
parent812d18515ddefd11fe8c5fc7f655280a231670f5 (diff)
Work on normal sub-task EXT-2553 (Change Sys well icon & Counter according to ALTERNATE design)
- implemented counter next to the left from an envelope icon. - button now has fixed width for 3 digits. --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llchiclet.cpp')
-rw-r--r--indra/newview/llchiclet.cpp26
1 files changed, 9 insertions, 17 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 4078fac4ec..caf6917d90 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -81,27 +81,17 @@ LLNotificationChiclet::Params::Params()
button.tab_stop(FALSE);
button.label(LLStringUtil::null);
- unread_notifications.name("unread");
- unread_notifications.font(LLFontGL::getFontSansSerif());
- unread_notifications.text_color=(LLColor4::white);
- unread_notifications.font_halign(LLFontGL::HCENTER);
- unread_notifications.mouse_opaque(FALSE);
}
LLNotificationChiclet::LLNotificationChiclet(const Params& p)
: LLChiclet(p)
, mButton(NULL)
-, mCounterCtrl(NULL)
+, mCounter(0)
{
LLButton::Params button_params = p.button;
- button_params.rect(p.rect());
mButton = LLUICtrlFactory::create<LLButton>(button_params);
addChild(mButton);
- LLChicletNotificationCounterCtrl::Params unread_params = p.unread_notifications;
- mCounterCtrl = LLUICtrlFactory::create<LLChicletNotificationCounterCtrl>(unread_params);
- addChild(mCounterCtrl);
-
// connect counter handlers to the signals
connectCounterUpdatersToSignal("notify");
connectCounterUpdatersToSignal("groupnotify");
@@ -126,13 +116,15 @@ void LLNotificationChiclet::connectCounterUpdatersToSignal(std::string notificat
void LLNotificationChiclet::setCounter(S32 counter)
{
- mCounterCtrl->setCounter(counter);
-}
+ std::string s_count;
+ if(counter != 0)
+ {
+ s_count = llformat("%d", counter);
+ }
-void LLNotificationChiclet::setShowCounter(bool show)
-{
- LLChiclet::setShowCounter(show);
- mCounterCtrl->setVisible(getShowCounter());
+ mButton->setLabel(s_count);
+
+ mCounter = counter;
}
boost::signals2::connection LLNotificationChiclet::setClickCallback(