From b5befc694514d1b223b56a5c65fe4ac859cdbb2f Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Tue, 29 Nov 2022 16:29:31 +0200 Subject: 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 --- .../qmldesigner/contentLibraryQmlSource/ContentLibrary.qml | 2 ++ .../contentLibraryQmlSource/ContentLibraryMaterialsView.qml | 6 +++++- .../contentLibraryQmlSource/ContentLibraryTexturesView.qml | 6 +++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibrary.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibrary.qml index 8d699308478..53fae29a533 100644 --- a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibrary.qml +++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibrary.qml @@ -42,6 +42,8 @@ Item { // make sure categories with matches are expanded materialsView.expandVisibleSections() + texturesView.expandVisibleSections() + environmentsView.expandVisibleSections() } } diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialsView.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialsView.qml index 6a17a98a9d3..6483ebdd6bd 100644 --- a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialsView.qml +++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryMaterialsView.qml @@ -32,7 +32,7 @@ HelperWidgets.ScrollView { for (let i = 0; i < categoryRepeater.count; ++i) { let cat = categoryRepeater.itemAt(i) if (cat.visible && !cat.expanded) - cat.expanded = true + cat.expandSection() } } @@ -58,6 +58,10 @@ HelperWidgets.ScrollView { expandOnClick: false onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded + function expandSection() { + bundleCategoryExpanded = true + } + Grid { width: root.width leftPadding: 5 diff --git a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexturesView.qml b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexturesView.qml index 6027d4b6904..dd6509b67ec 100644 --- a/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexturesView.qml +++ b/share/qtcreator/qmldesigner/contentLibraryQmlSource/ContentLibraryTexturesView.qml @@ -33,7 +33,7 @@ HelperWidgets.ScrollView { for (let i = 0; i < categoryRepeater.count; ++i) { let cat = categoryRepeater.itemAt(i) if (cat.visible && !cat.expanded) - cat.expanded = true + cat.expandSection() } } Column { @@ -58,6 +58,10 @@ HelperWidgets.ScrollView { expandOnClick: false onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded + function expandSection() { + bundleCategoryExpanded = true + } + Grid { width: root.width leftPadding: 5 -- cgit v1.2.3