on xenial help sign in
Dash Departments fixes
68abd8eAlbert Astals
qml/Dash/DashContent.qml+2−1
@@ -89,7 +89,7 @@ Item {
89 id: dashContentList
89 id: dashContentList
90 objectName: "dashContentList"
90 objectName: "dashContentList"
91
91
92− interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving
92+ interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.departmentsShown
93
93
94 anchors.fill: parent
94 anchors.fill: parent
95 model: dashContent.model
95 model: dashContent.model
@@ -130,6 +130,7 @@ Item {
130 objectName: scope.id + " loader"
130 objectName: scope.id + " loader"
131
131
132 readonly property bool moving: item ? item.moving : false
132 readonly property bool moving: item ? item.moving : false
133+ readonly property bool departmentsShown: item ? item.departmentsShown : false
133 readonly property var categoryView: item ? item.categoryView : null
134 readonly property var categoryView: item ? item.categoryView : null
134 readonly property var theScope: scope
135 readonly property var theScope: scope
135
136
qml/Dash/DashDepartments.qml+8−1
@@ -39,6 +39,7 @@ AbstractButton {
39 height: visible ? units.gu(5) : 0
39 height: visible ? units.gu(5) : 0
40
40
41 onClicked: {
41 onClicked: {
42+ departmentListView.updateMaxHeight();
42 root.showList = !root.showList;
43 root.showList = !root.showList;
43 }
44 }
44
45
@@ -111,7 +112,12 @@ AbstractButton {
111 right: parent.right
112 right: parent.right
112 top: root.bottom
113 top: root.bottom
113 }
114 }
115+ property int maxHeight: -1
116+ Component.onCompleted: updateMaxHeight();
117+ function updateMaxHeight()
118+ {
114− readonly property int maxHeight: (windowHeight - mapToItem(null, root.x, root.y).y) - units.gu(8)
119+ maxHeight = (windowHeight - mapToItem(null, 0, 0).y) - units.gu(8);
120+ }
115 property int prevHeight: maxHeight
121 property int prevHeight: maxHeight
116 height: currentItem ? currentItem.height : maxHeight
122 height: currentItem ? currentItem.height : maxHeight
117 onHeightChanged: {
123 onHeightChanged: {
@@ -129,6 +135,7 @@ AbstractButton {
129 if (root.showList) {
135 if (root.showList) {
130 if (department && department.loaded && x == departmentListView.contentX)
136 if (department && department.loaded && x == departmentListView.contentX)
131 {
137 {
138+ departmentListView.updateMaxHeight();
132 return Math.min(implicitHeight, departmentListView.maxHeight);
139 return Math.min(implicitHeight, departmentListView.maxHeight);
133 } else {
140 } else {
134 return departmentListView.prevHeight;
141 return departmentListView.prevHeight;
qml/Dash/DashDepartmentsList.qml+1
@@ -54,6 +54,7 @@ Item {
54
54
55 anchors.fill: parent
55 anchors.fill: parent
56
56
57+ flickableDirection: Flickable.VerticalFlick
57 contentHeight: column.height
58 contentHeight: column.height
58 contentWidth: width
59 contentWidth: width
59
60
qml/Dash/GenericScopeView.qml+3
@@ -25,6 +25,7 @@ import "../Components/ListItems" as ListItems
25FocusScope {
25FocusScope {
26 id: scopeView
26 id: scopeView
27
27
28+ readonly property alias departmentsShown: dashDepartments.showList
28 property var scope: null
29 property var scope: null
29 property SortFilterProxyModel categories: categoryFilter
30 property SortFilterProxyModel categories: categoryFilter
30 property bool isCurrent: false
31 property bool isCurrent: false
@@ -119,6 +120,7 @@ FocusScope {
119 model: scopeView.categories
120 model: scopeView.categories
120 forceNoClip: previewListView.open
121 forceNoClip: previewListView.open
121 pixelAligned: true
122 pixelAligned: true
123+ interactive: !dashDepartments.showList
122
124
123 property string expandedCategoryId: ""
125 property string expandedCategoryId: ""
124
126
@@ -391,6 +393,7 @@ FocusScope {
391 scopeStyle: scopeView.scopeStyle
393 scopeStyle: scopeView.scopeStyle
392
394
393 bottomItem: DashDepartments {
395 bottomItem: DashDepartments {
396+ id: dashDepartments
394 scope: scopeView.scope
397 scope: scopeView.scope
395 width: parent.width <= units.gu(60) ? parent.width : units.gu(40)
398 width: parent.width <= units.gu(60) ? parent.width : units.gu(40)
396 anchors.right: parent.right
399 anchors.right: parent.right