diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-10-24 16:49:00 -0700 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-10-24 16:49:00 -0700 |
commit | 8d6e7fa02c0d5cd18f91ac6862079ff4fa0719d4 (patch) | |
tree | 333d111003980ee354d8bb401648debffd0c6409 /indra/llui/lltoolbar.cpp | |
parent | 28fc98dea3b65e986c0fd8ffa71a81d2db7fb700 (diff) |
* Fixed destination guide floater to display on login based on per account
"DisplayDestinationsOnInitialRun" setting or initial agent SL login.
* Added toolbar enumeration for toolbar view so queries for commands can now
indicate where the command currently is on the left, right or bottom toolbars.
* Updated toybox toolbar button tooltips to indicate where the command currently
resides in the view.
* Added unused function to allow toolbar buttons to be changed to flash
indefinitely.
Reviewed by Richard.
Diffstat (limited to 'indra/llui/lltoolbar.cpp')
-rw-r--r-- | indra/llui/lltoolbar.cpp | 61 |
1 files changed, 45 insertions, 16 deletions
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index b0a072c00e..97dc1e3316 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -113,6 +113,7 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mHandleDragItemCallback(NULL), mHandleDropCallback(NULL), mButtonAddSignal(NULL), + mButtonEnterSignal(NULL), mDragAndDropTarget(false) { mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; @@ -123,6 +124,7 @@ LLToolBar::~LLToolBar() { delete mPopupMenuHandle.get(); delete mButtonAddSignal; + delete mButtonEnterSignal; } void LLToolBar::createContextMenu() @@ -358,6 +360,23 @@ bool LLToolBar::stopCommandInProgress(const LLCommandId& commandId) return (command_button != NULL); } +bool LLToolBar::flashCommand(const LLCommandId& commandId, bool flash) +{ + LLButton * command_button = NULL; + + if (commandId != LLCommandId::null) + { + command_id_map::iterator it = mButtonMap.find(commandId.uuid()); + if (it != mButtonMap.end()) + { + command_button = it->second; + command_button->setFlashing(flash ? TRUE : FALSE); + } + } + + return (command_button != NULL); +} + BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask) { LLRect button_panel_rect; @@ -876,8 +895,7 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) button->setCommitCallback(executeParam); } - - + // Set up "is running" query callback const std::string& isRunningFunction = commandp->isRunningFunctionName(); if (isRunningFunction.length() > 0) { @@ -904,12 +922,18 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) return button; } -boost::signals2::connection LLToolBar::setButtonAddCallback(const button_add_signal_t::slot_type& cb) +boost::signals2::connection LLToolBar::setButtonAddCallback(const button_signal_t::slot_type& cb) { - if (!mButtonAddSignal) mButtonAddSignal = new button_add_signal_t(); + if (!mButtonAddSignal) mButtonAddSignal = new button_signal_t(); return mButtonAddSignal->connect(cb); } +boost::signals2::connection LLToolBar::setButtonEnterCallback(const button_signal_t::slot_type& cb) +{ + if (!mButtonEnterSignal) mButtonEnterSignal = new button_signal_t(); + return mButtonEnterSignal->connect(cb); +} + BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, @@ -981,8 +1005,6 @@ LLToolBarButton::LLToolBarButton(const Params& p) mOriginalImageOverlayColor(p.image_overlay_color), mOriginalImageOverlaySelectedColor(p.image_overlay_selected_color) { - mButtonFlashRate = 0.0; - mButtonFlashCount = 0; } LLToolBarButton::~LLToolBarButton() @@ -1024,6 +1046,7 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask) { handled = LLButton::handleHover(x, y, mask); } + return handled; } @@ -1036,6 +1059,12 @@ void LLToolBarButton::onMouseEnter(S32 x, S32 y, MASK mask) { mNeedsHighlight = TRUE; } + + LLToolBar* parent_toolbar = getParentByType<LLToolBar>(); + if (parent_toolbar && parent_toolbar->mButtonEnterSignal) + { + (*(parent_toolbar->mButtonEnterSignal))(this); + } } void LLToolBarButton::onMouseCaptureLost() @@ -1084,25 +1113,25 @@ void LLToolBarButton::setEnabled(BOOL enabled) } } - const std::string LLToolBarButton::getToolTip() const { std::string tooltip; + if (labelIsTruncated() || getCurrentLabel().empty()) { - return LLTrans::getString(LLCommandManager::instance().getCommand(mId)->labelRef()) + " -- " + LLView::getToolTip(); + tooltip = LLTrans::getString(LLCommandManager::instance().getCommand(mId)->labelRef()) + " -- " + LLView::getToolTip(); } else { - return LLView::getToolTip(); + tooltip = LLView::getToolTip(); } -} - - - - - - + LLToolBar* parent_toolbar = getParentByType<LLToolBar>(); + if (parent_toolbar && parent_toolbar->mButtonTooltipSuffix.length() > 0) + { + tooltip = tooltip + "\n(" + parent_toolbar->mButtonTooltipSuffix + ")"; + } + return tooltip; +} |