fixed bug EXT-3722 New IM & Notification buttons can be clicked on, even when there's nothing to see

Note:
It was decided to  handle  an enabling of buttons from syswellwindow according to his empty state

--HG--
branch : product-engine
master
Denis Serdjuk 2009-12-30 17:37:45 +02:00
parent 5eb4d0b219
commit 8da7889400
4 changed files with 23 additions and 9 deletions

View File

@ -225,6 +225,10 @@ void LLSysWellChiclet::setNewMessagesState(bool new_messages)
mIsNewMessagesState = new_messages;
}
void LLSysWellChiclet::updateWidget(bool is_window_empty)
{
mButton->setEnabled(!is_window_empty);
}
// virtual
BOOL LLSysWellChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
@ -374,6 +378,13 @@ void LLNotificationChiclet::createMenu()
LLViewerMenuHolderGL::child_registry_t::instance());
}
/*virtual*/
void LLNotificationChiclet::setCounter(S32 counter)
{
LLSysWellChiclet::setCounter(counter);
updateWidget(getCounter() == 0);
}
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////

View File

@ -825,6 +825,8 @@ public:
void setToggleState(BOOL toggled);
void setNewMessagesState(bool new_messages);
//this method should change a widget according to state of the SysWellWindow
virtual void updateWidget(bool is_window_empty);
protected:
@ -930,7 +932,7 @@ protected:
// methods for updating a number of unread System notifications
void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); }
void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); }
/*virtual*/ void setCounter(S32 counter);
S32 mUreadSystemNotifications;
};

View File

@ -106,17 +106,17 @@ void LLSysWellWindow::onStartUpToastClick(S32 x, S32 y, MASK mask)
setVisible(TRUE);
}
void LLSysWellWindow::setSysWellChiclet(LLSysWellChiclet* chiclet)
{
mSysWellChiclet = chiclet;
if(mSysWellChiclet)
mSysWellChiclet->updateWidget(isWindowEmpty());
}
//---------------------------------------------------------------------------------
LLSysWellWindow::~LLSysWellWindow()
{
}
//---------------------------------------------------------------------------------
void LLSysWellWindow::clear()
{
mMessageList->clear();
}
//---------------------------------------------------------------------------------
void LLSysWellWindow::removeItemByID(const LLUUID& id)
{
@ -281,6 +281,7 @@ void LLSysWellWindow::handleItemAdded(EItemType added_item_type)
setResizeLimits(min_width,min_height);
}
mSysWellChiclet->updateWidget(isWindowEmpty());
}
void LLSysWellWindow::handleItemRemoved(EItemType removed_item_type)
@ -294,6 +295,7 @@ void LLSysWellWindow::handleItemRemoved(EItemType removed_item_type)
// refresh list to recalculate mSeparator position
mMessageList->reshape(mMessageList->getRect().getWidth(), mMessageList->getRect().getHeight());
}
mSysWellChiclet->updateWidget(isWindowEmpty());
}
bool LLSysWellWindow::anotherTypeExists(EItemType item_type)

View File

@ -62,7 +62,6 @@ public:
bool isWindowEmpty();
// Operating with items
void clear( void );
void removeItemByID(const LLUUID& id);
// Operating with outfit
@ -74,7 +73,7 @@ public:
void onStartUpToastClick(S32 x, S32 y, MASK mask);
void setSysWellChiclet(LLSysWellChiclet* chiclet) { mSysWellChiclet = chiclet; }
void setSysWellChiclet(LLSysWellChiclet* chiclet);
// size constants for the window and for its elements
static const S32 MAX_WINDOW_HEIGHT = 200;