From 30527b2206e7fce2890c3c44825ff0bef85aa5a0 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 18 Oct 2011 14:09:52 -0700 Subject: EXP-1409 FIX WASD controls don't move avatar while Move floater is in focus moved "chrome" flags to xui separated hiding floater title from setting chrome toolbar toggle button now moves floaters to frontmost and doesn't necessarily rely on focus --- indra/llui/llfloater.cpp | 22 +++++++--------------- indra/llui/llfloater.h | 4 ++-- indra/llui/llfloaterreg.cpp | 8 ++++---- 3 files changed, 13 insertions(+), 21 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d1d840729d..869ad4410b 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -174,6 +174,7 @@ LLFloater::Params::Params() save_rect("save_rect", false), save_visibility("save_visibility", false), can_dock("can_dock", false), + show_title("show_title", true), open_positioning("open_positioning", LLFloaterEnums::OPEN_POSITIONING_NONE), specified_left("specified_left"), specified_bottom("specified_bottom"), @@ -1142,10 +1143,6 @@ void LLFloater::setMinimized(BOOL minimize) mButtonsEnabled[BUTTON_RESTORE] = TRUE; } - if (mDragHandle) - { - mDragHandle->setVisible(TRUE); - } setBorderVisible(TRUE); for(handle_set_iter_t dependent_it = mDependents.begin(); @@ -1296,19 +1293,9 @@ void LLFloater::setIsChrome(BOOL is_chrome) mButtons[BUTTON_CLOSE]->setToolTip(LLStringExplicit(getButtonTooltip(Params(), BUTTON_CLOSE, is_chrome))); } - // no titles displayed on "chrome" floaters - if (mDragHandle) - mDragHandle->setTitleVisible(!is_chrome); - LLPanel::setIsChrome(is_chrome); } -void LLFloater::setTitleVisible(bool visible) -{ - if (mDragHandle) - mDragHandle->setTitleVisible(visible); -} - // Change the draw style to account for the foreground state. void LLFloater::setForeground(BOOL front) { @@ -1812,7 +1799,7 @@ void LLFloater::draw() { drawChild(mButtons[i]); } - drawChild(mDragHandle); + drawChild(mDragHandle, 0, 0, TRUE); } else { @@ -2991,6 +2978,11 @@ void LLFloater::initFromParams(const LLFloater::Params& p) { setCloseCallback(initCommitCallback(p.close_callback)); } + + if (mDragHandle) + { + mDragHandle->setTitleVisible(p.show_title); + } } boost::signals2::connection LLFloater::setMinimizeCallback( const commit_signal_t::slot_type& cb ) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 8beb11507e..f610b04e35 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -128,7 +128,8 @@ public: save_rect, save_visibility, save_dock_state, - can_dock; + can_dock, + show_title; Optional open_positioning; Optional specified_left; @@ -209,7 +210,6 @@ public: std::string getTitle() const; void setShortTitle( const std::string& short_title ); std::string getShortTitle() const; - void setTitleVisible(bool visible); virtual void setMinimized(BOOL b); void moveResizeHandlesToFront(); void addDependentFloater(LLFloater* dependent, BOOL reposition = TRUE); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 0edfc8da2d..df3cff9968 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -462,16 +462,16 @@ void LLFloaterReg::toggleInstanceOrBringToFront(const LLSD& sdname, const LLSD& else if (instance->isMinimized()) { instance->setMinimized(FALSE); - instance->setFocus(TRUE); + instance->setVisibleAndFrontmost(); } else if (!instance->isShown()) { instance->openFloater(key); - instance->setFocus(TRUE); + instance->setVisibleAndFrontmost(); } - else if (!instance->hasFocus() && !instance->getIsChrome()) + else if (!instance->isFrontmost()) { - instance->setFocus(TRUE); + instance->setVisibleAndFrontmost(); } else { -- cgit v1.2.3 From b1016782a20d43c383b2d07660433c05640d39b8 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 18 Oct 2011 16:43:43 -0700 Subject: EXP-1367 FIX Moving in and out of mouselook causes location bar to move down --- indra/llui/lllayoutstack.cpp | 17 +++++++++++++++-- indra/llui/lllayoutstack.h | 13 +------------ 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 4991c4afa6..0e7060e22c 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -47,6 +47,19 @@ void LLLayoutStack::OrientationNames::declareValues() // // LLLayoutPanel // +LLLayoutPanel::Params::Params() +: expanded_min_dim("expanded_min_dim", 0), + min_dim("min_dim", 0), + max_dim("max_dim", S32_MAX), + user_resize("user_resize", true), + auto_resize("auto_resize", true) +{ + addSynonym(min_dim, "min_width"); + addSynonym(min_dim, "min_height"); + addSynonym(max_dim, "max_width"); + addSynonym(max_dim, "max_height"); +} + LLLayoutPanel::LLLayoutPanel(const Params& p) : LLPanel(p), mExpandedMinDimSpecified(false), @@ -527,8 +540,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize) // not enough room to fit existing contents if (force_resize == FALSE // layout did not complete by reaching target position - && ((mOrientation == VERTICAL && cur_y != -mPanelSpacing) - || (mOrientation == HORIZONTAL && cur_x != getRect().getWidth() + mPanelSpacing))) + && ((mOrientation == VERTICAL && llround(cur_y) != -mPanelSpacing) + || (mOrientation == HORIZONTAL && llround(cur_x) != getRect().getWidth() + mPanelSpacing))) { // do another layout pass with all stacked elements contributing // even those that don't usually resize diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 5d79505fc3..ede6149a80 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -161,18 +161,7 @@ public: Optional user_resize, auto_resize; - Params() - : expanded_min_dim("expanded_min_dim", 0), - min_dim("min_dim", 0), - max_dim("max_dim", 0), - user_resize("user_resize", true), - auto_resize("auto_resize", true) - { - addSynonym(min_dim, "min_width"); - addSynonym(min_dim, "min_height"); - addSynonym(max_dim, "max_width"); - addSynonym(max_dim, "max_height"); - } + Params(); }; ~LLLayoutPanel(); -- cgit v1.2.3 From d6be2b49041c3ea51205bdd5a0ea7890afb9a5e5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 18 Oct 2011 17:11:05 -0700 Subject: EXP-1348 FIX -- Speak button activated when dragging and dropping between toolbars and moving back to Tool box * Dragging and dropping the speak button will aggressively turn off the microphone now, regardless of the initial state of the button. Reviewed by Richard. --- indra/llui/lltoolbar.cpp | 45 ++++++++++++++++++++++++++++++++++++++++++++- indra/llui/lltoolbar.h | 1 + 2 files changed, 45 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 629c7d9bc7..c559a2bf1d 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -302,7 +302,50 @@ bool LLToolBar::enableCommand(const LLCommandId& commandId, bool enabled) command_id_map::iterator it = mButtonMap.find(commandId.uuid()); if (it != mButtonMap.end()) { - it->second->setEnabled(enabled); + command_button = it->second; + command_button->setEnabled(enabled); + } + } + + return (command_button != NULL); +} + +bool LLToolBar::stopCommandInProgress(const LLCommandId& commandId) +{ + // + // Note from Leslie: + // + // This implementation was largely put in place to handle EXP-1348 which is related to + // dragging and dropping the "speak" button. The "speak" button can be in one of two + // modes, i.e., either a toggle action or a push-to-talk action. Because of this it + // responds to mouse down and mouse up in different ways, based on which behavior the + // button is currently set to obey. This was the simplest way of getting the button + // to turn off the microphone for both behaviors without risking duplicate state. + // + + LLToolBarButton * command_button = NULL; + + if (commandId != LLCommandId::null) + { + LLCommand* command = LLCommandManager::instance().getCommand(commandId); + llassert(command); + + // If this command has an explicit function for execution stop + if (command->executeStopFunctionName().length() > 0) + { + command_id_map::iterator it = mButtonMap.find(commandId.uuid()); + if (it != mButtonMap.end()) + { + command_button = it->second; + llassert(command_button->mIsRunningSignal); + + // Check to see if it is running + if ((*command_button->mIsRunningSignal)(command_button, command->isRunningParameters())) + { + // Trigger an additional button commit, which calls mouse down, mouse up and commit + command_button->onCommit(); + } + } } } diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 616710ea70..ad42d1fa35 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -185,6 +185,7 @@ public: int removeCommand(const LLCommandId& commandId); // Returns the rank the removed command was at, RANK_NONE if not found bool hasCommand(const LLCommandId& commandId) const; bool enableCommand(const LLCommandId& commandId, bool enabled); + bool stopCommandInProgress(const LLCommandId& commandId); void setStartDragCallback(tool_startdrag_callback_t cb) { mStartDragItemCallback = cb; } void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } -- cgit v1.2.3 From 526185b755f95e33bdf9380ec7b9b3b8d75fb9a2 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 18 Oct 2011 17:34:15 -0700 Subject: EXP-1358 FIX Hitting back in the Create group panel or Blocked panel requires multiple clicks for action to occur --- indra/llui/lltabcontainer.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 9c6a76822c..ad1f3c504d 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -548,23 +548,23 @@ BOOL LLTabContainer::handleMouseDown( S32 x, S32 y, MASK mask ) } S32 tab_count = getTabCount(); - if (tab_count > 0) + if (tab_count > 0 && !getTabsHidden()) { LLTabTuple* firsttuple = getTab(0); LLRect tab_rect; if (mIsVertical) { tab_rect = LLRect(firsttuple->mButton->getRect().mLeft, - has_scroll_arrows ? mPrevArrowBtn->getRect().mBottom - tabcntrv_pad : mPrevArrowBtn->getRect().mTop, - firsttuple->mButton->getRect().mRight, - has_scroll_arrows ? mNextArrowBtn->getRect().mTop + tabcntrv_pad : mNextArrowBtn->getRect().mBottom ); + has_scroll_arrows ? mPrevArrowBtn->getRect().mBottom - tabcntrv_pad : mPrevArrowBtn->getRect().mTop, + firsttuple->mButton->getRect().mRight, + has_scroll_arrows ? mNextArrowBtn->getRect().mTop + tabcntrv_pad : mNextArrowBtn->getRect().mBottom ); } else { tab_rect = LLRect(has_scroll_arrows ? mPrevArrowBtn->getRect().mRight : mJumpPrevArrowBtn->getRect().mLeft, - firsttuple->mButton->getRect().mTop, - has_scroll_arrows ? mNextArrowBtn->getRect().mLeft : mJumpNextArrowBtn->getRect().mRight, - firsttuple->mButton->getRect().mBottom ); + firsttuple->mButton->getRect().mTop, + has_scroll_arrows ? mNextArrowBtn->getRect().mLeft : mJumpNextArrowBtn->getRect().mRight, + firsttuple->mButton->getRect().mBottom ); } if( tab_rect.pointInRect( x, y ) ) { @@ -681,7 +681,7 @@ BOOL LLTabContainer::handleToolTip( S32 x, S32 y, MASK mask) { static LLUICachedControl tabcntrv_pad ("UITabCntrvPad", 0); BOOL handled = LLPanel::handleToolTip( x, y, mask); - if (!handled && getTabCount() > 0) + if (!handled && getTabCount() > 0 && !getTabsHidden()) { LLTabTuple* firsttuple = getTab(0); @@ -812,7 +812,9 @@ BOOL LLTabContainer::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDrag { BOOL has_scroll_arrows = (getMaxScrollPos() > 0); - if( mDragAndDropDelayTimer.getStarted() && mDragAndDropDelayTimer.getElapsedTimeF32() > SCROLL_DELAY_TIME ) + if( !getTabsHidden() + && mDragAndDropDelayTimer.getStarted() + && mDragAndDropDelayTimer.getElapsedTimeF32() > SCROLL_DELAY_TIME ) { if (has_scroll_arrows) { -- cgit v1.2.3 From bb3f1e3d7ac300d300e91dfff887098816af27e5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 18 Oct 2011 18:51:17 -0700 Subject: EXP-1406 FIX Scrolling using mousewheel not working to scroll in inventory and people panels --- indra/llui/llview.cpp | 6 +++--- indra/llui/llview.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index fdb84f1ec5..3fd7e48428 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -721,7 +721,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m // XDATA might be MASK, or S32 clicks template -LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra) +LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block) { BOOST_FOREACH(LLView* viewp, mChildList) { @@ -734,7 +734,7 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA } if ((viewp->*method)( local_x, local_y, extra ) - || viewp->blockMouseEvent( local_x, local_y )) + || (allow_mouse_block && viewp->blockMouseEvent( local_x, local_y ))) { viewp->logMouseEvent(); return viewp; @@ -1021,7 +1021,7 @@ BOOL LLView::handleMiddleMouseUp(S32 x, S32 y, MASK mask) LLView* LLView::childrenHandleScrollWheel(S32 x, S32 y, S32 clicks) { - return childrenHandleMouseEvent(&LLView::handleScrollWheel, x, y, clicks); + return childrenHandleMouseEvent(&LLView::handleScrollWheel, x, y, clicks, false); } // Called during downward traversal diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 6d1dda90af..08828e55e6 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -565,7 +565,7 @@ protected: private: template - LLView* childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra); + LLView* childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block = true); template LLView* childrenHandleCharEvent(const std::string& desc, const METHOD& method, -- cgit v1.2.3 From ccabbec51c87b27d204e49a6bcad72e7ad7aa095 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 19 Oct 2011 13:28:15 -0700 Subject: floaters only save rect when explicitly moved by user --- indra/llui/llfloater.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 869ad4410b..3085921e04 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -539,7 +539,6 @@ LLFloater::~LLFloater() delete mResizeHandle[i]; } - storeRectControl(); setVisible(false); // We're not visible if we're destroyed storeVisibilityControl(); storeDockStateControl(); -- cgit v1.2.3