QmlDesigner: Fix content library sections not collapsing after search

Also enabled the auto expand for textures and environments tabs

Fixes: QDS-8443
Change-Id: I190f919ccb2cff90c7cd151e65b77ebd52f0a87c
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2022-11-29 16:29:31 +02:00
parent be97b35959
commit b5befc6945
3 changed files with 12 additions and 2 deletions

View File

@@ -42,6 +42,8 @@ Item {
// make sure categories with matches are expanded // make sure categories with matches are expanded
materialsView.expandVisibleSections() materialsView.expandVisibleSections()
texturesView.expandVisibleSections()
environmentsView.expandVisibleSections()
} }
} }

View File

@@ -32,7 +32,7 @@ HelperWidgets.ScrollView {
for (let i = 0; i < categoryRepeater.count; ++i) { for (let i = 0; i < categoryRepeater.count; ++i) {
let cat = categoryRepeater.itemAt(i) let cat = categoryRepeater.itemAt(i)
if (cat.visible && !cat.expanded) if (cat.visible && !cat.expanded)
cat.expanded = true cat.expandSection()
} }
} }
@@ -58,6 +58,10 @@ HelperWidgets.ScrollView {
expandOnClick: false expandOnClick: false
onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded
function expandSection() {
bundleCategoryExpanded = true
}
Grid { Grid {
width: root.width width: root.width
leftPadding: 5 leftPadding: 5

View File

@@ -33,7 +33,7 @@ HelperWidgets.ScrollView {
for (let i = 0; i < categoryRepeater.count; ++i) { for (let i = 0; i < categoryRepeater.count; ++i) {
let cat = categoryRepeater.itemAt(i) let cat = categoryRepeater.itemAt(i)
if (cat.visible && !cat.expanded) if (cat.visible && !cat.expanded)
cat.expanded = true cat.expandSection()
} }
} }
Column { Column {
@@ -58,6 +58,10 @@ HelperWidgets.ScrollView {
expandOnClick: false expandOnClick: false
onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded
function expandSection() {
bundleCategoryExpanded = true
}
Grid { Grid {
width: root.width width: root.width
leftPadding: 5 leftPadding: 5