on xenial help sign in
fix open vs onScreen for the previewlist
9f81478Albert Astals
qml/Dash/Dash.qml+1−1
@@ -27,7 +27,7 @@ Showable {
27 visible: shown
27 visible: shown
28
28
29 property ListModel searchHistory: SearchHistoryModel {}
29 property ListModel searchHistory: SearchHistoryModel {}
30− property bool searchable: !dashContent.previewOnScreen && !scopeItem.previewOnScreen
30+ property bool searchable: !dashContent.previewOpen && !scopeItem.previewOpen
31
31
32 property alias contentProgress: dashContent.contentProgress
32 property alias contentProgress: dashContent.contentProgress
33 property string showScopeOnLoaded: "clickscope"
33 property string showScopeOnLoaded: "clickscope"
qml/Dash/DashContent.qml+2−2
@@ -26,7 +26,7 @@ Item {
26 property var scopes: null
26 property var scopes: null
27 property real contentProgress: Math.max(0, Math.min(dashContentList.contentX / (dashContentList.contentWidth - dashContentList.width), units.dp(1)))
27 property real contentProgress: Math.max(0, Math.min(dashContentList.contentX / (dashContentList.contentWidth - dashContentList.width), units.dp(1)))
28 property alias currentIndex: dashContentList.currentIndex
28 property alias currentIndex: dashContentList.currentIndex
29− property alias previewOnScreen: previewListView.onScreen
29+ property alias previewOpen: previewListView.open
30
30
31 property ScopeDelegateMapper scopeMapper : ScopeDelegateMapper {}
31 property ScopeDelegateMapper scopeMapper : ScopeDelegateMapper {}
32 property ListModel searchHistory
32 property ListModel searchHistory
@@ -103,7 +103,7 @@ Item {
103 id: dashContentList
103 id: dashContentList
104 objectName: "dashContentList"
104 objectName: "dashContentList"
105
105
106− interactive: dashContent.scopes.loaded && !previewListView.onScreen && !currentItem.moving
106+ interactive: dashContent.scopes.loaded && !previewListView.open && !currentItem.moving
107
107
108 anchors.fill: parent
108 anchors.fill: parent
109 model: dashContent.model
109 model: dashContent.model
qml/Dash/DashContentOpenEffect.qmldeleted−55
@@ -1,55 +0,0 @@
1−/*
2− * Copyright (C) 2013 Canonical, Ltd.
3− *
4− * This program is free software; you can redistribute it and/or modify
5− * it under the terms of the GNU General Public License as published by
6− * the Free Software Foundation; version 3.
7− *
8− * This program is distributed in the hope that it will be useful,
9− * but WITHOUT ANY WARRANTY; without even the implied warranty of
10− * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11− * GNU General Public License for more details.
12− *
13− * You should have received a copy of the GNU General Public License
14− * along with this program. If not, see <http://www.gnu.org/licenses/>.
15− */
16−
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−import "../Components"
20−
21−OpenEffect {
22− property PreviewListView previewListView: null
23−
24− objectName: "openEffect"
25− anchors {
26− fill: parent
27− }
28−
29− enabled: gap > 0.0
30−
31− topGapPx: (1 - gap) * positionPx
32− topOpacity: (1 - gap * 1.2)
33− bottomGapPx: positionPx + gap * (targetBottomGapPx - positionPx)
34− live: !expansionAnimation.running
35−
36− property int targetBottomGapPx: height
37− property real gap: previewListView.open ? 1.0 : 0.0
38−
39− Behavior on gap {
40− NumberAnimation {
41− id: expansionAnimation
42− duration: 200
43− easing.type: Easing.InOutQuad
44− onRunningChanged: {
45− if (!previewListView.open && !running) {
46− previewListView.onScreen = false
47− }
48− }
49− }
50− }
51− Behavior on positionPx {
52− enabled: previewListView.open
53− UbuntuNumberAnimation {}
54− }
55−}
qml/Dash/GenericScopeView.qml+2−2
@@ -55,7 +55,7 @@ FocusScope {
55 Binding {
55 Binding {
56 target: scope
56 target: scope
57 property: "isActive"
57 property: "isActive"
58− value: isCurrent && !previewListView.onScreen
58+ value: isCurrent && !previewListView.open
59 }
59 }
60
60
61 Timer {
61 Timer {
@@ -115,7 +115,7 @@ FocusScope {
115 objectName: "categoryListView"
115 objectName: "categoryListView"
116 anchors.fill: parent
116 anchors.fill: parent
117 model: scopeView.categories
117 model: scopeView.categories
118− forceNoClip: previewListView.onScreen
118+ forceNoClip: previewListView.open
119
119
120 onAtYEndChanged: if (atYEnd) endReached()
120 onAtYEndChanged: if (atYEnd) endReached()
121 onMovingChanged: if (moving && atYEnd) endReached()
121 onMovingChanged: if (moving && atYEnd) endReached()
qml/Dash/PreviewListView.qml+1−4
@@ -27,7 +27,6 @@ Item {
27 property var pageHeader: null
27 property var pageHeader: null
28
28
29 property alias open: previewListView.open
29 property alias open: previewListView.open
30− property alias onScreen: previewListView.onScreen
31 property alias model: previewListView.model
30 property alias model: previewListView.model
32 property alias currentIndex: previewListView.currentIndex
31 property alias currentIndex: previewListView.currentIndex
33 property alias currentItem: previewListView.currentItem
32 property alias currentItem: previewListView.currentItem
@@ -85,11 +84,9 @@ Item {
85 property bool init: true
84 property bool init: true
86
85
87 property bool open: false
86 property bool open: false
88− property bool onScreen: false
89
87
90 onOpenChanged: {
88 onOpenChanged: {
91 if (open) {
89 if (open) {
92− onScreen = true;
93 pageHeader.unfocus();
90 pageHeader.unfocus();
94 } else {
91 } else {
95 // Cancel any pending preview requests or actions
92 // Cancel any pending preview requests or actions
@@ -133,7 +130,7 @@ Item {
133
130
134 ActivityIndicator {
131 ActivityIndicator {
135 anchors.centerIn: parent
132 anchors.centerIn: parent
136− visible: root.onScreen && parent.enabled
133+ visible: root.open && parent.enabled
137 running: visible
134 running: visible
138 }
135 }
139 }
136 }
qml/Dash/ScopeItem.qml+1−1
@@ -23,7 +23,7 @@ Item {
23 id: root
23 id: root
24
24
25 property alias scope: scopeView.scope
25 property alias scope: scopeView.scope
26− property alias previewOnScreen: previewListView.onScreen
26+ property alias previewOpen: previewListView.open
27
27
28 property ListModel searchHistory
28 property ListModel searchHistory
29
29