diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-08-14 21:50:02 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-08-14 21:50:02 +0000 |
commit | 73caee4208a4e05f66583de099502012fd8415ea (patch) | |
tree | ff9fa1b7b010e71fb62f26a32c912b5e266f3b23 /indra/newview/llsyswellwindow.cpp | |
parent | 1db494f58ad378b8028c1f071196be82af5fe964 (diff) |
svn merge https://svn.aws.productengine.com/secondlife/export-from-ll/viewer-2-0@1331 https://svn.aws.productengine.com/secondlife/pe/stable-1@1340 -> viewer-2.0.0-3
EXT-269 EXT-274 EXT-276 EXT-277 EXT-282 EXT-296 EXT-342 EXT-370 EXT-379 EXT-394 EXT-398 EXT-405 EXT-407 EXT-410 EXT-413 EXT-414 EXT-450 EXT-456 EXT-477 EXT-482 EXT-496
Diffstat (limited to 'indra/newview/llsyswellwindow.cpp')
-rw-r--r-- | indra/newview/llsyswellwindow.cpp | 50 |
1 files changed, 23 insertions, 27 deletions
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index c8eea5e7b4..bf1cd7002e 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -36,7 +36,7 @@ #include "llbottomtray.h" #include "llviewercontrol.h" - +#include "llviewerwindow.h" //--------------------------------------------------------------------------------- LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLFloater(LLSD()), @@ -44,19 +44,18 @@ LLSysWellWindow::LLSysWellWindow(const LLSD& key) : LLFloater(LLSD()), mScrollContainer(NULL), mNotificationList(NULL) { - // Ho to use: - // LLFloaterReg::showInstance("syswell_window"); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_sys_well.xml", NULL); } //--------------------------------------------------------------------------------- BOOL LLSysWellWindow::postBuild() { - mCloseBtn = getChild<LLButton>("close_btn"); mScrollContainer = getChild<LLScrollContainer>("notification_list_container"); mNotificationList = getChild<LLScrollingPanelList>("notification_list"); - mCloseBtn->setClickedCallback(boost::bind(&LLSysWellWindow::onClickCloseBtn,this)); + //gViewerWindow->setOnBottomTrayWidthChanged(boost::bind(&LLSysWellWindow::adjustWindowPosition, this)); // *TODO: won't be necessary after docking is realized + mScrollContainer->setBorderVisible(FALSE); + + mDockTongue = LLUI::getUIImage("windows/Flyout_Pointer.png"); return TRUE; } @@ -76,7 +75,7 @@ void LLSysWellWindow::addItem(LLSysWellItem::Params p) LLSysWellItem* new_item = new LLSysWellItem(p); mNotificationList->addPanel(dynamic_cast<LLScrollingPanel*>(new_item)); reshapeWindow(); - adjustWindowPosition(); + //adjustWindowPosition(); // *TODO: won't be necessary after docking is realized new_item->setOnItemCloseCallback(boost::bind(&LLSysWellWindow::onItemClose, this, _1)); new_item->setOnItemClickCallback(boost::bind(&LLSysWellWindow::onItemClick, this, _1)); @@ -95,14 +94,12 @@ S32 LLSysWellWindow::findItemByID(const LLUUID& id) if(list.size() == 0) return -1; - LLScrollingPanelList::panel_list_t::const_iterator it = list.begin(); + LLScrollingPanelList::panel_list_t::const_iterator it; S32 index = 0; - while(it != list.end()) + for(it = list.begin(); it != list.end(); ++it, ++index) { if( dynamic_cast<LLSysWellItem*>(*it)->getID() == id ) break; - ++it; - ++index; } if(it == list.end()) @@ -123,7 +120,7 @@ void LLSysWellWindow::removeItemByID(const LLUUID& id) return; reshapeWindow(); - adjustWindowPosition(); + //adjustWindowPosition(); // *TODO: won't be necessary after docking is realized // hide chiclet window if there are no items left S32 items_left = mNotificationList->getPanelList().size(); if(items_left == 0) @@ -146,9 +143,9 @@ void LLSysWellWindow::onItemClose(LLSysWellItem* item) } //--------------------------------------------------------------------------------- -void LLSysWellWindow::onClickCloseBtn() +void LLSysWellWindow::toggleWindow() { - setVisible(false); + setVisible(!getVisible()); } //--------------------------------------------------------------------------------- @@ -158,14 +155,14 @@ void LLSysWellWindow::setVisible(BOOL visible) if(visible) { mChannel->removeAndStoreAllVisibleToasts(); - adjustWindowPosition(); + //adjustWindowPosition(); // *TODO: won't be necessary after docking is realized } LLFloater::setVisible(visible); } //--------------------------------------------------------------------------------- -void LLSysWellWindow::adjustWindowPosition() +void LLSysWellWindow::adjustWindowPosition() // *TODO: won't be necessary after docking is realized { const S32 WINDOW_MARGIN = 5; @@ -176,32 +173,31 @@ void LLSysWellWindow::adjustWindowPosition() //--------------------------------------------------------------------------------- void LLSysWellWindow::reshapeWindow() { - // Get scrollbar size + // Get size for scrollbar and floater's header const LLUICachedControl<S32> SCROLLBAR_SIZE("UIScrollbarSize", 0); + const LLUICachedControl<S32> HEADER_SIZE("UIFloaterHeaderSize", 0); // Get item list const LLScrollingPanelList::panel_list_t list = mNotificationList->getPanelList(); - // window's size constants - const S32 WINDOW_HEADER_HEIGHT = 30; - const S32 MAX_WINDOW_HEIGHT = 200; - const S32 MIN_WINDOW_WIDTH = 320; - - // Get height and border's width for a scrolling panel list - S32 list_height = mNotificationList->getRect().getHeight(); - S32 list_border_width = mScrollContainer->getBorderWidth() * 2; + // Get height for a scrolling panel list + S32 list_height = mNotificationList->getRect().getHeight(); // Check that the floater doesn't exceed its parent view limits after reshape - S32 new_height = list_height + WINDOW_HEADER_HEIGHT + list_border_width; + S32 new_height = list_height + LLScrollingPanelList::GAP_BETWEEN_PANELS + HEADER_SIZE; if(new_height > MAX_WINDOW_HEIGHT) { - reshape(MIN_WINDOW_WIDTH + SCROLLBAR_SIZE, MAX_WINDOW_HEIGHT, FALSE); + reshape(MIN_WINDOW_WIDTH, MAX_WINDOW_HEIGHT, FALSE); + mNotificationList->reshape(MIN_PANELLIST_WIDTH - SCROLLBAR_SIZE, list_height, TRUE); } else { reshape(MIN_WINDOW_WIDTH, new_height, FALSE); + mNotificationList->reshape(MIN_PANELLIST_WIDTH, list_height, TRUE); } + + mNotificationList->updatePanels(TRUE); } //--------------------------------------------------------------------------------- |