summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloateroutbox.cpp55
-rw-r--r--indra/newview/llfolderview.cpp4
-rw-r--r--indra/newview/llinventorybridge.cpp5
-rw-r--r--indra/newview/llpanelmarketplaceinbox.cpp19
-rw-r--r--indra/newview/llpanelmarketplaceinbox.h7
-rw-r--r--indra/newview/llsidepanelinventory.cpp2
6 files changed, 44 insertions, 48 deletions
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);
}
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;
}
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)
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<LLUICtrl>("inbox_fresh_new_count");
+ mInboxButton = getChild<LLButton>("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<LLButton>("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<LLUICtrl>("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<LLButton>("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
-
diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp
index e1043c34c7..b337eaf6be 100644
--- a/indra/newview/llsidepanelinventory.cpp
+++ b/indra/newview/llsidepanelinventory.cpp
@@ -371,7 +371,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);