on xenial help sign in
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

commit4865ffce082715bca36905c5e64e7f5d7a54b0f8 authorAlbert Astals <albert.astals@canonical.com> dateFri 25 Jul 2014, 14:42 (12 years ago) parent3d1d3f0
3 files changed+13−2
qml/Dash/DashContent.qml+2−1 qml/Dash/DashDepartments.qml+8−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
@@ -128,6 +128,7 @@ Item {
128128 objectName: scope.id + " loader"
129129
130130 readonly property bool moving: item ? item.moving : false
131+ readonly property bool departmentsShown: item ? item.departmentsShown : false
131132 readonly property var categoryView: item ? item.categoryView : null
132133 readonly property var theScope: scope
133134
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/GenericScopeView.qml+3
@@ -26,6 +26,7 @@ import "../Components/ListItems" as ListItems
2626FocusScope {
2727 id: scopeView
2828
29+ readonly property alias departmentsShown: dashDepartments.showList
2930 property var scope: null
3031 property SortFilterProxyModel categories: categoryFilter
3132 property bool isCurrent: false
@@ -120,6 +121,7 @@ FocusScope {
120121 model: scopeView.categories
121122 forceNoClip: previewListView.open
122123 pixelAligned: true
124+ interactive: !dashDepartments.showList
123125
124126 property string expandedCategoryId: ""
125127
@@ -400,6 +402,7 @@ FocusScope {
400402 scopeStyle: scopeView.scopeStyle
401403
402404 bottomItem: DashDepartments {
405+ id: dashDepartments
403406 scope: scopeView.scope
404407 width: parent.width <= units.gu(60) ? parent.width : units.gu(40)
405408 anchors.right: parent.right