QmlDesigner: Fix toggle section expand after choosing expand all

Fixes: QDS-8104
Change-Id: I6191a7b249490e6193acdd8b618c0817a3fc6ab3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2022-10-27 18:15:52 +03:00
parent 564298bba5
commit 2a4de97a84
2 changed files with 16 additions and 3 deletions

View File

@@ -270,6 +270,8 @@ Item {
expanded: bundleCategoryExpanded expanded: bundleCategoryExpanded
expandOnClick: false expandOnClick: false
onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded onToggleExpand: bundleCategoryExpanded = !bundleCategoryExpanded
onExpand: bundleCategoryExpanded = true
onCollapse: bundleCategoryExpanded = false
Grid { Grid {
width: scrollView.width width: scrollView.width

View File

@@ -72,10 +72,19 @@ Item {
Connections { Connections {
target: Controller target: Controller
function onCollapseAll() { function onCollapseAll() {
if (collapsible) if (collapsible) {
if (section.expandOnClick)
section.expanded = false section.expanded = false
else
section.collapse()
}
}
function onExpandAll() {
if (section.expandOnClick)
section.expanded = true
else
section.expand()
} }
function onExpandAll() { section.expanded = true }
} }
signal drop(var drag) signal drop(var drag)
@@ -83,6 +92,8 @@ Item {
signal dropExit() signal dropExit()
signal showContextMenu() signal showContextMenu()
signal toggleExpand() signal toggleExpand()
signal expand()
signal collapse()
DropArea { DropArea {
id: dropArea id: dropArea