diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-07-05 12:32:12 -0700 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-07-05 12:32:12 -0700 |
commit | 2f21ec48a222662351c9f8e7243673eb6a31b457 (patch) | |
tree | fc675bf188a392eeb8223dd36aa18d0ac114cd85 /indra/newview/llinventorypanel.cpp | |
parent | d9d858a7520a7f3627afbe49a19217264f8c4928 (diff) |
EXP-860 FIX -- Display NEW for items added to inbox
* Added createFolderView, createFolderViewFolder and createFolderViewItem virtuals
to LLInventoryPanel so these can be overridden by a derived class for custom display.
* Added new LLInboxInventoryPanel class that overrides createFolderViewFolder with a
LLInboxFolderViewFolder for custom display with NEW tags.
* LLInboxFolderViewFolder NEW tag is tied to the mFresh variable that currently has
no logic attached to it, meaning it remains off all the time.
Reviewed by Richard.
Diffstat (limited to 'indra/newview/llinventorypanel.cpp')
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 120 |
1 files changed, 74 insertions, 46 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 864e6a181e..49170caee8 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -216,26 +216,15 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) llwarns << "No category found that matches start_folder: " << start_folder_name << llendl; root_id = LLUUID::generateNewID(); } - - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - p.tool_tip = p.name; - p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, - LLAssetType::AT_CATEGORY, - LLInventoryType::IT_CATEGORY, - this, - NULL, - root_id); - p.use_label_suffix = params.use_label_suffix; - p.allow_multiselect = mAllowMultiSelect; - mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p); + + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + + mFolderRoot = createFolderView(new_listener, params.use_label_suffix()); } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) @@ -611,6 +600,69 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) buildNewViews(id); } +LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix) +{ + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + + LLFolderView::Params p; + + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.parent_panel = this; + p.tool_tip = p.name; + p.listener = bridge; + p.use_label_suffix = useLabelSuffix; + p.allow_multiselect = mAllowMultiSelect; + + return LLUICtrlFactory::create<LLFolderView>(p); +} + +LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +{ + LLFolderViewFolder::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.root = mFolderRoot; + params.listener = bridge; + params.tool_tip = params.name; + + return LLUICtrlFactory::create<LLFolderViewFolder>(params); +} + +LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge) +{ + LLFolderViewItem::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.creation_date = bridge->getCreationDate(); + params.root = mFolderRoot; + params.listener = bridge; + params.rect = LLRect (0, 0, 0, 0); + params.tool_tip = params.name; + + return LLUICtrlFactory::create<LLFolderViewItem>(params); +} + void LLInventoryPanel::buildNewViews(const LLUUID& id) { LLInventoryObject const* objectp = gInventory.getObject(id); @@ -649,18 +701,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) objectp->getUUID()); if (new_listener) { - LLFolderViewFolder::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.root = mFolderRoot; - params.listener = new_listener; - params.tool_tip = params.name; - LLFolderViewFolder* folderp = LLUICtrlFactory::create<LLFolderViewFolder>(params); + LLFolderViewFolder* folderp = createFolderViewFolder(new_listener); folderp->setItemSortOrder(mFolderRoot->getSortOrder()); itemp = folderp; } @@ -679,20 +720,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) if (new_listener) { - LLFolderViewItem::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.creation_date = new_listener->getCreationDate(); - params.root = mFolderRoot; - params.listener = new_listener; - params.rect = LLRect (0, 0, 0, 0); - params.tool_tip = params.name; - itemp = LLUICtrlFactory::create<LLFolderViewItem> (params); + itemp = createFolderViewItem(new_listener); } } |