Make files visible when searching in `FileBrowser` (#6845)

* Change the title for SideBarWidgets to be vertically centered related to icon and with no underlining

* Update src/gui/SideBarWidget.cpp

Co-authored-by: saker <sakertooth@gmail.com>

* Updating FileBrowser display when searching : showing matching files

* Correcting increment and removing duplicated calls

* Correcting reload tree when filter is activated

---------

Co-authored-by: saker <sakertooth@gmail.com>
This commit is contained in:
MrTopom
2023-09-10 17:52:18 +02:00
committed by GitHub
parent b353cbea82
commit a8d765f8d5
2 changed files with 95 additions and 38 deletions

View File

@@ -75,8 +75,7 @@ public:
private slots:
void reloadTree();
void expandItems( QTreeWidgetItem * item=nullptr, QList<QString> expandedDirs = QList<QString>() );
// call with item=NULL to filter the entire tree
bool filterItems( const QString & filter, QTreeWidgetItem * item=nullptr );
bool filterAndExpandItems(const QString & filter, QTreeWidgetItem * item = nullptr);
void giveFocusToFilter();
private:
@@ -84,6 +83,9 @@ private:
void addItems( const QString & path );
void saveDirectoriesStates();
void restoreDirectoriesStates();
FileBrowserTreeWidget * m_fileBrowserTreeWidget;
QLineEdit * m_filterEdit;
@@ -99,6 +101,8 @@ private:
QCheckBox* m_showFactoryContent = nullptr;
QString m_userDir;
QString m_factoryDir;
QList<QString> m_savedExpandedDirs;
QString m_previousFilterValue;
} ;
@@ -115,7 +119,6 @@ public:
//! that are expanded in the tree.
QList<QString> expandedDirs( QTreeWidgetItem * item = nullptr ) const;
protected:
void contextMenuEvent( QContextMenuEvent * e ) override;
void mousePressEvent( QMouseEvent * me ) override;