From bb79bbf3209fbb962ca1b284076738eb5ba6019c Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 19 Jan 2012 13:53:48 -0800 Subject: EXP-1827 FIX -- Drag area in outbox does not always highlight green when indicating a top level drop * Updated the outbox drop area highlight to include top level drops within the outbox inventory panel itself. --- indra/newview/llfloateroutbox.cpp | 55 +++++++++++++++------------------------ 1 file changed, 21 insertions(+), 34 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 08cd8082aa..540f977305 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -376,44 +376,37 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, LLView * handled_view = childrenHandleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); BOOL handled = (handled_view != NULL); + + // Determine if the mouse is inside the inventory panel itself or just within the floater + bool pointInInventoryPanel = false; + bool pointInInventoryPanelChild = false; + LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder(); + if (mOutboxInventoryPanel->getVisible()) + { + S32 inv_x, inv_y; + localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel); + + pointInInventoryPanel = mOutboxInventoryPanel->getRect().pointInRect(inv_x, inv_y); + + LLView * inventory_panel_child_at_point = mOutboxInventoryPanel->childFromPoint(inv_x, inv_y, true); + pointInInventoryPanelChild = (inventory_panel_child_at_point != root_folder); + } // Pass all drag and drop for this floater to the outbox inventory control if (!handled || !isAccepted(*accept)) { - // Always assume we are going to move the drag and drop operation to the outbox root folder - bool move_to_root = true; - - // If the inventory panel is visible, then only override it to the outbox root if we're outside the inventory panel + // Handle the drag and drop directly to the root of the outbox if we're not in the inventory panel // (otherwise the inventory panel itself will handle the drag and drop operation, without any override) - if (mOutboxInventoryPanel->getVisible()) - { - S32 inv_x, inv_y; - localPointToOtherView(x, y, &inv_x, &inv_y, mOutboxInventoryPanel); - - const LLRect& inv_rect = mOutboxInventoryPanel->getRect(); - - move_to_root = !inv_rect.pointInRect(inv_x, inv_y); - } - - // Handle the drag and drop directly to the root of the outbox - if (move_to_root) + if (!pointInInventoryPanel) { - LLFolderView * root_folder = mOutboxInventoryPanel->getRootFolder(); - handled = root_folder->handleDragAndDropToThisFolder(mask, drop, cargo_type, cargo_data, accept, tooltip_msg); } - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept)); - } + mOutboxTopLevelDropZone->setBackgroundVisible(handled && !drop && isAccepted(*accept)); } else { - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); - } + mOutboxTopLevelDropZone->setBackgroundVisible(!pointInInventoryPanelChild); } return handled; @@ -421,20 +414,14 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, BOOL LLFloaterOutbox::handleHover(S32 x, S32 y, MASK mask) { - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); - } + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); return LLFloater::handleHover(x, y, mask); } void LLFloaterOutbox::onMouseLeave(S32 x, S32 y, MASK mask) { - if (mOutboxTopLevelDropZone) - { - mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); - } + mOutboxTopLevelDropZone->setBackgroundVisible(FALSE); LLFloater::onMouseLeave(x, y, mask); } -- cgit v1.2.3 From 00fc2d5a5c24b1cf2aedd81090bf769207fbf41b Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 19 Jan 2012 13:54:32 -0800 Subject: * Added member variables to avoid several per-frame getChild calls. --- indra/newview/llpanelmarketplaceinbox.cpp | 19 ++++++++++++------- indra/newview/llpanelmarketplaceinbox.h | 7 +++++-- 2 files changed, 17 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index a5e964f563..66c9c323cb 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -48,6 +48,8 @@ const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams // protected LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) : LLPanel(p) + , mFreshCountCtrl(NULL) + , mInboxButton(NULL) , mInventoryPanel(NULL) { } @@ -60,6 +62,9 @@ LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() BOOL LLPanelMarketplaceInbox::postBuild() { LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); + + mFreshCountCtrl = getChild("inbox_fresh_new_count"); + mInboxButton = getChild("inbox_btn"); return TRUE; } @@ -216,7 +221,7 @@ void LLPanelMarketplaceInbox::draw() { U32 item_count = getTotalItemCount(); - LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count"); + llassert(mFreshCountCtrl != NULL); if (item_count > 0) { @@ -224,26 +229,26 @@ void LLPanelMarketplaceInbox::draw() LLStringUtil::format_map_t args; args["[NUM]"] = item_count_str; - getChild("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); + mInboxButton->setLabel(getString("InboxLabelWithArg", args)); #if SUPPORTING_FRESH_ITEM_COUNT // set green text to fresh item count U32 fresh_item_count = getFreshItemCount(); - fresh_new_count_view->setVisible((fresh_item_count > 0)); + mFreshCountCtrl->setVisible((fresh_item_count > 0)); if (fresh_item_count > 0) { - getChild("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count)); + mFreshCountCtrl->setTextArg("[NUM]", llformat("%d", fresh_item_count)); } #else - fresh_new_count_view->setVisible(FALSE); + mFreshCountCtrl->setVisible(FALSE); #endif } else { - getChild("inbox_btn")->setLabel(getString("InboxLabelNoArg")); + mInboxButton->setLabel(getString("InboxLabelNoArg")); - fresh_new_count_view->setVisible(FALSE); + mFreshCountCtrl->setVisible(FALSE); } LLPanel::draw(); diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 3531518e51..9eb74581a2 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -29,7 +29,9 @@ #include "llpanel.h" +class LLButton; class LLInventoryPanel; +class LLUICtrl; class LLPanelMarketplaceInbox : public LLPanel { @@ -66,9 +68,10 @@ private: void onFocusReceived(); private: - LLInventoryPanel* mInventoryPanel; + LLUICtrl * mFreshCountCtrl; + LLButton * mInboxButton; + LLInventoryPanel * mInventoryPanel; }; #endif //LL_LLPANELMARKETPLACEINBOX_H - -- cgit v1.2.3 From bcdecbdae1510a55d5406a85786bab399e180cac Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 19 Jan 2012 14:23:01 -0800 Subject: EXP-1828 FIX -- Drag and drop to an open folder in the outbox causes it to close automatically * Updated auto-open behavior to ignore items that are already open. --- indra/newview/llfolderview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 6bf0f09747..e0d7d67f7d 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1199,7 +1199,9 @@ void LLFolderView::changeType(LLInventoryModel *model, LLFolderType::EType new_f void LLFolderView::autoOpenItem( LLFolderViewFolder* item ) { - if (mAutoOpenItems.check() == item || mAutoOpenItems.getDepth() >= (U32)AUTO_OPEN_STACK_DEPTH) + if ((mAutoOpenItems.check() == item) || + (mAutoOpenItems.getDepth() >= (U32)AUTO_OPEN_STACK_DEPTH) || + item->isOpen()) { return; } -- cgit v1.2.3 From 216ac700431af0ab7ee45ec5fef03c928f235063 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 19 Jan 2012 15:24:29 -0800 Subject: EXP-1829 FIX -- Selecting a valid item last allows other selected invalid items to be copied to Outbox with context menu option * Updated context menu default enabled state to use the last state rather than TRUE. Once per frame, the states are all reset to TRUE so this has the effect of AND'ing together successive buildContextMenu functions rather than ignoring previous states. --- indra/newview/llinventorybridge.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3929183be2..12322b2921 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -471,7 +471,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const void hide_context_entries(LLMenuGL& menu, const menuentry_vec_t &entries_to_show, - const menuentry_vec_t &disabled_entries) // If append is TRUE, then new enabled entries + const menuentry_vec_t &disabled_entries) { const LLView::child_list_t *list = menu.getChildList(); @@ -493,7 +493,6 @@ void hide_context_entries(LLMenuGL& menu, hide_context_entries(*branchp->getBranch(), entries_to_show, disabled_entries); } - bool found = false; menuentry_vec_t::const_iterator itor2; for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2) @@ -529,7 +528,7 @@ void hide_context_entries(LLMenuGL& menu, // so that some other UI element from multi-select doesn't later set this invisible. menu_item->pushVisible(TRUE); - BOOL enabled = TRUE; + BOOL enabled = menu_item->getEnabled(); for (itor2 = disabled_entries.begin(); itor2 != disabled_entries.end(); ++itor2) { if (*itor2 == name) -- cgit v1.2.3 From a662b888ed02691b7790c23e31c7d8bcf7cf7f5b Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 19 Jan 2012 19:40:46 -0800 Subject: EXP-1824 FIX Received Items panel does not collapse correct when Height of panel is maximized in Inventory window --- indra/newview/llsidepanelinventory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 3761eb5777..ccf8305c63 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -369,7 +369,7 @@ void LLSidepanelInventory::onToggleInboxBtn() const bool inbox_expanded = inboxButton->getToggleState(); // Enable user_resize on main inventory panel only when inbox is expanded - inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, inbox_expanded); + //inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, inbox_expanded); // Expand/collapse the indicated panel inv_stack->collapsePanel(inboxPanel, !inbox_expanded); -- cgit v1.2.3