on xenial help sign in
Make GenericScopeView handle forced expansion instead of renderers on their own.
76c4bf8Michał Sawicz
qml/Dash/CardGrid.qml+1−1
@@ -23,7 +23,7 @@ DashRenderer {
23 readonly property int collapsedRows: cardTool && cardTool.template && cardTool.template["collapsed-rows"]
23 readonly property int collapsedRows: cardTool && cardTool.template && cardTool.template["collapsed-rows"]
24
24
25 expandedHeight: grid.totalContentHeight
25 expandedHeight: grid.totalContentHeight
26− collapsedHeight: collapsedRows ? Math.min(grid.contentHeightForRows(collapsedRows), expandedHeight) : expandedHeight
26+ collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows), expandedHeight)
27 originY: grid.originY
27 originY: grid.originY
28
28
29 ResponsiveGridView {
29 ResponsiveGridView {
qml/Dash/GenericScopeView.qml+7−2
@@ -128,7 +128,12 @@ FocusScope {
128 highlightWhenPressed: false
128 highlightWhenPressed: false
129 showDivider: false
129 showDivider: false
130
130
131+ readonly property bool expandable: {
132+ if (categoryView.model.count === 1) return false;
133+ if (cardTool.template && cardTool.template["collapsed-rows"] === 0) return false;
131− readonly property bool expandable: item ? item.expandedHeight > item.collapsedHeight : false
134+ if (item && item.expandedHeight > item.collapsedHeight) return true;
135+ return false;
136+ }
132 property bool expanded: false
137 property bool expanded: false
133 readonly property string category: categoryId
138 readonly property string category: categoryId
134 readonly property var item: rendererLoader.item
139 readonly property var item: rendererLoader.item
@@ -180,7 +185,7 @@ FocusScope {
180 }
185 }
181 }
186 }
182
187
183− height: baseItem.expanded ? item.expandedHeight : item.collapsedHeight
188+ height: baseItem.expandable && !baseItem.expanded ? item.collapsedHeight : item.expandedHeight
184
189
185 source: {
190 source: {
186 switch (cardTool.categoryLayout) {
191 switch (cardTool.categoryLayout) {