From c22a90669c78bd206593d112d44e9c6cbc1503fb Mon Sep 17 00:00:00 2001
From: Mike Antipov <mantipov@productengine.com>
Date: Wed, 18 Nov 2009 13:04:17 +0200
Subject: [PATCH] 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
---
 indra/newview/llchiclet.cpp                   | 26 +++++++------------
 indra/newview/llchiclet.h                     | 11 ++++----
 .../skins/default/xui/en/panel_bottomtray.xml | 17 ++++++------
 3 files changed, 23 insertions(+), 31 deletions(-)

diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 4078fac4ecb..caf6917d90e 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(
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index eab4a282f52..bb5dc1e5500 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -638,13 +638,14 @@ class LLNotificationChiclet : public LLChiclet
 
 	/*virtual*/ void setCounter(S32 counter);
 
-	/*virtual*/S32 getCounter() { return mCounterCtrl->getCounter(); }
-
-	/*virtual*/ void setShowCounter(bool show);
+	// *TODO: mantipov: seems getCounter is not necessary for LLNotificationChiclet
+	// but inherited interface requires it to implement. 
+	// Probably it can be safe removed.
+	/*virtual*/S32 getCounter() { return mCounter; }
 
 	boost::signals2::connection setClickCallback(const commit_callback_t& cb);
 
-	/*virtual*/ ~ LLNotificationChiclet();
+	/*virtual*/ ~LLNotificationChiclet();
 
 	// methods for updating a number of unread System notifications
 	void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); }
@@ -662,7 +663,7 @@ class LLNotificationChiclet : public LLChiclet
 
 protected:
 	LLButton* mButton;
-	LLChicletNotificationCounterCtrl* mCounterCtrl;
+	S32 mCounter;
 };
 
 /*
diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
index d2933c0c0ea..00711a29e01 100644
--- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml
+++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml
@@ -299,8 +299,8 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly.
          min_height="28"
          top="0"
          name="sys_well_panel"
-         width="34"
-         min_width="34"
+         width="54"
+         min_width="54"
          user_resize="false">
             <chiclet_notification
              follows="right"
@@ -309,22 +309,21 @@ as for parent layout_panel (chiclet_list_panel) to resize bottom tray properly.
              left="0"
              name="sys_well"
              top="4"
-             width="34">
+             width="54">
               <button
               auto_resize="true"
                halign="right"
                height="23"
                follows="right"
                flash_color="EmphasisColor"
+               left="0"
                name="Unread"
                image_overlay="Notices_Unread"
-               width="20"
+               image_overlay_alignment="right" 
+               pad_right="6"
+               pad_left="6"
+               width="54"
                />
-               <unread_notifications
-               width="34"
-               height="20"
-               left="0"
-               top="19" />
 	    </chiclet_notification>
         </layout_panel>
        <icon
-- 
GitLab