mirror of
https://github.com/huderlem/porymap.git
synced 2026-04-25 15:27:53 -05:00
Don't auto-expand Layout folders when searching map list
This commit is contained in:
parent
c0fb6022f5
commit
56722f7359
|
|
@ -37,6 +37,9 @@ public:
|
|||
void setFilterLocked(bool locked) { m_filterLocked = locked; }
|
||||
bool isFilterLocked() const { return m_filterLocked; }
|
||||
|
||||
void setExpandListForSearch(bool expand) { m_expandListForSearch = expand; }
|
||||
bool getExpandListForSearch() const { return m_expandListForSearch; }
|
||||
|
||||
void setSearchFocus();
|
||||
|
||||
signals:
|
||||
|
|
@ -51,6 +54,7 @@ private:
|
|||
bool m_filterLocked = false;
|
||||
bool m_editsAllowed = false;
|
||||
bool m_emptyFoldersVisible = true;
|
||||
bool m_expandListForSearch = true;
|
||||
};
|
||||
|
||||
#endif // MAPLISTTOOLBAR_H
|
||||
|
|
|
|||
|
|
@ -470,6 +470,10 @@ void MainWindow::initMapList() {
|
|||
ui->mapListToolBar_Locations->setEditsAllowedButtonVisible(false);
|
||||
ui->mapListToolBar_Layouts->setEditsAllowedButtonVisible(false);
|
||||
|
||||
// When searching the Layouts list, don't expand to show all the maps. If the user is searching
|
||||
// this list then they're probably more interested in the layouts than the maps.
|
||||
ui->mapListToolBar_Layouts->setExpandListForSearch(false);
|
||||
|
||||
// Initialize settings from config
|
||||
ui->mapListToolBar_Groups->setEditsAllowed(porymapConfig.mapListEditGroupsEnabled);
|
||||
for (auto i = porymapConfig.mapListHideEmptyEnabled.constBegin(); i != porymapConfig.mapListHideEmptyEnabled.constEnd(); i++) {
|
||||
|
|
|
|||
|
|
@ -138,7 +138,7 @@ void MapListToolBar::applyFilter(const QString &filterText) {
|
|||
if (filterText.isEmpty()) {
|
||||
m_list->collapseAll();
|
||||
emit filterCleared(m_list);
|
||||
} else {
|
||||
} else if (m_expandListForSearch) {
|
||||
m_list->expandToDepth(0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user