on xenial help sign in
Dash Departments fixes

Update maxHeight manually since it depends on the position of the item and its parents and it can't know when the binding has to be updated Make parent stuff non interactive when the department list is shown Approved by: Michael Terry

commit68abd8eaaae381f5a021cbc9d013db58e627b61d authorAlbert Astals <albert.astals@canonical.com> dateWed 6 Aug 2014, 19:36 (12 years ago) parente15d89b54352ed
4 files changed+14−2
qml/Dash/DashContent.qml+2−1 qml/Dash/DashDepartments.qml+8−1 qml/Dash/DashDepartmentsList.qml+1 qml/Dash/GenericScopeView.qml+3
qml/Dash/DashContent.qml+2−1
@@ -89,7 +89,7 @@ Item {
8989 id: dashContentList
9090 objectName: "dashContentList"
9191
92− interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving
92+ interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.departmentsShown
9393
9494 anchors.fill: parent
9595 model: dashContent.model
@@ -130,6 +130,7 @@ Item {
130130 objectName: scope.id + " loader"
131131
132132 readonly property bool moving: item ? item.moving : false
133+ readonly property bool departmentsShown: item ? item.departmentsShown : false
133134 readonly property var categoryView: item ? item.categoryView : null
134135 readonly property var theScope: scope
135136
qml/Dash/DashDepartments.qml+8−1
@@ -39,6 +39,7 @@ AbstractButton {
3939 height: visible ? units.gu(5) : 0
4040
4141 onClicked: {
42+ departmentListView.updateMaxHeight();
4243 root.showList = !root.showList;
4344 }
4445
@@ -111,7 +112,12 @@ AbstractButton {
111112 right: parent.right
112113 top: root.bottom
113114 }
114− readonly property int maxHeight: (windowHeight - mapToItem(null, root.x, root.y).y) - units.gu(8)
115+ property int maxHeight: -1
116+ Component.onCompleted: updateMaxHeight();
117+ function updateMaxHeight()
118+ {
119+ maxHeight = (windowHeight - mapToItem(null, 0, 0).y) - units.gu(8);
120+ }
115121 property int prevHeight: maxHeight
116122 height: currentItem ? currentItem.height : maxHeight
117123 onHeightChanged: {
@@ -129,6 +135,7 @@ AbstractButton {
129135 if (root.showList) {
130136 if (department && department.loaded && x == departmentListView.contentX)
131137 {
138+ departmentListView.updateMaxHeight();
132139 return Math.min(implicitHeight, departmentListView.maxHeight);
133140 } else {
134141 return departmentListView.prevHeight;
qml/Dash/DashDepartmentsList.qml+1
@@ -54,6 +54,7 @@ Item {
5454
5555 anchors.fill: parent
5656
57+ flickableDirection: Flickable.VerticalFlick
5758 contentHeight: column.height
5859 contentWidth: width
5960
qml/Dash/GenericScopeView.qml+3
@@ -25,6 +25,7 @@ import "../Components/ListItems" as ListItems
2525FocusScope {
2626 id: scopeView
2727
28+ readonly property alias departmentsShown: dashDepartments.showList
2829 property var scope: null
2930 property SortFilterProxyModel categories: categoryFilter
3031 property bool isCurrent: false
@@ -119,6 +120,7 @@ FocusScope {
119120 model: scopeView.categories
120121 forceNoClip: previewListView.open
121122 pixelAligned: true
123+ interactive: !dashDepartments.showList
122124
123125 property string expandedCategoryId: ""
124126
@@ -391,6 +393,7 @@ FocusScope {
391393 scopeStyle: scopeView.scopeStyle
392394
393395 bottomItem: DashDepartments {
396+ id: dashDepartments
394397 scope: scopeView.scope
395398 width: parent.width <= units.gu(60) ? parent.width : units.gu(40)
396399 anchors.right: parent.right