mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-10 13:35:31 +02:00
[PowerRename] Add Filtering Feature (#6017)
* Implement basic functionality * Change approach. move filter controls to manager edit redrawing to always work with new GetVisibleItemCount() and GetVisibleItemByIndex() calls * Fix performance issues. Some refactoring. * Handle toggleAll correctly * Handle dangling elements when filter is on Make an item visible if it has at least one visible subitem * Support filtering for selected and shouldRename * Refactor for readability, remove useless member from PowerRenameUI * Change variable names in PowerRenameUI for clarity Use wrapper function RedrawItems() and SetItemCount() for consistency * Handle result value properly in getVisibleItemByIndex() * Add FlagsApplicable filter * Add visual indication of filters * Improve performance Check if no filter is selected Call SetItemCount() only when necessary * Refactor for readability * Get lock in setVisible() * Change function names to camel case * Change function names to start with uppercase * Change filter behaviour when search area is empty Show all elements when search area is empty and ShouldRename filter is selected Avoid warnings * Resolve conflicts
This commit is contained in:
committed by
GitHub
parent
3ede1a0b53
commit
d3b80b26e3
@@ -26,16 +26,21 @@ public:
|
||||
IFACEMETHODIMP Rename(_In_ HWND hwndParent);
|
||||
IFACEMETHODIMP AddItem(_In_ IPowerRenameItem* pItem);
|
||||
IFACEMETHODIMP GetItemByIndex(_In_ UINT index, _COM_Outptr_ IPowerRenameItem** ppItem);
|
||||
IFACEMETHODIMP GetVisibleItemByIndex(_In_ UINT index, _COM_Outptr_ IPowerRenameItem** ppItem);
|
||||
IFACEMETHODIMP GetItemById(_In_ int id, _COM_Outptr_ IPowerRenameItem** ppItem);
|
||||
IFACEMETHODIMP GetItemCount(_Out_ UINT* count);
|
||||
IFACEMETHODIMP SetVisible();
|
||||
IFACEMETHODIMP GetVisibleItemCount(_Out_ UINT* count);
|
||||
IFACEMETHODIMP GetSelectedItemCount(_Out_ UINT* count);
|
||||
IFACEMETHODIMP GetRenameItemCount(_Out_ UINT* count);
|
||||
IFACEMETHODIMP get_flags(_Out_ DWORD* flags);
|
||||
IFACEMETHODIMP put_flags(_In_ DWORD flags);
|
||||
IFACEMETHODIMP get_renameRegEx(_COM_Outptr_ IPowerRenameRegEx** ppRegEx);
|
||||
IFACEMETHODIMP put_renameRegEx(_In_ IPowerRenameRegEx* pRegEx);
|
||||
IFACEMETHODIMP get_renameItemFactory(_COM_Outptr_ IPowerRenameItemFactory** ppItemFactory);
|
||||
IFACEMETHODIMP put_renameItemFactory(_In_ IPowerRenameItemFactory* pItemFactory);
|
||||
IFACEMETHODIMP GetFlags(_Out_ DWORD* flags);
|
||||
IFACEMETHODIMP PutFlags(_In_ DWORD flags);
|
||||
IFACEMETHODIMP GetFilter(_Out_ DWORD* filter);
|
||||
IFACEMETHODIMP SwitchFilter(_In_ int columnNumber);
|
||||
IFACEMETHODIMP GetRenameRegEx(_COM_Outptr_ IPowerRenameRegEx** ppRegEx);
|
||||
IFACEMETHODIMP PutRenameRegEx(_In_ IPowerRenameRegEx* pRegEx);
|
||||
IFACEMETHODIMP GetRenameItemFactory(_COM_Outptr_ IPowerRenameItemFactory** ppItemFactory);
|
||||
IFACEMETHODIMP PutRenameItemFactory(_In_ IPowerRenameItemFactory* pItemFactory);
|
||||
|
||||
// IPowerRenameRegExEvents
|
||||
IFACEMETHODIMP OnSearchTermChanged(_In_ PCWSTR searchTerm);
|
||||
@@ -102,6 +107,8 @@ protected:
|
||||
DWORD m_cookie = 0;
|
||||
DWORD m_regExAdviseCookie = 0;
|
||||
|
||||
DWORD m_filter = PowerRenameFilters::None;
|
||||
|
||||
struct RENAME_MGR_EVENT
|
||||
{
|
||||
IPowerRenameManagerEvents* pEvents;
|
||||
@@ -113,6 +120,7 @@ protected:
|
||||
|
||||
_Guarded_by_(m_lockEvents) std::vector<RENAME_MGR_EVENT> m_powerRenameManagerEvents;
|
||||
_Guarded_by_(m_lockItems) std::map<int, IPowerRenameItem*> m_renameItems;
|
||||
_Guarded_by_(m_lockItems) std::vector<bool> m_isVisible;
|
||||
|
||||
// Parent HWND used by IFileOperation
|
||||
HWND m_hwndParent = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user