on xenial help sign in
Make GenericScopeView handle forced expansion instead of renderers on their own.
commit76c4bf8b48e7421745e8ff7a13869116552edc8e authorMichał Sawicz <michal.sawicz@canonical.com> dateThu 10 Jul 2014, 18:24 (12 years ago) parentb7aaa80
2 files changed+8−3
qml/Dash/CardGrid.qml+1−1 qml/Dash/GenericScopeView.qml+7−2
qml/Dash/CardGrid.qml+1−1
@@ -23,7 +23,7 @@ DashRenderer {
2323 readonly property int collapsedRows: cardTool && cardTool.template && cardTool.template["collapsed-rows"]
2424
2525 expandedHeight: grid.totalContentHeight
26− collapsedHeight: collapsedRows ? Math.min(grid.contentHeightForRows(collapsedRows), expandedHeight) : expandedHeight
26+ collapsedHeight: Math.min(grid.contentHeightForRows(collapsedRows), expandedHeight)
2727 originY: grid.originY
2828
2929 ResponsiveGridView {
qml/Dash/GenericScopeView.qml+7−2
@@ -128,7 +128,12 @@ FocusScope {
128128 highlightWhenPressed: false
129129 showDivider: false
130130
131− readonly property bool expandable: item ? item.expandedHeight > item.collapsedHeight : false
131+ readonly property bool expandable: {
132+ if (categoryView.model.count === 1) return false;
133+ if (cardTool.template && cardTool.template["collapsed-rows"] === 0) return false;
134+ if (item && item.expandedHeight > item.collapsedHeight) return true;
135+ return false;
136+ }
132137 property bool expanded: false
133138 readonly property string category: categoryId
134139 readonly property var item: rendererLoader.item
@@ -180,7 +185,7 @@ FocusScope {
180185 }
181186 }
182187
183− height: baseItem.expanded ? item.expandedHeight : item.collapsedHeight
188+ height: baseItem.expandable && !baseItem.expanded ? item.collapsedHeight : item.expandedHeight
184189
185190 source: {
186191 switch (cardTool.categoryLayout) {