on xenial help sign in
Merge dashSepartmentsListTweaks
6bcf963Albert Astals
qml/Dash/DashContent.qml+2−1
@@ -88,7 +88,7 @@ Item {
88 id: dashContentList
88 id: dashContentList
89 objectName: "dashContentList"
89 objectName: "dashContentList"
90
90
91− interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving
91+ interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.departmentsShown
92
92
93 anchors.fill: parent
93 anchors.fill: parent
94 orientation: ListView.Horizontal
94 orientation: ListView.Horizontal
@@ -128,6 +128,7 @@ Item {
128 objectName: scope.id + " loader"
128 objectName: scope.id + " loader"
129
129
130 readonly property bool moving: item ? item.moving : false
130 readonly property bool moving: item ? item.moving : false
131+ readonly property bool departmentsShown: item ? item.departmentsShown : false
131 readonly property var categoryView: item ? item.categoryView : null
132 readonly property var categoryView: item ? item.categoryView : null
132 readonly property var theScope: scope
133 readonly property var theScope: scope
133
134
qml/Dash/DashNavigation.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 (navigation && navigation.loaded && x == navigationListView.contentX)
136 if (navigation && navigation.loaded && x == navigationListView.contentX)
131 {
137 {
138+ navigationListView.updateMaxHeight();
132 return Math.min(implicitHeight, navigationListView.maxHeight);
139 return Math.min(implicitHeight, navigationListView.maxHeight);
133 } else {
140 } else {
134 return navigationListView.prevHeight;
141 return navigationListView.prevHeight;
qml/Dash/DashNavigationList.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: dashNavigation.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
@@ -109,6 +110,7 @@ FocusScope {
109 model: scopeView.categories
110 model: scopeView.categories
110 forceNoClip: previewListView.open
111 forceNoClip: previewListView.open
111 pixelAligned: true
112 pixelAligned: true
113+ interactive: !dashNavigation.showList
112
114
113 property string expandedCategoryId: ""
115 property string expandedCategoryId: ""
114
116
@@ -381,6 +383,7 @@ FocusScope {
381 scopeStyle: scopeView.scopeStyle
383 scopeStyle: scopeView.scopeStyle
382
384
383 bottomItem: DashNavigation {
385 bottomItem: DashNavigation {
386+ id: dashNavigation
384 scope: scopeView.scope
387 scope: scopeView.scope
385 width: parent.width <= units.gu(60) ? parent.width : units.gu(40)
388 width: parent.width <= units.gu(60) ? parent.width : units.gu(40)
386 anchors.right: parent.right
389 anchors.right: parent.right