diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llui/llfolderview.cpp | 5 | ||||
-rw-r--r-- | indra/llui/llfolderviewitem.h | 2 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.cpp | 20 | ||||
-rw-r--r-- | indra/newview/llinventorypanel.h | 3 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llpanelmaininventory.h | 1 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_main_inventory.xml | 4 |
7 files changed, 48 insertions, 3 deletions
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp index 5170816671..46a7057240 100644 --- a/indra/llui/llfolderview.cpp +++ b/indra/llui/llfolderview.cpp @@ -1273,6 +1273,11 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) if(mSelectedItems.size()) { LLFolderViewItem* last_selected = getCurSelectedItem(); + if(last_selected && last_selected->isSingleFolderMode()) + { + handled = FALSE; + break; + } LLFolderViewItem* parent_folder = last_selected->getParentFolder(); if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) { diff --git a/indra/llui/llfolderviewitem.h b/indra/llui/llfolderviewitem.h index fe751be6b9..aa9ed0a1e8 100644 --- a/indra/llui/llfolderviewitem.h +++ b/indra/llui/llfolderviewitem.h @@ -279,6 +279,8 @@ public: // Does not need filter update virtual void refreshSuffix(); + bool isSingleFolderMode() { return mSingleFolderMode; } + // LLView functionality virtual BOOL handleRightMouseDown( S32 x, S32 y, MASK mask ); virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 6cf1edd26b..076f002f47 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2107,7 +2107,7 @@ void LLInventorySingleFolderPanel::changeFolderRoot(const LLUUID& new_id) void LLInventorySingleFolderPanel::onForwardFolder() { - if(!mForwardFolders.empty() && (mFolderID != mForwardFolders.back())) + if(isForwardAvailable()) { mBackwardFolders.push_back(mFolderID); mFolderID = mForwardFolders.back(); @@ -2118,7 +2118,7 @@ void LLInventorySingleFolderPanel::onForwardFolder() void LLInventorySingleFolderPanel::onBackwardFolder() { - if(!mBackwardFolders.empty() && (mFolderID != mBackwardFolders.back())) + if(isBackwardAvailable()) { mForwardFolders.push_back(mFolderID); mFolderID = mBackwardFolders.back(); @@ -2133,6 +2133,16 @@ void LLInventorySingleFolderPanel::clearNavigationHistory() mBackwardFolders.clear(); } +bool LLInventorySingleFolderPanel::isBackwardAvailable() +{ + return (!mBackwardFolders.empty() && (mFolderID != mBackwardFolders.back())); +} + +bool LLInventorySingleFolderPanel::isForwardAvailable() +{ + return (!mForwardFolders.empty() && (mFolderID != mForwardFolders.back())); +} + boost::signals2::connection LLInventorySingleFolderPanel::setRootChangedCallback(root_changed_callback_t cb) { return mRootChangedSignal.connect(cb); @@ -2186,6 +2196,12 @@ void LLInventorySingleFolderPanel::updateSingleFolderRoot() mFolderRoot.get()->setCallbackRegistrar(&mCommitCallbackRegistrar); buildNewViews(mFolderID); + + LLFloater* root_floater = gFloaterView->getParentFloater(this); + if(root_floater) + { + root_floater->setFocus(true); + } } } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index e9eaaa232d..31dd7aec23 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -403,6 +403,9 @@ public: void clearNavigationHistory(); LLUUID getSingleFolderRoot() { return mFolderID; } + bool isBackwardAvailable(); + bool isForwardAvailable(); + void setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb); typedef boost::function<void()> root_changed_callback_t; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index fd245a2b4d..1eb2d5bbdc 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -374,6 +374,10 @@ BOOL LLPanelMainInventory::handleKeyHere(KEY key, MASK mask) { startSearch(); } + if(mSingleFolderMode && key == KEY_LEFT) + { + onBackFolderClicked(); + } } return LLPanel::handleKeyHere(key, mask); @@ -1327,6 +1331,7 @@ void LLPanelMainInventory::setSingleFolderViewRoot(const LLUUID& folder_id, bool if(clear_nav_history) { mSingleFolderPanelInventory->clearNavigationHistory(); + updateNavButtons(); } } @@ -1756,6 +1761,17 @@ void LLPanelMainInventory::updateTitle() inventory_floater->setTitle(getString("inventory_title")); } } + updateNavButtons(); +} + +void LLPanelMainInventory::updateNavButtons() +{ + getChild<LLButton>("back_btn")->setEnabled(mSingleFolderPanelInventory->isBackwardAvailable()); + getChild<LLButton>("forward_btn")->setEnabled(mSingleFolderPanelInventory->isForwardAvailable()); + + const LLViewerInventoryCategory* cat = gInventory.getCategory(mSingleFolderPanelInventory->getSingleFolderRoot()); + bool up_enabled = (cat && cat->getParentUUID().notNull()); + getChild<LLButton>("up_btn")->setEnabled(up_enabled); } LLSidepanelInventory* LLPanelMainInventory::getParentSidepanelInventory() diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 6382f44bc9..7edaf7db96 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -179,6 +179,7 @@ protected: bool isActionVisible(const LLSD& userdata); static bool hasSettingsInventory(); void updateTitle(); + void updateNavButtons(); /** * Set upload cost in "Upload" sub menu. */ diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 9086f38893..d400835198 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -293,7 +293,9 @@ border="false" bevel_style="none" scroll.reserve_scroll_corner="false"> - <item folder_indentation="-8"/> + <item + single_folder_mode="true" + folder_indentation="-8"/> <folder single_folder_mode="true" folder_indentation="-8"/> |