From 4d5ff92b2ca8c35a73cd92dcd513417c03004429 Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Sat, 10 Oct 2020 14:40:49 +0200 Subject: [PATCH] [ExpandableListItem] Load expanded view on demand --- .../qml/ExpandableListItem.qml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/declarativeimports/plasmaextracomponents/qml/ExpandableListItem.qml b/src/declarativeimports/plasmaextracomponents/qml/ExpandableListItem.qml index 0bdb579ce..191ca4a21 100644 --- a/src/declarativeimports/plasmaextracomponents/qml/ExpandableListItem.qml +++ b/src/declarativeimports/plasmaextracomponents/qml/ExpandableListItem.qml @@ -287,7 +287,7 @@ Item { * Show the expanded view, growing the list item to its taller size. */ function expand() { - expandedView.visible = true + expandedView.active = true listItem.itemExpanded(listItem) } @@ -296,7 +296,7 @@ Item { * Hide the expanded view and collapse the list item to its shorter size. */ function collapse() { - expandedView.visible = false + expandedView.active = false listItem.itemCollapsed(listItem) } @@ -305,7 +305,7 @@ Item { * Expand or collapse the list item depending on its current state. */ function toggleExpanded() { - expandedView.visible ? listItem.collapse() : listItem.expand() + expandedView.active ? listItem.collapse() : listItem.expand() } signal itemExpanded(variant item) @@ -454,7 +454,7 @@ Item { enabled: listItem.isEnabled visible: defaultActionButtonAction && listItem.defaultActionButtonVisible - && (clickAndHoverHandler.containsMouse || expandedView.visible) + && (clickAndHoverHandler.containsMouse || expandedView.active) && (!busyIndicator.visible || listItem.showDefaultActionButtonWhenBusy) } @@ -462,7 +462,7 @@ Item { PlasmaComponents3.Button { visible: clickAndHoverHandler.containsMouse || expandedView.visible - icon.name: expandedView.visible? "collapse" : "expand" + icon.name: expandedView.active? "collapse" : "expand" onClicked: listItem.toggleExpanded() } @@ -473,10 +473,10 @@ Item { Loader { id: expandedView - visible: false - opacity: visible ? 1.0 : 0 + visible: active + opacity: active ? 1.0 : 0 - active: customExpandedViewContent != undefined + active: false sourceComponent: customExpandedViewContent Layout.fillWidth: true