on xenial help sign in
fix open vs onScreen for the previewlist
commit9f814789fdbb1408c189bf24e2ba87e40acfd722 authorAlbert Astals <albert.astals@canonical.com> dateFri 21 Feb 2014, 17:19 (13 years ago) parent695814c
6 files changed+7−65
qml/Dash/Dash.qml+1−1 qml/Dash/DashContent.qml+2−2 qml/Dash/DashContentOpenEffect.qml−55 qml/Dash/GenericScopeView.qml+2−2 qml/Dash/PreviewListView.qml+1−4 qml/Dash/ScopeItem.qml+1−1
qml/Dash/Dash.qml+1−1
@@ -27,7 +27,7 @@ Showable {
2727 visible: shown
2828
2929 property ListModel searchHistory: SearchHistoryModel {}
30− property bool searchable: !dashContent.previewOnScreen && !scopeItem.previewOnScreen
30+ property bool searchable: !dashContent.previewOpen && !scopeItem.previewOpen
3131
3232 property alias contentProgress: dashContent.contentProgress
3333 property string showScopeOnLoaded: "clickscope"
qml/Dash/DashContent.qml+2−2
@@ -26,7 +26,7 @@ Item {
2626 property var scopes: null
2727 property real contentProgress: Math.max(0, Math.min(dashContentList.contentX / (dashContentList.contentWidth - dashContentList.width), units.dp(1)))
2828 property alias currentIndex: dashContentList.currentIndex
29− property alias previewOnScreen: previewListView.onScreen
29+ property alias previewOpen: previewListView.open
3030
3131 property ScopeDelegateMapper scopeMapper : ScopeDelegateMapper {}
3232 property ListModel searchHistory
@@ -103,7 +103,7 @@ Item {
103103 id: dashContentList
104104 objectName: "dashContentList"
105105
106− interactive: dashContent.scopes.loaded && !previewListView.onScreen && !currentItem.moving
106+ interactive: dashContent.scopes.loaded && !previewListView.open && !currentItem.moving
107107
108108 anchors.fill: parent
109109 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 {
5555 Binding {
5656 target: scope
5757 property: "isActive"
58− value: isCurrent && !previewListView.onScreen
58+ value: isCurrent && !previewListView.open
5959 }
6060
6161 Timer {
@@ -115,7 +115,7 @@ FocusScope {
115115 objectName: "categoryListView"
116116 anchors.fill: parent
117117 model: scopeView.categories
118− forceNoClip: previewListView.onScreen
118+ forceNoClip: previewListView.open
119119
120120 onAtYEndChanged: if (atYEnd) endReached()
121121 onMovingChanged: if (moving && atYEnd) endReached()
qml/Dash/PreviewListView.qml+1−4
@@ -27,7 +27,6 @@ Item {
2727 property var pageHeader: null
2828
2929 property alias open: previewListView.open
30− property alias onScreen: previewListView.onScreen
3130 property alias model: previewListView.model
3231 property alias currentIndex: previewListView.currentIndex
3332 property alias currentItem: previewListView.currentItem
@@ -85,11 +84,9 @@ Item {
8584 property bool init: true
8685
8786 property bool open: false
88− property bool onScreen: false
8987
9088 onOpenChanged: {
9189 if (open) {
92− onScreen = true;
9390 pageHeader.unfocus();
9491 } else {
9592 // Cancel any pending preview requests or actions
@@ -133,7 +130,7 @@ Item {
133130
134131 ActivityIndicator {
135132 anchors.centerIn: parent
136− visible: root.onScreen && parent.enabled
133+ visible: root.open && parent.enabled
137134 running: visible
138135 }
139136 }
qml/Dash/ScopeItem.qml+1−1
@@ -23,7 +23,7 @@ Item {
2323 id: root
2424
2525 property alias scope: scopeView.scope
26− property alias previewOnScreen: previewListView.onScreen
26+ property alias previewOpen: previewListView.open
2727
2828 property ListModel searchHistory
2929