From 03b836d94f0f09936af887302db7e19f45881f01 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 19 Oct 2011 17:25:18 -0700 Subject: EXP-1424 FIX Floaters open on top of one another in default position with no offset EXP-1412 FIX Additional Inventory windows are opened directly on top of each after opening additional inventory windows and closing the first time also made sidepanel floaters reuse the existing instances, saving state --- indra/llui/llfloater.cpp | 23 +++++++++++++++++++---- indra/llui/llfloater.h | 2 ++ indra/llui/llfloaterreg.cpp | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 3085921e04..29d05b8002 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -165,6 +165,7 @@ LLFloater::Params::Params() : title("title"), short_title("short_title"), single_instance("single_instance", false), + reuse_instance("reuse_instance", false), can_resize("can_resize", false), can_minimize("can_minimize", true), can_close("can_close", true), @@ -239,6 +240,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mTitle(p.title), mShortTitle(p.short_title), mSingleInstance(p.single_instance), + mReuseInstance(p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance), // reuse single-instance floaters by default mKey(key), mCanTearOff(p.can_tear_off), mCanMinimize(p.can_minimize), @@ -776,12 +778,19 @@ void LLFloater::closeFloater(bool app_quitting) else { setVisible(FALSE); + if (!mReuseInstance) + { + destroy(); + } } } else { setVisible(FALSE); // hide before destroying (so handleVisibilityChange() gets called) - destroy(); + if (!mReuseInstance) + { + destroy(); + } } } } @@ -861,9 +870,15 @@ bool LLFloater::applyRectControl() { bool saved_rect = false; - // If we have a saved rect, use it - if (mRectControl.size() > 1) + if (LLFloaterReg::getLastFloaterInGroup(mInstanceName)) + { + // other floaters in our group, position ourselves relative to them and don't save the rect + mRectControl.clear(); + mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_CASCADING; + } + else if (mRectControl.size() > 1) { + // If we have a saved rect, use it const LLRect& rect = getControlGroup()->getRect(mRectControl); saved_rect = rect.notEmpty(); if (saved_rect) @@ -2949,6 +2964,7 @@ void LLFloater::initFromParams(const LLFloater::Params& p) mHeaderHeight = p.header_height; mLegacyHeaderHeight = p.legacy_header_height; mSingleInstance = p.single_instance; + mReuseInstance = p.reuse_instance.isProvided() ? p.reuse_instance : p.single_instance; mOpenPositioning = p.open_positioning; mSpecifiedLeft = p.specified_left; @@ -3230,7 +3246,6 @@ void LLFloater::stackWith(LLFloater& other) next_rect.setLeftTopAndSize(next_rect.mLeft, next_rect.mTop, getRect().getWidth(), getRect().getHeight()); - mRectControl.clear(); // don't save rect of stacked floaters setShape(next_rect); } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index f610b04e35..f384e64e53 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -120,6 +120,7 @@ public: short_title; Optional single_instance, + reuse_instance, can_resize, can_minimize, can_close, @@ -409,6 +410,7 @@ private: LLUIString mShortTitle; BOOL mSingleInstance; // TRUE if there is only ever one instance of the floater + bool mReuseInstance; // true if we want to hide the floater when we close it instead of destroying it std::string mInstanceName; // Store the instance name so we can remove ourselves from the list BOOL mCanTearOff; diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index df3cff9968..e144b68f5e 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -167,6 +167,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) res->setInstanceName(name); LLFloater *last_floater = (list.empty() ? NULL : list.back()); + res->applyControlsAndPosition(last_floater); gFloaterView->adjustToFitScreen(res, false); -- cgit v1.2.3 From f3a4a48d8ed20b4bbd65d7cdb9b191c9faf2544b Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 19 Oct 2011 17:33:10 -0700 Subject: * Fixed issue where dragging disabled buttons from the toybox to the toybox would remove them from the surrounding toolbars. * Removed dead drag & drop code * Fixed issue where saving didn't necessarily work because toolbar populated with command id's that didn't have associated names. --- indra/llui/lltoolbar.cpp | 10 +++++----- indra/llui/lltoolbar.h | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'indra/llui') diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index c559a2bf1d..bceda9bf54 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -217,7 +217,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank) if ((rank >= mButtonCommands.size()) || (rank == RANK_NONE)) { // In that case, back load - mButtonCommands.push_back(commandId); + mButtonCommands.push_back(command->id()); mButtons.push_back(button); } else @@ -232,7 +232,7 @@ bool LLToolBar::addCommand(const LLCommandId& commandId, int rank) rank--; } // ...then insert - mButtonCommands.insert(it_command,commandId); + mButtonCommands.insert(it_command, command->id()); mButtons.insert(it_button,button); } @@ -821,7 +821,7 @@ LLToolBarButton* LLToolBar::createButton(const LLCommandId& id) if (!commandp) return NULL; LLToolBarButton::Params button_p; - button_p.name = id.name(); + button_p.name = commandp->id().name(); // Make sure to retrieve the name from the command itself, not the passed in id button_p.label = LLTrans::getString(commandp->labelRef()); button_p.tool_tip = LLTrans::getString(commandp->tooltipRef()); button_p.image_overlay = LLUI::getUIImage(commandp->icon()); @@ -999,13 +999,13 @@ BOOL LLToolBarButton::handleHover(S32 x, S32 y, MASK mask) { if (!mIsDragged) { - mStartDragItemCallback(x,y,mId.uuid()); + mStartDragItemCallback(x, y, this); mIsDragged = true; handled = TRUE; } else { - handled = mHandleDragItemCallback(x,y,mId.uuid(),LLAssetType::AT_WIDGET); + handled = mHandleDragItemCallback(x, y, mId.uuid(), LLAssetType::AT_WIDGET); } } else diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index ad42d1fa35..e634e57f93 100644 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -36,8 +36,9 @@ #include "llassettype.h" class LLToolBar; +class LLToolBarButton; -typedef boost::function tool_startdrag_callback_t; +typedef boost::function tool_startdrag_callback_t; typedef boost::function tool_handledrag_callback_t; typedef boost::function tool_handledrop_callback_t; -- cgit v1.2.3 From ea1c3218e2ca70623ef348dcae36d667e095394f Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 19 Oct 2011 17:47:05 -0700 Subject: EXP-1411 FIX "Speak" button enabled in regions with disabled voice EXP-1424 FIX Floaters open on top of one another in default position with no offset floaters now stack with their own kind preferentially --- indra/llui/llfloater.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 29d05b8002..c1faa304a8 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -685,7 +685,12 @@ void LLFloater::openFloater(const LLSD& key) } else { - applyControlsAndPosition(LLFloaterReg::getLastFloaterCascading()); + LLFloater* floater_to_stack = LLFloaterReg::getLastFloaterInGroup(mInstanceName); + if (!floater_to_stack) + { + floater_to_stack = LLFloaterReg::getLastFloaterCascading(); + } + applyControlsAndPosition(floater_to_stack); setMinimized(FALSE); setVisibleAndFrontmost(mAutoFocus); } -- cgit v1.2.3 From a6dedd63f9ff6c860e470a4bb7e3fda4aded3004 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 19 Oct 2011 17:56:00 -0700 Subject: EXP-1424 FIX Floaters open on top of one another in default position with no offset floaters only stack on floaters that haven't moved --- indra/llui/llfloater.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index c1faa304a8..9b28ab4bb5 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1071,6 +1071,7 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user) if (by_user) { storeRectControl(); + mOpenPositioning = LLFloaterEnums::OPEN_POSITIONING_NONE; } // if not minimized, adjust all snapped dependents to new shape -- cgit v1.2.3 From 6d7ab5d1346a8c91563a83d0a5eee912d36a1488 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 19 Oct 2011 18:06:48 -0700 Subject: EXP-1428 FIX Snapshot button does not toggle floater closed --- indra/llui/llfloater.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 9b28ab4bb5..0749093777 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1403,7 +1403,10 @@ void LLFloater::moveResizeHandlesToFront() BOOL LLFloater::isFrontmost() { - return gFloaterView && gFloaterView->getFrontmost() == this && getVisible(); + LLFloaterView* floater_view = getParentByType(); + return getVisible() + && (floater_view + && floater_view->getFrontmost() == this); } void LLFloater::addDependentFloater(LLFloater* floaterp, BOOL reposition) -- cgit v1.2.3 From eedc8687b0d05a14e41f1601d2ee615c69d132d0 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 19 Oct 2011 18:45:22 -0700 Subject: EXP-1364 FIX Debug console output covered by left toolbar buttons if present EXP-1427 FIX Voice Settings dialog closes when selecting minimize option --- indra/llui/lldockablefloater.cpp | 7 ++++++- indra/llui/llfloater.cpp | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/llui') diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index ca2dc644a4..aea58be12a 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -162,10 +162,15 @@ void LLDockableFloater::setVisible(BOOL visible) void LLDockableFloater::setMinimized(BOOL minimize) { - if(minimize) + if(minimize && isDocked()) { + // minimizing a docked floater just hides it setVisible(FALSE); } + else + { + LLFloater::setMinimized(minimize); + } } LLView * LLDockableFloater::getDockWidget() diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 0749093777..bd537bfb19 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1479,6 +1479,7 @@ BOOL LLFloater::handleMouseDown(S32 x, S32 y, MASK mask) if(offerClickToButton(x, y, mask, BUTTON_CLOSE)) return TRUE; if(offerClickToButton(x, y, mask, BUTTON_RESTORE)) return TRUE; if(offerClickToButton(x, y, mask, BUTTON_TEAR_OFF)) return TRUE; + if(offerClickToButton(x, y, mask, BUTTON_DOCK)) return TRUE; // Otherwise pass to drag handle for movement return mDragHandle->handleMouseDown(x, y, mask); @@ -1584,6 +1585,12 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock) { mDocked = docked; mButtonsEnabled[BUTTON_DOCK] = !mDocked; + + if (mDocked) + { + setMinimized(FALSE); + } + updateTitleButtons(); storeDockStateControl(); -- cgit v1.2.3