on xenial help sign in
Merge dashSepartmentsListTweaks
commit6bcf96392bef71d79dc90589c4a384dc550ca67f authorAlbert Astals <albert.astals@canonical.com> dateWed 6 Aug 2014, 12:12 (12 years ago) parenta225cb154352ed
4 files changed+14−2
qml/Dash/DashContent.qml+2−1 qml/Dash/DashNavigation.qml+8−1 qml/Dash/DashNavigationList.qml+1 qml/Dash/GenericScopeView.qml+3
qml/Dash/DashContent.qml+2−1
@@ -88,7 +88,7 @@ Item {
8888 id: dashContentList
8989 objectName: "dashContentList"
9090
91− interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving
91+ interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving && !currentItem.departmentsShown
9292
9393 anchors.fill: parent
9494 orientation: ListView.Horizontal
@@ -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/DashNavigation.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 (navigation && navigation.loaded && x == navigationListView.contentX)
131137 {
138+ navigationListView.updateMaxHeight();
132139 return Math.min(implicitHeight, navigationListView.maxHeight);
133140 } else {
134141 return navigationListView.prevHeight;
qml/Dash/DashNavigationList.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: dashNavigation.showList
2829 property var scope: null
2930 property SortFilterProxyModel categories: categoryFilter
3031 property bool isCurrent: false
@@ -109,6 +110,7 @@ FocusScope {
109110 model: scopeView.categories
110111 forceNoClip: previewListView.open
111112 pixelAligned: true
113+ interactive: !dashNavigation.showList
112114
113115 property string expandedCategoryId: ""
114116
@@ -381,6 +383,7 @@ FocusScope {
381383 scopeStyle: scopeView.scopeStyle
382384
383385 bottomItem: DashNavigation {
386+ id: dashNavigation
384387 scope: scopeView.scope
385388 width: parent.width <= units.gu(60) ? parent.width : units.gu(40)
386389 anchors.right: parent.right